[PATCH v6 3/4] brcmfmac: change to use mmc api for accessing host supported maximum segment count and size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Using mmc standard api to get the host sg capability.

Signed-off-by: Xinming Hu <huxm@xxxxxxxxxxx>
---
v6: separate driver patch from patch 1/4.
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
index cd58732..d0e08d0 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
@@ -886,19 +886,21 @@ void brcmf_sdiod_sgtable_alloc(struct brcmf_sdio_dev *sdiodev)
 {
 	struct sdio_func *func;
 	struct mmc_host *host;
+	unsigned short max_segs = 0;
 	uint max_blocks;
 	uint nents;
 	int err;
 
 	func = sdiodev->func[2];
 	host = func->card->host;
-	sdiodev->sg_support = host->max_segs > 1;
+
+	max_segs = sdio_get_host_max_seg_count(func);
+	sdiodev->sg_support = max_segs > 1;
 	max_blocks = min_t(uint, host->max_blk_count, 511u);
 	sdiodev->max_request_size = min_t(uint, host->max_req_size,
 					  max_blocks * func->cur_blksize);
-	sdiodev->max_segment_count = min_t(uint, host->max_segs,
-					   SG_MAX_SINGLE_ALLOC);
-	sdiodev->max_segment_size = host->max_seg_size;
+	sdiodev->max_segment_count = min_t(uint, SG_MAX_SINGLE_ALLOC, max_segs);
+	sdiodev->max_segment_size = sdio_get_host_max_seg_size(func);
 
 	if (!sdiodev->sg_support)
 		return;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux