diff options
author | Florian Schilhabel <florian.c.schilhabel@googlemail.com> | 2010-05-13 07:55:52 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-14 16:55:59 -0400 |
commit | 3dfe08e6073f40a742fe3e5d6b43ca8184c55722 (patch) | |
tree | 62c0bd3f57ba264ee6fcf89763eddbc6c2b76b3d /drivers/staging | |
parent | 5c2af91bbcc19c96d2fb35c4bb3f3d66b039e978 (diff) |
Staging: rtl8192su: led update
derived from Realteks driver.
leds are now working.
Signed-off-by: Florian Schilhabel <florian.c.schilhabel@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/rtl8192su/r8192U_core.c | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/drivers/staging/rtl8192su/r8192U_core.c b/drivers/staging/rtl8192su/r8192U_core.c index 70a8087434d4..78af0d7141a6 100644 --- a/drivers/staging/rtl8192su/r8192U_core.c +++ b/drivers/staging/rtl8192su/r8192U_core.c | |||
@@ -1219,6 +1219,7 @@ void rtl8192_set_mode(struct net_device *dev,int mode) | |||
1219 | void rtl8192_update_msr(struct net_device *dev) | 1219 | void rtl8192_update_msr(struct net_device *dev) |
1220 | { | 1220 | { |
1221 | struct r8192_priv *priv = ieee80211_priv(dev); | 1221 | struct r8192_priv *priv = ieee80211_priv(dev); |
1222 | LED_CTL_MODE LedAction = LED_CTL_NO_LINK; | ||
1222 | u8 msr; | 1223 | u8 msr; |
1223 | 1224 | ||
1224 | msr = read_nic_byte(dev, MSR); | 1225 | msr = read_nic_byte(dev, MSR); |
@@ -1229,19 +1230,23 @@ void rtl8192_update_msr(struct net_device *dev) | |||
1229 | * this is intentional and make sense for ad-hoc and | 1230 | * this is intentional and make sense for ad-hoc and |
1230 | * master (see the create BSS/IBSS func) | 1231 | * master (see the create BSS/IBSS func) |
1231 | */ | 1232 | */ |
1232 | if (priv->ieee80211->state == IEEE80211_LINKED){ | 1233 | if (priv->ieee80211->state == IEEE80211_LINKED) { |
1233 | 1234 | ||
1234 | if (priv->ieee80211->iw_mode == IW_MODE_INFRA) | 1235 | if (priv->ieee80211->iw_mode == IW_MODE_INFRA) { |
1235 | msr |= (MSR_LINK_MANAGED<<MSR_LINK_SHIFT); | 1236 | msr |= (MSR_LINK_MANAGED<<MSR_LINK_SHIFT); |
1236 | else if (priv->ieee80211->iw_mode == IW_MODE_ADHOC) | 1237 | LedAction = LED_CTL_LINK; |
1238 | } else if (priv->ieee80211->iw_mode == IW_MODE_ADHOC) | ||
1237 | msr |= (MSR_LINK_ADHOC<<MSR_LINK_SHIFT); | 1239 | msr |= (MSR_LINK_ADHOC<<MSR_LINK_SHIFT); |
1238 | else if (priv->ieee80211->iw_mode == IW_MODE_MASTER) | 1240 | else if (priv->ieee80211->iw_mode == IW_MODE_MASTER) |
1239 | msr |= (MSR_LINK_MASTER<<MSR_LINK_SHIFT); | 1241 | msr |= (MSR_LINK_MASTER<<MSR_LINK_SHIFT); |
1240 | 1242 | ||
1241 | }else | 1243 | } else |
1242 | msr |= (MSR_LINK_NONE<<MSR_LINK_SHIFT); | 1244 | msr |= (MSR_LINK_NONE<<MSR_LINK_SHIFT); |
1243 | 1245 | ||
1244 | write_nic_byte(dev, MSR, msr); | 1246 | write_nic_byte(dev, MSR, msr); |
1247 | |||
1248 | if(priv->ieee80211->LedControlHandler != NULL) | ||
1249 | priv->ieee80211->LedControlHandler(dev, LedAction); | ||
1245 | } | 1250 | } |
1246 | 1251 | ||
1247 | void rtl8192_set_chan(struct net_device *dev,short ch) | 1252 | void rtl8192_set_chan(struct net_device *dev,short ch) |
@@ -2154,15 +2159,13 @@ short rtl8192SU_tx(struct net_device *dev, struct sk_buff* skb) | |||
2154 | struct r8192_priv *priv = ieee80211_priv(dev); | 2159 | struct r8192_priv *priv = ieee80211_priv(dev); |
2155 | cb_desc *tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE); | 2160 | cb_desc *tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE); |
2156 | tx_desc_819x_usb *tx_desc = (tx_desc_819x_usb *)skb->data; | 2161 | tx_desc_819x_usb *tx_desc = (tx_desc_819x_usb *)skb->data; |
2157 | //tx_fwinfo_819x_usb *tx_fwinfo = (tx_fwinfo_819x_usb *)(skb->data + USB_HWDESC_HEADER_LEN);//92su del | ||
2158 | struct usb_device *udev = priv->udev; | 2162 | struct usb_device *udev = priv->udev; |
2159 | int pend; | 2163 | int pend; |
2160 | int status; | 2164 | int status; |
2161 | struct urb *tx_urb = NULL, *tx_urb_zero = NULL; | 2165 | struct urb *tx_urb = NULL, *tx_urb_zero = NULL; |
2162 | //int urb_len; | ||
2163 | unsigned int idx_pipe; | 2166 | unsigned int idx_pipe; |
2164 | u16 MPDUOverhead = 0; | 2167 | u16 MPDUOverhead = 0; |
2165 | //RT_DEBUG_DATA(COMP_SEND, tcb_desc, sizeof(cb_desc)); | 2168 | u16 type = 0; |
2166 | 2169 | ||
2167 | pend = atomic_read(&priv->tx_pending[tcb_desc->queue_index]); | 2170 | pend = atomic_read(&priv->tx_pending[tcb_desc->queue_index]); |
2168 | /* we are locked here so the two atomic_read and inc are executed | 2171 | /* we are locked here so the two atomic_read and inc are executed |
@@ -2359,6 +2362,11 @@ short rtl8192SU_tx(struct net_device *dev, struct sk_buff* skb) | |||
2359 | skb->data, | 2362 | skb->data, |
2360 | skb->len, rtl8192_tx_isr, skb); | 2363 | skb->len, rtl8192_tx_isr, skb); |
2361 | 2364 | ||
2365 | if (type == IEEE80211_FTYPE_DATA) { | ||
2366 | if (priv->ieee80211->LedControlHandler != NULL) | ||
2367 | priv->ieee80211->LedControlHandler(dev, LED_CTL_TX); | ||
2368 | } | ||
2369 | |||
2362 | status = usb_submit_urb(tx_urb, GFP_ATOMIC); | 2370 | status = usb_submit_urb(tx_urb, GFP_ATOMIC); |
2363 | if (!status) { | 2371 | if (!status) { |
2364 | /* | 2372 | /* |
@@ -5487,6 +5495,9 @@ void rtl819x_watchdog_wqcallback(struct work_struct *work) | |||
5487 | priv->ieee80211->current_network.bssid); | 5495 | priv->ieee80211->current_network.bssid); |
5488 | ieee->is_roaming = true; | 5496 | ieee->is_roaming = true; |
5489 | priv->ieee80211->link_change(dev); | 5497 | priv->ieee80211->link_change(dev); |
5498 | if(ieee->LedControlHandler != NULL) | ||
5499 | ieee->LedControlHandler(ieee->dev, | ||
5500 | LED_CTL_START_TO_LINK); | ||
5490 | queue_work(priv->ieee80211->wq, | 5501 | queue_work(priv->ieee80211->wq, |
5491 | &priv->ieee80211->associate_procedure_wq); | 5502 | &priv->ieee80211->associate_procedure_wq); |
5492 | } | 5503 | } |