[PATCH] ar6000: add netif_carrier handling

Paul Fertser fercerpav at gmail.com
Wed Nov 27 08:44:30 CET 2013


The driver should properly emit link state events for the
link-specific logic to work properly. This includes obtaining an IPv6
address with SLAAC, netplugd and ifplugd operation etc.

This patch makes my gta02 properly receive an IPv6 address from an AP
right after associating.

Signed-off-by: Paul Fertser <fercerpav at gmail.com>
---
 drivers/ar6000/ar6000/ar6000_drv.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/ar6000/ar6000/ar6000_drv.c b/drivers/ar6000/ar6000/ar6000_drv.c
index 90533ab..721c422 100644
--- a/drivers/ar6000/ar6000/ar6000_drv.c
+++ b/drivers/ar6000/ar6000/ar6000_drv.c
@@ -883,6 +883,7 @@ ar6000_avail_ev(HTC_HANDLE HTCHandle)
         ar6000_destroy(dev, 0);
         return;
     }
+    netif_carrier_off(dev);
 
     HTCSetInstance(ar->arHtcTarget, ar);
 
@@ -2318,6 +2319,7 @@ ar6000_connect_event(AR_SOFTC_T *ar, A_UINT16 channel, A_UINT8 *bssid,
     ar6000_TxDataCleanup(ar);
 
     netif_start_queue(ar->arNetDev);
+    netif_carrier_on(ar->arNetDev);
 
     if ((OPEN_AUTH == ar->arDot11AuthMode) &&
         (NONE_AUTH == ar->arAuthMode)      &&
@@ -2407,6 +2409,8 @@ ar6000_disconnect_event(AR_SOFTC_T *ar, A_UINT8 reason, A_UINT8 *bssid,
 #endif /* USER_KEYS */
 
     netif_stop_queue(ar->arNetDev);
+    netif_carrier_off(ar->arNetDev);
+
     A_MEMZERO(ar->arBssid, sizeof(ar->arBssid));
     ar->arBssChannel = 0;
     ar->arBeaconInterval = 0;
-- 
1.7.10




More information about the openmoko-kernel mailing list