Skip to contentSkip to conversation

staging: wilc1000: Fix bssid buffer offset in Txq

PATCH In review Aditya Shankar 3 participants 3 messages Nov 3, 2017 – Nov 16, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: wilc1000: Fix bssid buffer offset in Txq

Commit 46949b48568b ("staging: wilc1000: New cfg packet format in handle_set_wfi_drv_handler") updated the frame format sent from host to the firmware. The code to update the bssid offset in the new frame was part of a second patch in the series which did not make it in and thus causes connection problems after associating to an AP.

This fix adds the proper offset of the bssid value in the Tx queue buffer to fix the connection issues.

Fixes Commit 46949b48568b ("staging: wilc1000: New cfg packet format in handle_set_wfi_drv_handler")
---
 drivers/staging/wilc1000/wilc_wlan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wilc1000/wilc_wlan.c +1 -1
index 9addef1..f49dfa8 100644
@@ -714,7 +714,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
 					char *bssid = ((struct tx_complete_data *)(tqe->priv))->bssid;
 
 					buffer_offset = ETH_ETHERNET_HDR_OFFSET;
-					memcpy(&txb[offset + 4], bssid, 6);
+					memcpy(&txb[offset + 8], bssid, 6);
 				} else {
 					buffer_offset = HOST_HDR_OFFSET;
 				}
Signature · 1 line
2.7.4
#1 lore raw

This driver really needs proper structs and datatypes so this doesn't happen again and so that you and Colin stop reverting each other's

	*pu8CurrByte++ = ((strHostIfSetMulti->enabled >> 8) & 0xFF);

assignments:

regards,
dan carpenter

Tested-by on v1 1/1
#2 lore raw
In reply to Aditya Shankar

Hi Aditya,

My problem is fixed with this patch. WILC1000 connects to AP, IP is retrieved from DHCP server and ping works. You can add my

Thanks,
Claudiu

Quoted 31 lines · Aditya Shankar

Commit 46949b48568b ("staging: wilc1000: New cfg packet format in handle_set_wfi_drv_handler") updated the frame format sent from host to the firmware. The code to update the bssid offset in the new frame was part of a second patch in the series which did not make it in and thus causes connection problems after associating to an AP.

This fix adds the proper offset of the bssid value in the Tx queue buffer to fix the connection issues.

Fixes Commit 46949b48568b ("staging: wilc1000: New cfg packet format in handle_set_wfi_drv_handler")
---
 drivers/staging/wilc1000/wilc_wlan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wilc1000/wilc_wlan.c +1 -1
index 9addef1..f49dfa8 100644
@@ -714,7 +714,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
 					char *bssid = ((struct tx_complete_data *)(tqe->priv))->bssid;
 
 					buffer_offset = ETH_ETHERNET_HDR_OFFSET;
-					memcpy(&txb[offset + 4], bssid, 6);
+					memcpy(&txb[offset + 8], bssid, 6);
 				} else {
 					buffer_offset = HOST_HDR_OFFSET;
 				}