diff options
Diffstat (limited to 'drivers/staging/ath6kl/os/linux/ar6000_drv.c')
-rw-r--r-- | drivers/staging/ath6kl/os/linux/ar6000_drv.c | 113 |
1 files changed, 1 insertions, 112 deletions
diff --git a/drivers/staging/ath6kl/os/linux/ar6000_drv.c b/drivers/staging/ath6kl/os/linux/ar6000_drv.c index d1c7b5fd7fc..2a5abe0cc1c 100644 --- a/drivers/staging/ath6kl/os/linux/ar6000_drv.c +++ b/drivers/staging/ath6kl/os/linux/ar6000_drv.c | |||
@@ -591,7 +591,6 @@ ar6000_dbglog_event(struct ar6_softc *ar, u32 dropped, | |||
591 | send = dbglog_get_debug_fragment(&buffer[sent], length - sent, | 591 | send = dbglog_get_debug_fragment(&buffer[sent], length - sent, |
592 | MAX_WIRELESS_EVENT_SIZE); | 592 | MAX_WIRELESS_EVENT_SIZE); |
593 | while (send) { | 593 | while (send) { |
594 | ar6000_send_event_to_app(ar, WMIX_DBGLOG_EVENTID, (u8 *)&buffer[sent], send); | ||
595 | sent += send; | 594 | sent += send; |
596 | send = dbglog_get_debug_fragment(&buffer[sent], length - sent, | 595 | send = dbglog_get_debug_fragment(&buffer[sent], length - sent, |
597 | MAX_WIRELESS_EVENT_SIZE); | 596 | MAX_WIRELESS_EVENT_SIZE); |
@@ -1830,9 +1829,6 @@ static void ar6000_target_failure(void *Instance, int Status) | |||
1830 | sip = true; | 1829 | sip = true; |
1831 | errEvent.errorVal = WMI_TARGET_COM_ERR | | 1830 | errEvent.errorVal = WMI_TARGET_COM_ERR | |
1832 | WMI_TARGET_FATAL_ERR; | 1831 | WMI_TARGET_FATAL_ERR; |
1833 | ar6000_send_event_to_app(ar, WMI_ERROR_REPORT_EVENTID, | ||
1834 | (u8 *)&errEvent, | ||
1835 | sizeof(WMI_TARGET_ERROR_REPORT_EVENT)); | ||
1836 | } | 1832 | } |
1837 | } | 1833 | } |
1838 | } | 1834 | } |
@@ -2122,9 +2118,6 @@ static void ar6000_detect_error(unsigned long ptr) | |||
2122 | ar->arHBChallengeResp.seqNum = 0; | 2118 | ar->arHBChallengeResp.seqNum = 0; |
2123 | errEvent.errorVal = WMI_TARGET_COM_ERR | WMI_TARGET_FATAL_ERR; | 2119 | errEvent.errorVal = WMI_TARGET_COM_ERR | WMI_TARGET_FATAL_ERR; |
2124 | AR6000_SPIN_UNLOCK(&ar->arLock, 0); | 2120 | AR6000_SPIN_UNLOCK(&ar->arLock, 0); |
2125 | ar6000_send_event_to_app(ar, WMI_ERROR_REPORT_EVENTID, | ||
2126 | (u8 *)&errEvent, | ||
2127 | sizeof(WMI_TARGET_ERROR_REPORT_EVENT)); | ||
2128 | return; | 2121 | return; |
2129 | } | 2122 | } |
2130 | 2123 | ||
@@ -4922,19 +4915,13 @@ ar6000_rssiThreshold_event(struct ar6_softc *ar, WMI_RSSI_THRESHOLD_VAL newThre | |||
4922 | userRssiThold.rssi = rssi; | 4915 | userRssiThold.rssi = rssi; |
4923 | A_PRINTF("rssi Threshold range = %d tag = %d rssi = %d\n", newThreshold, | 4916 | A_PRINTF("rssi Threshold range = %d tag = %d rssi = %d\n", newThreshold, |
4924 | userRssiThold.tag, userRssiThold.rssi); | 4917 | userRssiThold.tag, userRssiThold.rssi); |
4925 | |||
4926 | ar6000_send_event_to_app(ar, WMI_RSSI_THRESHOLD_EVENTID,(u8 *)&userRssiThold, sizeof(USER_RSSI_THOLD)); | ||
4927 | } | 4918 | } |
4928 | 4919 | ||
4929 | 4920 | ||
4930 | void | 4921 | void |
4931 | ar6000_hbChallengeResp_event(struct ar6_softc *ar, u32 cookie, u32 source) | 4922 | ar6000_hbChallengeResp_event(struct ar6_softc *ar, u32 cookie, u32 source) |
4932 | { | 4923 | { |
4933 | if (source == APP_HB_CHALLENGE) { | 4924 | if (source != APP_HB_CHALLENGE) { |
4934 | /* Report it to the app in case it wants a positive acknowledgement */ | ||
4935 | ar6000_send_event_to_app(ar, WMIX_HB_CHALLENGE_RESP_EVENTID, | ||
4936 | (u8 *)&cookie, sizeof(cookie)); | ||
4937 | } else { | ||
4938 | /* This would ignore the replys that come in after their due time */ | 4925 | /* This would ignore the replys that come in after their due time */ |
4939 | if (cookie == ar->arHBChallengeResp.seqNum) { | 4926 | if (cookie == ar->arHBChallengeResp.seqNum) { |
4940 | ar->arHBChallengeResp.outstanding = false; | 4927 | ar->arHBChallengeResp.outstanding = false; |
@@ -5387,100 +5374,6 @@ ar6000_alloc_cookie(struct ar6_softc *ar) | |||
5387 | return cookie; | 5374 | return cookie; |
5388 | } | 5375 | } |
5389 | 5376 | ||
5390 | #ifdef SEND_EVENT_TO_APP | ||
5391 | /* | ||
5392 | * This function is used to send event which come from taget to | ||
5393 | * the application. The buf which send to application is include | ||
5394 | * the event ID and event content. | ||
5395 | */ | ||
5396 | #define EVENT_ID_LEN 2 | ||
5397 | void ar6000_send_event_to_app(struct ar6_softc *ar, u16 eventId, | ||
5398 | u8 *datap, int len) | ||
5399 | { | ||
5400 | |||
5401 | #if (WIRELESS_EXT >= 15) | ||
5402 | |||
5403 | /* note: IWEVCUSTOM only exists in wireless extensions after version 15 */ | ||
5404 | |||
5405 | char *buf; | ||
5406 | u16 size; | ||
5407 | union iwreq_data wrqu; | ||
5408 | |||
5409 | size = len + EVENT_ID_LEN; | ||
5410 | |||
5411 | if (size > IW_CUSTOM_MAX) { | ||
5412 | AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("WMI event ID : 0x%4.4X, len = %d too big for IWEVCUSTOM (max=%d) \n", | ||
5413 | eventId, size, IW_CUSTOM_MAX)); | ||
5414 | return; | ||
5415 | } | ||
5416 | |||
5417 | buf = A_MALLOC_NOWAIT(size); | ||
5418 | if (NULL == buf){ | ||
5419 | AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("%s: failed to allocate %d bytes\n", __func__, size)); | ||
5420 | return; | ||
5421 | } | ||
5422 | |||
5423 | A_MEMZERO(buf, size); | ||
5424 | memcpy(buf, &eventId, EVENT_ID_LEN); | ||
5425 | memcpy(buf+EVENT_ID_LEN, datap, len); | ||
5426 | |||
5427 | //AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("event ID = %d,len = %d\n",*(u16 *)buf, size)); | ||
5428 | A_MEMZERO(&wrqu, sizeof(wrqu)); | ||
5429 | wrqu.data.length = size; | ||
5430 | wireless_send_event(ar->arNetDev, IWEVCUSTOM, &wrqu, buf); | ||
5431 | kfree(buf); | ||
5432 | #endif | ||
5433 | |||
5434 | |||
5435 | } | ||
5436 | |||
5437 | /* | ||
5438 | * This function is used to send events larger than 256 bytes | ||
5439 | * to the application. The buf which is sent to application | ||
5440 | * includes the event ID and event content. | ||
5441 | */ | ||
5442 | void ar6000_send_generic_event_to_app(struct ar6_softc *ar, u16 eventId, | ||
5443 | u8 *datap, int len) | ||
5444 | { | ||
5445 | |||
5446 | #if (WIRELESS_EXT >= 18) | ||
5447 | |||
5448 | /* IWEVGENIE exists in wireless extensions version 18 onwards */ | ||
5449 | |||
5450 | char *buf; | ||
5451 | u16 size; | ||
5452 | union iwreq_data wrqu; | ||
5453 | |||
5454 | size = len + EVENT_ID_LEN; | ||
5455 | |||
5456 | if (size > IW_GENERIC_IE_MAX) { | ||
5457 | AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("WMI event ID : 0x%4.4X, len = %d too big for IWEVGENIE (max=%d) \n", | ||
5458 | eventId, size, IW_GENERIC_IE_MAX)); | ||
5459 | return; | ||
5460 | } | ||
5461 | |||
5462 | buf = A_MALLOC_NOWAIT(size); | ||
5463 | if (NULL == buf){ | ||
5464 | AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("%s: failed to allocate %d bytes\n", __func__, size)); | ||
5465 | return; | ||
5466 | } | ||
5467 | |||
5468 | A_MEMZERO(buf, size); | ||
5469 | memcpy(buf, &eventId, EVENT_ID_LEN); | ||
5470 | memcpy(buf+EVENT_ID_LEN, datap, len); | ||
5471 | |||
5472 | A_MEMZERO(&wrqu, sizeof(wrqu)); | ||
5473 | wrqu.data.length = size; | ||
5474 | wireless_send_event(ar->arNetDev, IWEVGENIE, &wrqu, buf); | ||
5475 | |||
5476 | kfree(buf); | ||
5477 | |||
5478 | #endif /* (WIRELESS_EXT >= 18) */ | ||
5479 | |||
5480 | } | ||
5481 | #endif /* SEND_EVENT_TO_APP */ | ||
5482 | |||
5483 | |||
5484 | void | 5377 | void |
5485 | ar6000_tx_retry_err_event(void *devt) | 5378 | ar6000_tx_retry_err_event(void *devt) |
5486 | { | 5379 | { |
@@ -5491,13 +5384,9 @@ void | |||
5491 | ar6000_snrThresholdEvent_rx(void *devt, WMI_SNR_THRESHOLD_VAL newThreshold, u8 snr) | 5384 | ar6000_snrThresholdEvent_rx(void *devt, WMI_SNR_THRESHOLD_VAL newThreshold, u8 snr) |
5492 | { | 5385 | { |
5493 | WMI_SNR_THRESHOLD_EVENT event; | 5386 | WMI_SNR_THRESHOLD_EVENT event; |
5494 | struct ar6_softc *ar = (struct ar6_softc *)devt; | ||
5495 | 5387 | ||
5496 | event.range = newThreshold; | 5388 | event.range = newThreshold; |
5497 | event.snr = snr; | 5389 | event.snr = snr; |
5498 | |||
5499 | ar6000_send_event_to_app(ar, WMI_SNR_THRESHOLD_EVENTID, (u8 *)&event, | ||
5500 | sizeof(WMI_SNR_THRESHOLD_EVENT)); | ||
5501 | } | 5390 | } |
5502 | 5391 | ||
5503 | void | 5392 | void |