diff options
author | Holger Schurig <hs4233@mail.mn-solutions.de> | 2007-11-28 03:15:11 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:04:58 -0500 |
commit | 0b3c07ff6467e6055ca3dd2239494ada96303274 (patch) | |
tree | c6a00ed81c29f8d19ddeaa95d983227dc3d1d80d /drivers | |
parent | a7d0adae40d0effc1484261a66fb703eb7e840b5 (diff) |
libertas: less eventcause shifts
* only shift eventcause once
* convert mac events to decimal, as this is what the firmware
manual uses in section 6.1, too
Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/libertas/cmdresp.c | 11 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/host.h | 52 |
2 files changed, 35 insertions, 28 deletions
diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c index 5165c91897a4..90f1c4974fa7 100644 --- a/drivers/net/wireless/libertas/cmdresp.c +++ b/drivers/net/wireless/libertas/cmdresp.c | |||
@@ -916,12 +916,12 @@ int lbs_process_event(struct lbs_private *priv) | |||
916 | lbs_deb_enter(LBS_DEB_CMD); | 916 | lbs_deb_enter(LBS_DEB_CMD); |
917 | 917 | ||
918 | spin_lock_irq(&adapter->driver_lock); | 918 | spin_lock_irq(&adapter->driver_lock); |
919 | eventcause = adapter->eventcause; | 919 | eventcause = adapter->eventcause >> SBI_EVENT_CAUSE_SHIFT; |
920 | spin_unlock_irq(&adapter->driver_lock); | 920 | spin_unlock_irq(&adapter->driver_lock); |
921 | 921 | ||
922 | lbs_deb_cmd("event cause 0x%x\n", eventcause); | 922 | lbs_deb_cmd("event cause %d\n", eventcause); |
923 | 923 | ||
924 | switch (eventcause >> SBI_EVENT_CAUSE_SHIFT) { | 924 | switch (eventcause) { |
925 | case MACREG_INT_CODE_LINK_SENSED: | 925 | case MACREG_INT_CODE_LINK_SENSED: |
926 | lbs_deb_cmd("EVENT: MACREG_INT_CODE_LINK_SENSED\n"); | 926 | lbs_deb_cmd("EVENT: MACREG_INT_CODE_LINK_SENSED\n"); |
927 | break; | 927 | break; |
@@ -936,7 +936,7 @@ int lbs_process_event(struct lbs_private *priv) | |||
936 | lbs_mac_event_disconnected(priv); | 936 | lbs_mac_event_disconnected(priv); |
937 | break; | 937 | break; |
938 | 938 | ||
939 | case MACREG_INT_CODE_LINK_LOSE_NO_SCAN: | 939 | case MACREG_INT_CODE_LINK_LOST_NO_SCAN: |
940 | lbs_deb_cmd("EVENT: link lost\n"); | 940 | lbs_deb_cmd("EVENT: link lost\n"); |
941 | lbs_mac_event_disconnected(priv); | 941 | lbs_mac_event_disconnected(priv); |
942 | break; | 942 | break; |
@@ -1030,8 +1030,7 @@ int lbs_process_event(struct lbs_private *priv) | |||
1030 | break; | 1030 | break; |
1031 | 1031 | ||
1032 | default: | 1032 | default: |
1033 | lbs_pr_alert("EVENT: unknown event id 0x%04x\n", | 1033 | lbs_pr_alert("EVENT: unknown event id %d\n", eventcause); |
1034 | eventcause >> SBI_EVENT_CAUSE_SHIFT); | ||
1035 | break; | 1034 | break; |
1036 | } | 1035 | } |
1037 | 1036 | ||
diff --git a/drivers/net/wireless/libertas/host.h b/drivers/net/wireless/libertas/host.h index 6b8932a003ab..4828bbf66390 100644 --- a/drivers/net/wireless/libertas/host.h +++ b/drivers/net/wireless/libertas/host.h | |||
@@ -274,27 +274,35 @@ enum cmd_mesh_access_opts { | |||
274 | }; | 274 | }; |
275 | 275 | ||
276 | /** Card Event definition */ | 276 | /** Card Event definition */ |
277 | #define MACREG_INT_CODE_TX_PPA_FREE 0x00000000 | 277 | #define MACREG_INT_CODE_TX_PPA_FREE 0 |
278 | #define MACREG_INT_CODE_TX_DMA_DONE 0x00000001 | 278 | #define MACREG_INT_CODE_TX_DMA_DONE 1 |
279 | #define MACREG_INT_CODE_LINK_LOSE_W_SCAN 0x00000002 | 279 | #define MACREG_INT_CODE_LINK_LOST_W_SCAN 2 |
280 | #define MACREG_INT_CODE_LINK_LOSE_NO_SCAN 0x00000003 | 280 | #define MACREG_INT_CODE_LINK_LOST_NO_SCAN 3 |
281 | #define MACREG_INT_CODE_LINK_SENSED 0x00000004 | 281 | #define MACREG_INT_CODE_LINK_SENSED 4 |
282 | #define MACREG_INT_CODE_CMD_FINISHED 0x00000005 | 282 | #define MACREG_INT_CODE_CMD_FINISHED 5 |
283 | #define MACREG_INT_CODE_MIB_CHANGED 0x00000006 | 283 | #define MACREG_INT_CODE_MIB_CHANGED 6 |
284 | #define MACREG_INT_CODE_INIT_DONE 0x00000007 | 284 | #define MACREG_INT_CODE_INIT_DONE 7 |
285 | #define MACREG_INT_CODE_DEAUTHENTICATED 0x00000008 | 285 | #define MACREG_INT_CODE_DEAUTHENTICATED 8 |
286 | #define MACREG_INT_CODE_DISASSOCIATED 0x00000009 | 286 | #define MACREG_INT_CODE_DISASSOCIATED 9 |
287 | #define MACREG_INT_CODE_PS_AWAKE 0x0000000a | 287 | #define MACREG_INT_CODE_PS_AWAKE 10 |
288 | #define MACREG_INT_CODE_PS_SLEEP 0x0000000b | 288 | #define MACREG_INT_CODE_PS_SLEEP 11 |
289 | #define MACREG_INT_CODE_MIC_ERR_MULTICAST 0x0000000d | 289 | #define MACREG_INT_CODE_MIC_ERR_MULTICAST 13 |
290 | #define MACREG_INT_CODE_MIC_ERR_UNICAST 0x0000000e | 290 | #define MACREG_INT_CODE_MIC_ERR_UNICAST 14 |
291 | #define MACREG_INT_CODE_WM_AWAKE 0x0000000f | 291 | #define MACREG_INT_CODE_WM_AWAKE 15 |
292 | #define MACREG_INT_CODE_ADHOC_BCN_LOST 0x00000011 | 292 | #define MACREG_INT_CODE_DEEP_SLEEP_AWAKE 16 |
293 | #define MACREG_INT_CODE_RSSI_LOW 0x00000019 | 293 | #define MACREG_INT_CODE_ADHOC_BCN_LOST 17 |
294 | #define MACREG_INT_CODE_SNR_LOW 0x0000001a | 294 | #define MACREG_INT_CODE_HOST_AWAKE 18 |
295 | #define MACREG_INT_CODE_MAX_FAIL 0x0000001b | 295 | #define MACREG_INT_CODE_STOP_TX 19 |
296 | #define MACREG_INT_CODE_RSSI_HIGH 0x0000001c | 296 | #define MACREG_INT_CODE_START_TX 20 |
297 | #define MACREG_INT_CODE_SNR_HIGH 0x0000001d | 297 | #define MACREG_INT_CODE_CHANNEL_SWITCH 21 |
298 | #define MACREG_INT_CODE_MESH_AUTO_STARTED 0x00000023 | 298 | #define MACREG_INT_CODE_MEASUREMENT_RDY 22 |
299 | #define MACREG_INT_CODE_WMM_CHANGE 23 | ||
300 | #define MACREG_INT_CODE_BG_SCAN_REPORT 24 | ||
301 | #define MACREG_INT_CODE_RSSI_LOW 25 | ||
302 | #define MACREG_INT_CODE_SNR_LOW 26 | ||
303 | #define MACREG_INT_CODE_MAX_FAIL 27 | ||
304 | #define MACREG_INT_CODE_RSSI_HIGH 28 | ||
305 | #define MACREG_INT_CODE_SNR_HIGH 29 | ||
306 | #define MACREG_INT_CODE_MESH_AUTO_STARTED 35 | ||
299 | 307 | ||
300 | #endif | 308 | #endif |