Search Linux Wireless

[PATCH 1/1] ath6kl: Fix SDIO broken scatter hif-scatter

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

 



This patch fixes broken hif-scatter in ath6kl SDIO. It is not my work; I have found it as a difference between two Digi distributed Kernel source trees. No commit comment was recorded. I am sure there are better/nicer/cleaner way, but copying it as I found it is yet another difference less in the future. Feel free to use it in any way you see fit.

Signed-off-by: Robert Delien <robert@xxxxxxxxx>


Index: drivers/net/wireless/ath/ath6kl/sdio.c
===================================================================
--- drivers/net/wireless/ath/ath6kl/sdio.c	(revision 715)
+++ drivers/net/wireless/ath/ath6kl/sdio.c	(revision 716)
@@ -222,6 +222,7 @@
 					struct mmc_data *data)
 {
 	struct scatterlist *sg;
+	struct hif_scatter_item *scat_list;
 	int i;
 
 	data->blksz = HIF_MBOX_BLOCK_SIZE;
@@ -240,14 +241,14 @@
 	sg = scat_req->sgentries;
 	sg_init_table(sg, scat_req->scat_entries);
 
+	scat_list = &scat_req->scat_list[0];
+
 	/* assemble SG list */
-	for (i = 0; i < scat_req->scat_entries; i++, sg++) {
+	for (i = 0; i < scat_req->scat_entries; i++, sg++, scat_list++) {
 		ath6kl_dbg(ATH6KL_DBG_SCATTER, "%d: addr:0x%p, len:%d\n",
-			   i, scat_req->scat_list[i].buf,
-			   scat_req->scat_list[i].len);
+			   i, scat_list->buf, scat_list->len);
 
-		sg_set_buf(sg, scat_req->scat_list[i].buf,
-			   scat_req->scat_list[i].len);
+		sg_set_buf(sg, scat_list->buf, scat_list->len);
 	}
 
 	/* set scatter-gather table for request */
@@ -348,7 +349,7 @@
 	int i, scat_req_sz, scat_list_sz, sg_sz, buf_sz;
 	u8 *virt_buf;
 
-	scat_list_sz = (n_scat_entry - 1) * sizeof(struct hif_scatter_item);
+	scat_list_sz = n_scat_entry * sizeof(struct hif_scatter_item);
 	scat_req_sz = sizeof(*s_req) + scat_list_sz;
 
 	if (!virt_scat)
Index: drivers/net/wireless/ath/ath6kl/hif.h
===================================================================
--- drivers/net/wireless/ath/ath6kl/hif.h	(revision 715)
+++ drivers/net/wireless/ath/ath6kl/hif.h	(revision 716)
@@ -197,9 +197,9 @@
 	/* bounce buffer for upper layers to copy to/from */
 	u8 *virt_dma_buf;
 
-	struct hif_scatter_item scat_list[1];
+	u32 scat_q_depth;
 
-	u32 scat_q_depth;
+	struct hif_scatter_item scat_list[0];
 };
 
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux