306
306
* HTC service connection handlers
308
static A_STATUS ar6000_avail_ev(void *context, void *hif_handle);
310
static A_STATUS ar6000_unavail_ev(void *context, void *hif_handle);
312
A_STATUS ar6000_configure_target(AR_SOFTC_T *ar);
314
static void ar6000_target_failure(void *Instance, A_STATUS Status);
316
static void ar6000_rx(void *Context, HTC_PACKET *pPacket);
308
static int ar6000_avail_ev(void *context, void *hif_handle);
310
static int ar6000_unavail_ev(void *context, void *hif_handle);
312
int ar6000_configure_target(struct ar6_softc *ar);
314
static void ar6000_target_failure(void *Instance, int Status);
316
static void ar6000_rx(void *Context, struct htc_packet *pPacket);
318
318
static void ar6000_rx_refill(void *Context,HTC_ENDPOINT_ID Endpoint);
320
static void ar6000_tx_complete(void *Context, HTC_PACKET_QUEUE *pPackets);
320
static void ar6000_tx_complete(void *Context, struct htc_packet_queue *pPackets);
322
static HTC_SEND_FULL_ACTION ar6000_tx_queue_full(void *Context, HTC_PACKET *pPacket);
322
static HTC_SEND_FULL_ACTION ar6000_tx_queue_full(void *Context, struct htc_packet *pPacket);
324
324
#ifdef ATH_AR6K_11N_SUPPORT
325
static void ar6000_alloc_netbufs(A_NETBUF_QUEUE_T *q, A_UINT16 num);
325
static void ar6000_alloc_netbufs(A_NETBUF_QUEUE_T *q, u16 num);
327
327
static void ar6000_deliver_frames_to_nw_stack(void * dev, void *osbuf);
328
328
//static void ar6000_deliver_frames_to_bt_stack(void * dev, void *osbuf);
330
static HTC_PACKET *ar6000_alloc_amsdu_rxbuf(void *Context, HTC_ENDPOINT_ID Endpoint, int Length);
332
static void ar6000_refill_amsdu_rxbufs(AR_SOFTC_T *ar, int Count);
334
static void ar6000_cleanup_amsdu_rxbufs(AR_SOFTC_T *ar);
330
static struct htc_packet *ar6000_alloc_amsdu_rxbuf(void *Context, HTC_ENDPOINT_ID Endpoint, int Length);
332
static void ar6000_refill_amsdu_rxbufs(struct ar6_softc *ar, int Count);
334
static void ar6000_cleanup_amsdu_rxbufs(struct ar6_softc *ar);
337
337
ar6000_sysfs_bmi_read(struct file *fp, struct kobject *kobj,
403
403
#define REPORT_DEBUG_LOGS_TO_APP
406
ar6000_set_host_app_area(AR_SOFTC_T *ar)
406
ar6000_set_host_app_area(struct ar6_softc *ar)
408
A_UINT32 address, data;
409
409
struct host_app_area_s host_app_area;
411
411
/* Fetch the address of the host_app_area_s instance in the host interest area */
412
412
address = TARG_VTOP(ar->arTargetType, HOST_INTEREST_ITEM_ADDRESS(ar, hi_app_host_interest));
413
if (ar6000_ReadRegDiag(ar->arHifDevice, &address, &data) != A_OK) {
413
if (ar6000_ReadRegDiag(ar->arHifDevice, &address, &data) != 0) {
416
416
address = TARG_VTOP(ar->arTargetType, data);
417
417
host_app_area.wmi_protocol_ver = WMI_PROTOCOL_VERSION;
418
418
if (ar6000_WriteDataDiag(ar->arHifDevice, address,
419
(A_UCHAR *)&host_app_area,
420
sizeof(struct host_app_area_s)) != A_OK)
419
(u8 *)&host_app_area,
420
sizeof(struct host_app_area_s)) != 0)
429
dbglog_get_debug_hdr_ptr(AR_SOFTC_T *ar)
428
u32 dbglog_get_debug_hdr_ptr(struct ar6_softc *ar)
435
434
address = TARG_VTOP(ar->arTargetType, HOST_INTEREST_ITEM_ADDRESS(ar, hi_dbglog_hdr));
436
435
if ((status = ar6000_ReadDataDiag(ar->arHifDevice, address,
437
(A_UCHAR *)¶m, 4)) != A_OK)
436
(u8 *)¶m, 4)) != 0)
552
550
address = TARG_VTOP(ar->arTargetType, debug_hdr_ptr);
553
551
length = 4 /* sizeof(dbuf) */ + 4 /* sizeof(dropped) */;
554
552
A_MEMZERO(data, sizeof(data));
555
ar6000_ReadDataDiag(ar->arHifDevice, address, (A_UCHAR *)data, length);
553
ar6000_ReadDataDiag(ar->arHifDevice, address, (u8 *)data, length);
556
554
address = TARG_VTOP(ar->arTargetType, data[0] /* dbuf */);
557
555
firstbuf = address;
558
556
dropped = data[1]; /* dropped */
559
557
length = 4 /* sizeof(next) */ + 4 /* sizeof(buffer) */ + 4 /* sizeof(bufsize) */ + 4 /* sizeof(length) */ + 4 /* sizeof(count) */ + 4 /* sizeof(free) */;
560
558
A_MEMZERO(data, sizeof(data));
561
ar6000_ReadDataDiag(ar->arHifDevice, address, (A_UCHAR *)&data, length);
559
ar6000_ReadDataDiag(ar->arHifDevice, address, (u8 *)&data, length);
564
562
address = TARG_VTOP(ar->arTargetType, data[1] /* buffer*/);
846
844
if (index == MAX_AR6000) return 0;
848
if ((BMIRawWrite(ar->arHifDevice, (A_UCHAR*)buf, count)) != A_OK) {
846
if ((BMIRawWrite(ar->arHifDevice, (u8*)buf, count)) != 0) {
856
ar6000_sysfs_bmi_init(AR_SOFTC_T *ar)
854
ar6000_sysfs_bmi_init(struct ar6_softc *ar)
860
858
AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("BMI: Creating sysfs entry\n"));
861
A_MEMZERO(&ar->osDevInfo, sizeof(HIF_DEVICE_OS_DEVICE_INFO));
859
A_MEMZERO(&ar->osDevInfo, sizeof(struct hif_device_os_device_info));
863
861
/* Get the underlying OS device */
864
862
status = HIFConfigureDevice(ar->arHifDevice,
865
863
HIF_DEVICE_GET_OS_DEVICE,
867
sizeof(HIF_DEVICE_OS_DEVICE_INFO));
865
sizeof(struct hif_device_os_device_info));
869
if (A_FAILED(status)) {
870
868
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("BMI: Failed to get OS device info from HIF\n"));
1119
1117
(((ar)->arTargetType == TARGET_TYPE_AR6003) ? AR6003_BOARD_DATA_SZ : 0));
1121
1119
/* Determine where in Target RAM to write Board Data */
1122
bmifn(BMIReadMemory(ar->arHifDevice, HOST_INTEREST_ITEM_ADDRESS(ar, hi_board_ext_data), (A_UCHAR *)&board_ext_address, 4));
1120
bmifn(BMIReadMemory(ar->arHifDevice, HOST_INTEREST_ITEM_ADDRESS(ar, hi_board_ext_data), (u8 *)&board_ext_address, 4));
1123
1121
AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("Board extended Data download address: 0x%x\n", board_ext_address));
1125
1123
/* check whether the target has allocated memory for extended board data and file contains extended board data */
1126
1124
if ((board_ext_address) && (fw_entry->size == (board_data_size + board_ext_data_size))) {
1129
status = BMIWriteMemory(ar->arHifDevice, board_ext_address, (A_UCHAR *)(fw_entry->data + board_data_size), board_ext_data_size);
1131
if (status != A_OK) {
1127
status = BMIWriteMemory(ar->arHifDevice, board_ext_address, (u8 *)(fw_entry->data + board_data_size), board_ext_data_size);
1132
1130
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("BMI operation failed: %d\n", __LINE__));
1133
1131
A_RELEASE_FIRMWARE(fw_entry);
1134
1132
return A_ERROR;
1137
1135
/* Record the fact that extended board Data IS initialized */
1139
bmifn(BMIWriteMemory(ar->arHifDevice, HOST_INTEREST_ITEM_ADDRESS(ar, hi_board_ext_data_initialized), (A_UCHAR *)¶m, 4));
1137
bmifn(BMIWriteMemory(ar->arHifDevice, HOST_INTEREST_ITEM_ADDRESS(ar, hi_board_ext_data_initialized), (u8 *)¶m, 4));
1141
1139
fw_entry_size = board_data_size;
1144
1142
if (compressed) {
1145
status = BMIFastDownload(ar->arHifDevice, address, (A_UCHAR *)fw_entry->data, fw_entry_size);
1143
status = BMIFastDownload(ar->arHifDevice, address, (u8 *)fw_entry->data, fw_entry_size);
1147
status = BMIWriteMemory(ar->arHifDevice, address, (A_UCHAR *)fw_entry->data, fw_entry_size);
1145
status = BMIWriteMemory(ar->arHifDevice, address, (u8 *)fw_entry->data, fw_entry_size);
1150
if (status != A_OK) {
1151
1149
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("BMI operation failed: %d\n", __LINE__));
1152
1150
A_RELEASE_FIRMWARE(fw_entry);
1153
1151
return A_ERROR;
1155
1153
A_RELEASE_FIRMWARE(fw_entry);
1158
1156
#endif /* INIT_MODE_DRV_ENABLED */
1161
ar6000_update_bdaddr(AR_SOFTC_T *ar)
1159
ar6000_update_bdaddr(struct ar6_softc *ar)
1164
1162
if (setupbtdev != 0) {
1167
1165
if (BMIReadMemory(ar->arHifDevice,
1168
HOST_INTEREST_ITEM_ADDRESS(ar, hi_board_data), (A_UCHAR *)&address, 4) != A_OK)
1166
HOST_INTEREST_ITEM_ADDRESS(ar, hi_board_data), (u8 *)&address, 4) != 0)
1170
1168
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("BMIReadMemory for hi_board_data failed\n"));
1171
1169
return A_ERROR;
1174
if (BMIReadMemory(ar->arHifDevice, address + BDATA_BDADDR_OFFSET, (A_UCHAR *)ar->bdaddr, 6) != A_OK)
1172
if (BMIReadMemory(ar->arHifDevice, address + BDATA_BDADDR_OFFSET, (u8 *)ar->bdaddr, 6) != 0)
1176
1174
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("BMIReadMemory for BD address failed\n"));
1177
1175
return A_ERROR;
1282
1280
/* Transfer Board Data from Target EEPROM to Target RAM */
1283
1281
if (ar->arTargetType == TARGET_TYPE_AR6003) {
1284
1282
/* Determine where in Target RAM to write Board Data */
1285
bmifn(BMIReadMemory(ar->arHifDevice, HOST_INTEREST_ITEM_ADDRESS(ar, hi_board_data), (A_UCHAR *)&address, 4));
1283
bmifn(BMIReadMemory(ar->arHifDevice, HOST_INTEREST_ITEM_ADDRESS(ar, hi_board_data), (u8 *)&address, 4));
1286
1284
AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("Board Data download address: 0x%x\n", address));
1288
1286
/* Write EEPROM data to Target RAM */
1289
if ((ar6000_transfer_bin_file(ar, AR6K_BOARD_DATA_FILE, address, FALSE)) != A_OK) {
1287
if ((ar6000_transfer_bin_file(ar, AR6K_BOARD_DATA_FILE, address, false)) != 0) {
1290
1288
return A_ERROR;
1293
1291
/* Record the fact that Board Data IS initialized */
1295
bmifn(BMIWriteMemory(ar->arHifDevice, HOST_INTEREST_ITEM_ADDRESS(ar, hi_board_data_initialized), (A_UCHAR *)¶m, 4));
1293
bmifn(BMIWriteMemory(ar->arHifDevice, HOST_INTEREST_ITEM_ADDRESS(ar, hi_board_data_initialized), (u8 *)¶m, 4));
1297
1295
/* Transfer One time Programmable data */
1298
1296
AR6K_DATA_DOWNLOAD_ADDRESS(address, ar->arVersion.target_ver);
1299
status = ar6000_transfer_bin_file(ar, AR6K_OTP_FILE, address, TRUE);
1300
if (status == A_OK) {
1297
status = ar6000_transfer_bin_file(ar, AR6K_OTP_FILE, address, true);
1301
1299
/* Execute the OTP code */
1303
1301
AR6K_APP_START_OVERRIDE_ADDRESS(address, ar->arVersion.target_ver);
1876
1878
/* Report the error only once */
1879
1881
errEvent.errorVal = WMI_TARGET_COM_ERR |
1880
1882
WMI_TARGET_FATAL_ERR;
1881
1883
ar6000_send_event_to_app(ar, WMI_ERROR_REPORT_EVENTID,
1882
(A_UINT8 *)&errEvent,
1883
1885
sizeof(WMI_TARGET_ERROR_REPORT_EVENT));
1889
1891
ar6000_unavail_ev(void *context, void *hif_handle)
1891
AR_SOFTC_T *ar = (AR_SOFTC_T *)context;
1893
struct ar6_softc *ar = (struct ar6_softc *)context;
1892
1894
/* NULL out it's entry in the global list */
1893
1895
ar6000_devices[ar->arDeviceIndex] = NULL;
1894
1896
ar6000_destroy(ar->arNetDev, 1);
1900
1902
ar6000_restart_endpoint(struct net_device *dev)
1902
A_STATUS status = A_OK;
1903
AR_SOFTC_T *ar = (AR_SOFTC_T *)ar6k_priv(dev);
1905
struct ar6_softc *ar = (struct ar6_softc *)ar6k_priv(dev);
1907
if ( (status=ar6000_configure_target(ar))!=A_OK)
1909
if ( (status=ar6000_configure_target(ar))!= 0)
1909
if ( (status=ar6000_sysfs_bmi_get_config(ar, wlaninitmode)) != A_OK)
1911
if ( (status=ar6000_sysfs_bmi_get_config(ar, wlaninitmode)) != 0)
1911
1913
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("ar6000_avail: ar6000_sysfs_bmi_get_config failed\n"));
1915
status = (ar6000_init(dev)==0) ? A_OK : A_ERROR;
1917
status = (ar6000_init(dev)==0) ? 0 : A_ERROR;
1921
1923
if (ar->arSsidLen && ar->arWlanState == WLAN_ENABLED) {
1935
ar6000_stop_endpoint(struct net_device *dev, A_BOOL keepprofile, A_BOOL getdbglogs)
1937
ar6000_stop_endpoint(struct net_device *dev, bool keepprofile, bool getdbglogs)
1937
AR_SOFTC_T *ar = (AR_SOFTC_T *)ar6k_priv(dev);
1939
struct ar6_softc *ar = (struct ar6_softc *)ar6k_priv(dev);
1939
1941
/* Stop the transmit queues */
1940
1942
netif_stop_queue(dev);
1942
1944
/* Disable the target and the interrupts associated with it */
1943
if (ar->arWmiReady == TRUE)
1945
if (ar->arWmiReady == true)
1945
1947
if (!bypasswmi)
1947
if (ar->arConnected == TRUE || ar->arConnectPending == TRUE)
1949
AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("%s(): Disconnect\n", __func__));
1951
AR6000_SPIN_LOCK(&ar->arLock, 0);
1952
ar6000_init_profile_info(ar);
1953
AR6000_SPIN_UNLOCK(&ar->arLock, 0);
1955
wmi_disconnect_cmd(ar->arWmi);
1949
bool disconnectIssued;
1951
disconnectIssued = (ar->arConnected) || (ar->arConnectPending);
1952
ar6000_disconnect(ar);
1954
ar6000_init_profile_info(ar);
1958
1957
A_UNTIMEOUT(&ar->disconnect_timer);
2188
2188
errEvent.errorVal = WMI_TARGET_COM_ERR | WMI_TARGET_FATAL_ERR;
2189
2189
AR6000_SPIN_UNLOCK(&ar->arLock, 0);
2190
2190
ar6000_send_event_to_app(ar, WMI_ERROR_REPORT_EVENTID,
2191
(A_UINT8 *)&errEvent,
2192
2192
sizeof(WMI_TARGET_ERROR_REPORT_EVENT));
2196
2196
/* Generate the sequence number for the next challenge */
2197
2197
ar->arHBChallengeResp.seqNum++;
2198
ar->arHBChallengeResp.outstanding = TRUE;
2198
ar->arHBChallengeResp.outstanding = true;
2200
2200
AR6000_SPIN_UNLOCK(&ar->arLock, 0);
2202
2202
/* Send the challenge on the control channel */
2203
if (wmi_get_challenge_resp_cmd(ar->arWmi, ar->arHBChallengeResp.seqNum, DRV_HB_CHALLENGE) != A_OK) {
2203
if (wmi_get_challenge_resp_cmd(ar->arWmi, ar->arHBChallengeResp.seqNum, DRV_HB_CHALLENGE) != 0) {
2204
2204
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Unable to send heart beat challenge\n"));
2318
2317
ar6000_close(struct net_device *dev)
2320
2319
#ifdef ATH6K_CONFIG_CFG80211
2321
AR_SOFTC_T *ar = (AR_SOFTC_T *)ar6k_priv(dev);
2320
struct ar6_softc *ar = (struct ar6_softc *)ar6k_priv(dev);
2322
2321
#endif /* ATH6K_CONFIG_CFG80211 */
2323
2322
netif_stop_queue(dev);
2325
2324
#ifdef ATH6K_CONFIG_CFG80211
2326
AR6000_SPIN_LOCK(&ar->arLock, 0);
2327
if (ar->arConnected == TRUE || ar->arConnectPending == TRUE) {
2328
AR6000_SPIN_UNLOCK(&ar->arLock, 0);
2329
wmi_disconnect_cmd(ar->arWmi);
2331
AR6000_SPIN_UNLOCK(&ar->arLock, 0);
2325
ar6000_disconnect(ar);
2334
if(ar->arWmiReady == TRUE) {
2327
if(ar->arWmiReady == true) {
2335
2328
if (wmi_scanparams_cmd(ar->arWmi, 0xFFFF, 0,
2336
0, 0, 0, 0, 0, 0, 0, 0) != A_OK) {
2329
0, 0, 0, 0, 0, 0, 0, 0) != 0) {
2339
2332
ar->arWlanState = WLAN_DISABLED;
2334
ar6k_cfg80211_scanComplete_event(ar, A_ECANCELED);
2341
2335
#endif /* ATH6K_CONFIG_CFG80211 */
2346
2340
/* connect to a service */
2347
static A_STATUS ar6000_connectservice(AR_SOFTC_T *ar,
2348
HTC_SERVICE_CONNECT_REQ *pConnect,
2341
static int ar6000_connectservice(struct ar6_softc *ar,
2342
struct htc_service_connect_req *pConnect,
2352
HTC_SERVICE_CONNECT_RESP response;
2346
struct htc_service_connect_resp response;
2418
2412
HTC_ENDPOINT_ID
2419
ar6000_ac2_endpoint_id ( void * devt, A_UINT8 ac)
2413
ar6000_ac2_endpoint_id ( void * devt, u8 ac)
2421
AR_SOFTC_T *ar = (AR_SOFTC_T *) devt;
2415
struct ar6_softc *ar = (struct ar6_softc *) devt;
2422
2416
return(arAc2EndpointID(ar, ac));
2426
ar6000_endpoint_id2_ac(void * devt, HTC_ENDPOINT_ID ep )
2419
u8 ar6000_endpoint_id2_ac(void * devt, HTC_ENDPOINT_ID ep )
2428
AR_SOFTC_T *ar = (AR_SOFTC_T *) devt;
2421
struct ar6_softc *ar = (struct ar6_softc *) devt;
2429
2422
return(arEndpoint2Ac(ar, ep ));
2426
* This function applies WLAN specific configuration defined in wlan_config.h
2428
int ar6000_target_config_wlan_params(struct ar6_softc *ar)
2431
#if defined(INIT_MODE_DRV_ENABLED) && defined(ENABLE_COEXISTENCE)
2432
WMI_SET_BTCOEX_COLOCATED_BT_DEV_CMD sbcb_cmd;
2433
WMI_SET_BTCOEX_FE_ANT_CMD sbfa_cmd;
2434
#endif /* INIT_MODE_DRV_ENABLED && ENABLE_COEXISTENCE */
2436
#ifdef CONFIG_HOST_TCMD_SUPPORT
2437
if (ar->arTargetMode != AR6000_WLAN_MODE) {
2440
#endif /* CONFIG_HOST_TCMD_SUPPORT */
2443
* configure the device for rx dot11 header rules 0,0 are the default values
2444
* therefore this command can be skipped if the inputs are 0,FALSE,FALSE.Required
2445
* if checksum offload is needed. Set RxMetaVersion to 2
2447
if ((wmi_set_rx_frame_format_cmd(ar->arWmi,ar->rxMetaVersion, processDot11Hdr, processDot11Hdr)) != 0) {
2448
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Unable to set the rx frame format.\n"));
2452
#if defined(INIT_MODE_DRV_ENABLED) && defined(ENABLE_COEXISTENCE)
2453
/* Configure the type of BT collocated with WLAN */
2454
memset(&sbcb_cmd, 0, sizeof(WMI_SET_BTCOEX_COLOCATED_BT_DEV_CMD));
2455
#ifdef CONFIG_AR600x_BT_QCOM
2456
sbcb_cmd.btcoexCoLocatedBTdev = 1;
2457
#elif defined(CONFIG_AR600x_BT_CSR)
2458
sbcb_cmd.btcoexCoLocatedBTdev = 2;
2459
#elif defined(CONFIG_AR600x_BT_AR3001)
2460
sbcb_cmd.btcoexCoLocatedBTdev = 3;
2462
#error Unsupported Bluetooth Type
2463
#endif /* Collocated Bluetooth Type */
2465
if ((wmi_set_btcoex_colocated_bt_dev_cmd(ar->arWmi, &sbcb_cmd)) != 0) {
2466
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Unable to set collocated BT type\n"));
2470
/* Configure the type of BT collocated with WLAN */
2471
memset(&sbfa_cmd, 0, sizeof(WMI_SET_BTCOEX_FE_ANT_CMD));
2472
#ifdef CONFIG_AR600x_DUAL_ANTENNA
2473
sbfa_cmd.btcoexFeAntType = 2;
2474
#elif defined(CONFIG_AR600x_SINGLE_ANTENNA)
2475
sbfa_cmd.btcoexFeAntType = 1;
2477
#error Unsupported Front-End Antenna Configuration
2478
#endif /* AR600x Front-End Antenna Configuration */
2480
if ((wmi_set_btcoex_fe_ant_cmd(ar->arWmi, &sbfa_cmd)) != 0) {
2481
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Unable to set fornt end antenna configuration\n"));
2484
#endif /* INIT_MODE_DRV_ENABLED && ENABLE_COEXISTENCE */
2486
#if WLAN_CONFIG_IGNORE_POWER_SAVE_FAIL_EVENT_DURING_SCAN
2487
if ((wmi_pmparams_cmd(ar->arWmi, 0, 1, 0, 0, 1, IGNORE_POWER_SAVE_FAIL_EVENT_DURING_SCAN)) != 0) {
2488
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Unable to set power save fail event policy\n"));
2493
#if WLAN_CONFIG_DONOT_IGNORE_BARKER_IN_ERP
2494
if ((wmi_set_lpreamble_cmd(ar->arWmi, 0, WMI_DONOT_IGNORE_BARKER_IN_ERP)) != 0) {
2495
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Unable to set barker preamble policy\n"));
2500
if ((wmi_set_keepalive_cmd(ar->arWmi, WLAN_CONFIG_KEEP_ALIVE_INTERVAL)) != 0) {
2501
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Unable to set keep alive interval\n"));
2505
#if WLAN_CONFIG_DISABLE_11N
2507
WMI_SET_HT_CAP_CMD htCap;
2509
memset(&htCap, 0, sizeof(WMI_SET_HT_CAP_CMD));
2511
if ((wmi_set_ht_cap_cmd(ar->arWmi, &htCap)) != 0) {
2512
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Unable to set ht capabilities \n"));
2517
if ((wmi_set_ht_cap_cmd(ar->arWmi, &htCap)) != 0) {
2518
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Unable to set ht capabilities \n"));
2522
#endif /* WLAN_CONFIG_DISABLE_11N */
2524
#ifdef ATH6K_CONFIG_OTA_MODE
2525
if ((wmi_powermode_cmd(ar->arWmi, MAX_PERF_POWER)) != 0) {
2526
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Unable to set power mode \n"));
2531
if ((wmi_disctimeout_cmd(ar->arWmi, WLAN_CONFIG_DISCONNECT_TIMEOUT)) != 0) {
2532
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Unable to set disconnect timeout \n"));
2536
#if WLAN_CONFIG_DISABLE_TX_BURSTING
2537
if ((wmi_set_wmm_txop(ar->arWmi, WMI_TXOP_DISABLED)) != 0) {
2538
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Unable to set txop bursting \n"));
2432
2546
/* This function does one time initialization for the lifetime of the device */
2433
2547
int ar6000_init(struct net_device *dev)
2549
struct ar6_softc *ar;
2440
#if defined(INIT_MODE_DRV_ENABLED) && defined(ENABLE_COEXISTENCE)
2441
WMI_SET_BTCOEX_COLOCATED_BT_DEV_CMD sbcb_cmd;
2442
WMI_SET_BTCOEX_FE_ANT_CMD sbfa_cmd;
2443
#endif /* INIT_MODE_DRV_ENABLED && ENABLE_COEXISTENCE */
2445
2555
if((ar = ar6k_priv(dev)) == NULL)
2705
2815
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("%s() WMI is ready\n", __func__));
2707
2817
/* Communicate the wmi protocol verision to the target */
2708
if ((ar6000_set_host_app_area(ar)) != A_OK) {
2818
if ((ar6000_set_host_app_area(ar)) != 0) {
2709
2819
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Unable to set the host app area\n"));
2712
/* configure the device for rx dot11 header rules 0,0 are the default values
2713
* therefore this command can be skipped if the inputs are 0,FALSE,FALSE.Required
2714
if checksum offload is needed. Set RxMetaVersion to 2*/
2715
if ((wmi_set_rx_frame_format_cmd(ar->arWmi,ar->rxMetaVersion, processDot11Hdr, processDot11Hdr)) != A_OK) {
2716
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Unable to set the rx frame format.\n"));
2719
#if defined(INIT_MODE_DRV_ENABLED) && defined(ENABLE_COEXISTENCE)
2720
/* Configure the type of BT collocated with WLAN */
2721
A_MEMZERO(&sbcb_cmd, sizeof(WMI_SET_BTCOEX_COLOCATED_BT_DEV_CMD));
2722
#ifdef CONFIG_AR600x_BT_QCOM
2723
sbcb_cmd.btcoexCoLocatedBTdev = 1;
2724
#elif defined(CONFIG_AR600x_BT_CSR)
2725
sbcb_cmd.btcoexCoLocatedBTdev = 2;
2726
#elif defined(CONFIG_AR600x_BT_AR3001)
2727
sbcb_cmd.btcoexCoLocatedBTdev = 3;
2729
#error Unsupported Bluetooth Type
2730
#endif /* Collocated Bluetooth Type */
2732
if ((wmi_set_btcoex_colocated_bt_dev_cmd(ar->arWmi, &sbcb_cmd)) != A_OK)
2734
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Unable to set collocated BT type\n"));
2737
/* Configure the type of BT collocated with WLAN */
2738
A_MEMZERO(&sbfa_cmd, sizeof(WMI_SET_BTCOEX_FE_ANT_CMD));
2739
#ifdef CONFIG_AR600x_DUAL_ANTENNA
2740
sbfa_cmd.btcoexFeAntType = 2;
2741
#elif defined(CONFIG_AR600x_SINGLE_ANTENNA)
2742
sbfa_cmd.btcoexFeAntType = 1;
2744
#error Unsupported Front-End Antenna Configuration
2745
#endif /* AR600x Front-End Antenna Configuration */
2747
if ((wmi_set_btcoex_fe_ant_cmd(ar->arWmi, &sbfa_cmd)) != A_OK) {
2748
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Unable to set fornt end antenna configuration\n"));
2750
#endif /* INIT_MODE_DRV_ENABLED && ENABLE_COEXISTENCE */
2821
ar6000_target_config_wlan_params(ar);
2753
2824
ar->arNumDataEndPts = 1;
2803
ar6000_channelList_rx(void *devt, A_INT8 numChan, A_UINT16 *chanList)
2874
ar6000_channelList_rx(void *devt, s8 numChan, u16 *chanList)
2805
AR_SOFTC_T *ar = (AR_SOFTC_T *)devt;
2876
struct ar6_softc *ar = (struct ar6_softc *)devt;
2807
A_MEMCPY(ar->arChannelList, chanList, numChan * sizeof (A_UINT16));
2878
memcpy(ar->arChannelList, chanList, numChan * sizeof (u16));
2808
2879
ar->arNumChannels = numChan;
2810
2881
wake_up(&arEvent);
2814
ar6000_ibss_map_epid(struct sk_buff *skb, struct net_device *dev, A_UINT32 * mapNo)
2884
u8 ar6000_ibss_map_epid(struct sk_buff *skb, struct net_device *dev, u32 *mapNo)
2816
AR_SOFTC_T *ar = (AR_SOFTC_T *)ar6k_priv(dev);
2886
struct ar6_softc *ar = (struct ar6_softc *)ar6k_priv(dev);
2818
2888
ATH_MAC_HDR *macHdr;
2822
2892
datap = A_NETBUF_DATA(skb);
2884
2954
#ifdef HTC_TEST_SEND_PKTS
2885
static void DoHTCSendPktsTest(AR_SOFTC_T *ar, int MapNo, HTC_ENDPOINT_ID eid, struct sk_buff *skb);
2955
static void DoHTCSendPktsTest(struct ar6_softc *ar, int MapNo, HTC_ENDPOINT_ID eid, struct sk_buff *skb);
2889
2959
ar6000_data_tx(struct sk_buff *skb, struct net_device *dev)
2891
2961
#define AC_NOT_MAPPED 99
2892
AR_SOFTC_T *ar = (AR_SOFTC_T *)ar6k_priv(dev);
2893
A_UINT8 ac = AC_NOT_MAPPED;
2962
struct ar6_softc *ar = (struct ar6_softc *)ar6k_priv(dev);
2963
u8 ac = AC_NOT_MAPPED;
2894
2964
HTC_ENDPOINT_ID eid = ENDPOINT_UNUSED;
2897
2967
struct ar_cookie *cookie;
2898
A_BOOL checkAdHocPsMapping = FALSE,bMoreData = FALSE;
2968
bool checkAdHocPsMapping = false,bMoreData = false;
2899
2969
HTC_TX_TAG htc_tag = AR6K_DATA_PKT_TAG;
2900
A_UINT8 dot11Hdr = processDot11Hdr;
2970
u8 dot11Hdr = processDot11Hdr;
2901
2971
#ifdef CONFIG_PM
2902
2972
if (ar->arWowState != WLAN_WOW_STATE_NONE) {
2903
2973
A_NETBUF_FREE(skb);
3575
ar6000_rx(void *Context, HTC_PACKET *pPacket)
3645
ar6000_rx(void *Context, struct htc_packet *pPacket)
3577
AR_SOFTC_T *ar = (AR_SOFTC_T *)Context;
3647
struct ar6_softc *ar = (struct ar6_softc *)Context;
3578
3648
struct sk_buff *skb = (struct sk_buff *)pPacket->pPktContext;
3580
A_UINT8 containsDot11Hdr = 0;
3581
A_STATUS status = pPacket->Status;
3650
u8 containsDot11Hdr = 0;
3651
int status = pPacket->Status;
3582
3652
HTC_ENDPOINT_ID ept = pPacket->Endpoint;
3584
A_ASSERT((status != A_OK) ||
3654
A_ASSERT((status) ||
3585
3655
(pPacket->pBuffer == (A_NETBUF_DATA(skb) + HTC_HEADER_LEN)));
3587
3657
AR_DEBUG_PRINTF(ATH_DEBUG_WLAN_RX,("ar6000_rx ar=0x%lx eid=%d, skb=0x%lx, data=0x%lx, len=0x%x status:%d",
3588
3658
(unsigned long)ar, ept, (unsigned long)skb, (unsigned long)pPacket->pBuffer,
3589
3659
pPacket->ActualLength, status));
3590
if (status != A_OK) {
3591
3661
if (status != A_ECANCELED) {
3592
3662
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("RX ERR (%d) \n",status));
3618
3688
AR6000_SPIN_UNLOCK(&ar->arLock, 0);
3620
3690
skb->dev = ar->arNetDev;
3621
if (status != A_OK) {
3622
3692
AR6000_STAT_INC(ar, rx_errors);
3623
3693
A_NETBUF_FREE(skb);
3624
} else if (ar->arWmiEnabled == TRUE) {
3694
} else if (ar->arWmiEnabled == true) {
3625
3695
if (ept == ar->arControlEp) {
3627
3697
* this is a wmi control msg
3629
3699
#ifdef CONFIG_PM
3630
ar6000_check_wow_status(ar, skb, TRUE);
3700
ar6000_check_wow_status(ar, skb, true);
3631
3701
#endif /* CONFIG_PM */
3632
3702
wmi_control_rx(ar->arWmi, skb);
3634
3704
WMI_DATA_HDR *dhdr = (WMI_DATA_HDR *)A_NETBUF_DATA(skb);
3635
A_UINT8 is_amsdu, tid, is_acl_data_frame;
3707
bool is_acl_data_frame;
3636
3708
is_acl_data_frame = WMI_DATA_HDR_GET_DATA_TYPE(dhdr) == WMI_DATA_HDR_DATA_TYPE_ACL;
3637
3709
#ifdef CONFIG_PM
3638
ar6000_check_wow_status(ar, NULL, FALSE);
3710
ar6000_check_wow_status(ar, NULL, false);
3639
3711
#endif /* CONFIG_PM */
3641
3713
* this is a wmi data packet
4165
ar6000_ready_event(void *devt, A_UINT8 *datap, A_UINT8 phyCap, A_UINT32 sw_ver, A_UINT32 abi_ver)
4237
ar6000_ready_event(void *devt, u8 *datap, u8 phyCap, u32 sw_ver, u32 abi_ver)
4167
AR_SOFTC_T *ar = (AR_SOFTC_T *)devt;
4239
struct ar6_softc *ar = (struct ar6_softc *)devt;
4168
4240
struct net_device *dev = ar->arNetDev;
4170
A_MEMCPY(dev->dev_addr, datap, AR6000_ETH_ADDR_LEN);
4242
memcpy(dev->dev_addr, datap, AR6000_ETH_ADDR_LEN);
4171
4243
AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("mac address = %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x\n",
4172
4244
dev->dev_addr[0], dev->dev_addr[1],
4173
4245
dev->dev_addr[2], dev->dev_addr[3],
4178
4250
ar->arVersion.abi_ver = abi_ver;
4180
4252
/* Indicate to the waiting thread that the ready event was received */
4181
ar->arWmiReady = TRUE;
4253
ar->arWmiReady = true;
4182
4254
wake_up(&arEvent);
4184
#if WLAN_CONFIG_IGNORE_POWER_SAVE_FAIL_EVENT_DURING_SCAN
4185
wmi_pmparams_cmd(ar->arWmi, 0, 1, 0, 0, 1, IGNORE_POWER_SAVE_FAIL_EVENT_DURING_SCAN);
4187
#if WLAN_CONFIG_DONOT_IGNORE_BARKER_IN_ERP
4188
wmi_set_lpreamble_cmd(ar->arWmi, 0, WMI_DONOT_IGNORE_BARKER_IN_ERP);
4190
wmi_set_keepalive_cmd(ar->arWmi, WLAN_CONFIG_KEEP_ALIVE_INTERVAL);
4191
#if WLAN_CONFIG_DISABLE_11N
4193
WMI_SET_HT_CAP_CMD htCap;
4195
A_MEMZERO(&htCap, sizeof(WMI_SET_HT_CAP_CMD));
4197
wmi_set_ht_cap_cmd(ar->arWmi, &htCap);
4200
wmi_set_ht_cap_cmd(ar->arWmi, &htCap);
4202
#endif /* WLAN_CONFIG_DISABLE_11N */
4204
#ifdef ATH6K_CONFIG_OTA_MODE
4205
wmi_powermode_cmd(ar->arWmi, MAX_PERF_POWER);
4207
wmi_disctimeout_cmd(ar->arWmi, WLAN_CONFIG_DISCONNECT_TIMEOUT);
4211
add_new_sta(AR_SOFTC_T *ar, A_UINT8 *mac, A_UINT16 aid, A_UINT8 *wpaie,
4212
A_UINT8 ielen, A_UINT8 keymgmt, A_UINT8 ucipher, A_UINT8 auth)
4258
add_new_sta(struct ar6_softc *ar, u8 *mac, u16 aid, u8 *wpaie,
4259
u8 ielen, u8 keymgmt, u8 ucipher, u8 auth)
4214
A_UINT8 free_slot=aid-1;
4216
A_MEMCPY(ar->sta_list[free_slot].mac, mac, ATH_MAC_LEN);
4217
A_MEMCPY(ar->sta_list[free_slot].wpa_ie, wpaie, ielen);
4263
memcpy(ar->sta_list[free_slot].mac, mac, ATH_MAC_LEN);
4264
memcpy(ar->sta_list[free_slot].wpa_ie, wpaie, ielen);
4218
4265
ar->sta_list[free_slot].aid = aid;
4219
4266
ar->sta_list[free_slot].keymgmt = keymgmt;
4220
4267
ar->sta_list[free_slot].ucipher = ucipher;
4227
ar6000_connect_event(AR_SOFTC_T *ar, A_UINT16 channel, A_UINT8 *bssid,
4228
A_UINT16 listenInterval, A_UINT16 beaconInterval,
4229
NETWORK_TYPE networkType, A_UINT8 beaconIeLen,
4230
A_UINT8 assocReqLen, A_UINT8 assocRespLen,
4274
ar6000_connect_event(struct ar6_softc *ar, u16 channel, u8 *bssid,
4275
u16 listenInterval, u16 beaconInterval,
4276
NETWORK_TYPE networkType, u8 beaconIeLen,
4277
u8 assocReqLen, u8 assocRespLen,
4233
4280
union iwreq_data wrqu;
4234
4281
int i, beacon_ie_pos, assoc_resp_ie_pos, assoc_req_ie_pos;
5051
5098
A_PRINTF("rssi Threshold range = %d tag = %d rssi = %d\n", newThreshold,
5052
5099
userRssiThold.tag, userRssiThold.rssi);
5054
ar6000_send_event_to_app(ar, WMI_RSSI_THRESHOLD_EVENTID,(A_UINT8 *)&userRssiThold, sizeof(USER_RSSI_THOLD));
5101
ar6000_send_event_to_app(ar, WMI_RSSI_THRESHOLD_EVENTID,(u8 *)&userRssiThold, sizeof(USER_RSSI_THOLD));
5059
ar6000_hbChallengeResp_event(AR_SOFTC_T *ar, A_UINT32 cookie, A_UINT32 source)
5106
ar6000_hbChallengeResp_event(struct ar6_softc *ar, u32 cookie, u32 source)
5061
5108
if (source == APP_HB_CHALLENGE) {
5062
5109
/* Report it to the app in case it wants a positive acknowledgement */
5063
5110
ar6000_send_event_to_app(ar, WMIX_HB_CHALLENGE_RESP_EVENTID,
5064
(A_UINT8 *)&cookie, sizeof(cookie));
5111
(u8 *)&cookie, sizeof(cookie));
5066
5113
/* This would ignore the replys that come in after their due time */
5067
5114
if (cookie == ar->arHBChallengeResp.seqNum) {
5068
ar->arHBChallengeResp.outstanding = FALSE;
5115
ar->arHBChallengeResp.outstanding = false;
5075
ar6000_reportError_event(AR_SOFTC_T *ar, WMI_TARGET_ERROR_VAL errorVal)
5122
ar6000_reportError_event(struct ar6_softc *ar, WMI_TARGET_ERROR_VAL errorVal)
5077
5124
static const char * const errString[] = {
5078
5125
[WMI_TARGET_PM_ERR_FAIL] "WMI_TARGET_PM_ERR_FAIL",
5422
5469
switch (pBtcoexConfig->btProfileType) {
5423
5470
case WMI_BTCOEX_BT_PROFILE_SCO:
5424
A_MEMCPY(&pArbtcoexConfig->info.scoConfigCmd, &pBtcoexConfig->info.scoConfigCmd,
5471
memcpy(&pArbtcoexConfig->info.scoConfigCmd, &pBtcoexConfig->info.scoConfigCmd,
5425
5472
sizeof(WMI_SET_BTCOEX_SCO_CONFIG_CMD));
5427
5474
case WMI_BTCOEX_BT_PROFILE_A2DP:
5428
A_MEMCPY(&pArbtcoexConfig->info.a2dpConfigCmd, &pBtcoexConfig->info.a2dpConfigCmd,
5475
memcpy(&pArbtcoexConfig->info.a2dpConfigCmd, &pBtcoexConfig->info.a2dpConfigCmd,
5429
5476
sizeof(WMI_SET_BTCOEX_A2DP_CONFIG_CMD));
5431
5478
case WMI_BTCOEX_BT_PROFILE_ACLCOEX:
5432
A_MEMCPY(&pArbtcoexConfig->info.aclcoexConfig, &pBtcoexConfig->info.aclcoexConfig,
5479
memcpy(&pArbtcoexConfig->info.aclcoexConfig, &pBtcoexConfig->info.aclcoexConfig,
5433
5480
sizeof(WMI_SET_BTCOEX_ACLCOEX_CONFIG_CMD));
5435
5482
case WMI_BTCOEX_BT_PROFILE_INQUIRY_PAGE:
5436
A_MEMCPY(&pArbtcoexConfig->info.btinquiryPageConfigCmd, &pBtcoexConfig->info.btinquiryPageConfigCmd,
5483
memcpy(&pArbtcoexConfig->info.btinquiryPageConfigCmd, &pBtcoexConfig->info.btinquiryPageConfigCmd,
5437
5484
sizeof(WMI_SET_BTCOEX_ACLCOEX_CONFIG_CMD));
5440
5487
if (ar->statsUpdatePending) {
5441
ar->statsUpdatePending = FALSE;
5488
ar->statsUpdatePending = false;
5442
5489
wake_up(&arEvent);
5447
ar6000_btcoex_stats_event(struct ar6_softc *ar, A_UINT8 *ptr, A_UINT32 len)
5494
ar6000_btcoex_stats_event(struct ar6_softc *ar, u8 *ptr, u32 len)
5449
5496
WMI_BTCOEX_STATS_EVENT *pBtcoexStats = (WMI_BTCOEX_STATS_EVENT *)ptr;
5451
5498
AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("AR6000 BTCOEX CONFIG EVENT \n"));
5453
A_MEMCPY(&ar->arBtcoexStats, pBtcoexStats, sizeof(WMI_BTCOEX_STATS_EVENT));
5500
memcpy(&ar->arBtcoexStats, pBtcoexStats, sizeof(WMI_BTCOEX_STATS_EVENT));
5455
5502
if (ar->statsUpdatePending) {
5456
ar->statsUpdatePending = FALSE;
5503
ar->statsUpdatePending = false;
5457
5504
wake_up(&arEvent);
5619
ar6000_snrThresholdEvent_rx(void *devt, WMI_SNR_THRESHOLD_VAL newThreshold, A_UINT8 snr)
5666
ar6000_snrThresholdEvent_rx(void *devt, WMI_SNR_THRESHOLD_VAL newThreshold, u8 snr)
5621
5668
WMI_SNR_THRESHOLD_EVENT event;
5622
AR_SOFTC_T *ar = (AR_SOFTC_T *)devt;
5669
struct ar6_softc *ar = (struct ar6_softc *)devt;
5624
5671
event.range = newThreshold;
5625
5672
event.snr = snr;
5627
ar6000_send_event_to_app(ar, WMI_SNR_THRESHOLD_EVENTID, (A_UINT8 *)&event,
5674
ar6000_send_event_to_app(ar, WMI_SNR_THRESHOLD_EVENTID, (u8 *)&event,
5628
5675
sizeof(WMI_SNR_THRESHOLD_EVENT));
5632
ar6000_lqThresholdEvent_rx(void *devt, WMI_LQ_THRESHOLD_VAL newThreshold, A_UINT8 lq)
5679
ar6000_lqThresholdEvent_rx(void *devt, WMI_LQ_THRESHOLD_VAL newThreshold, u8 lq)
5634
5681
AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("lq threshold range %d, lq %d\n", newThreshold, lq));
5640
a_copy_to_user(void *to, const void *from, A_UINT32 n)
5686
u32 a_copy_to_user(void *to, const void *from, u32 n)
5642
5688
return(copy_to_user(to, from, n));
5646
a_copy_from_user(void *to, const void *from, A_UINT32 n)
5691
u32 a_copy_from_user(void *to, const void *from, u32 n)
5648
5693
return(copy_from_user(to, from, n));
5653
5698
ar6000_get_driver_cfg(struct net_device *dev,
5660
5705
switch(cfgParam)
5662
5707
case AR6000_DRIVER_CFG_GET_WLANNODECACHING:
5663
*((A_UINT32 *)result) = wlanNodeCaching;
5708
*((u32 *)result) = wlanNodeCaching;
5665
5710
case AR6000_DRIVER_CFG_LOG_RAW_WMI_MSGS:
5666
*((A_UINT32 *)result) = logWmiRawMsgs;
5711
*((u32 *)result) = logWmiRawMsgs;
5784
5829
A_MUTEX_UNLOCK(&ar->mcastpsqLock);
5786
5831
/* Reset the DTIMExpired flag back to 0 */
5787
ar->DTIMExpired = FALSE;
5832
ar->DTIMExpired = false;
5789
5834
/* Clear the LSB of the BitMapCtl field of the TIM IE */
5790
5835
wmi_set_pvb_cmd(ar->arWmi, MCAST_AID, 0);
5794
read_rssi_compensation_param(AR_SOFTC_T *ar)
5839
read_rssi_compensation_param(struct ar6_softc *ar)
5796
A_UINT8 *cust_data_ptr;
5798
5843
//#define RSSICOMPENSATION_PRINT
5800
5845
#ifdef RSSICOMPENSATION_PRINT
5802
5847
cust_data_ptr = ar6000_get_cust_data_buffer(ar->arTargetType);
5803
5848
for (i=0; i<16; i++) {
5804
A_PRINTF("cust_data_%d = %x \n", i, *(A_UINT8 *)cust_data_ptr);
5849
A_PRINTF("cust_data_%d = %x \n", i, *(u8 *)cust_data_ptr);
5805
5850
cust_data_ptr += 1;
5809
5854
cust_data_ptr = ar6000_get_cust_data_buffer(ar->arTargetType);
5811
rssi_compensation_param.customerID = *(A_UINT16 *)cust_data_ptr & 0xffff;
5812
rssi_compensation_param.enable = *(A_UINT16 *)(cust_data_ptr+2) & 0xffff;
5813
rssi_compensation_param.bg_param_a = *(A_UINT16 *)(cust_data_ptr+4) & 0xffff;
5814
rssi_compensation_param.bg_param_b = *(A_UINT16 *)(cust_data_ptr+6) & 0xffff;
5815
rssi_compensation_param.a_param_a = *(A_UINT16 *)(cust_data_ptr+8) & 0xffff;
5816
rssi_compensation_param.a_param_b = *(A_UINT16 *)(cust_data_ptr+10) &0xffff;
5817
rssi_compensation_param.reserved = *(A_UINT32 *)(cust_data_ptr+12);
5856
rssi_compensation_param.customerID = *(u16 *)cust_data_ptr & 0xffff;
5857
rssi_compensation_param.enable = *(u16 *)(cust_data_ptr+2) & 0xffff;
5858
rssi_compensation_param.bg_param_a = *(u16 *)(cust_data_ptr+4) & 0xffff;
5859
rssi_compensation_param.bg_param_b = *(u16 *)(cust_data_ptr+6) & 0xffff;
5860
rssi_compensation_param.a_param_a = *(u16 *)(cust_data_ptr+8) & 0xffff;
5861
rssi_compensation_param.a_param_b = *(u16 *)(cust_data_ptr+10) &0xffff;
5862
rssi_compensation_param.reserved = *(u32 *)(cust_data_ptr+12);
5819
5864
#ifdef RSSICOMPENSATION_PRINT
5820
5865
A_PRINTF("customerID = 0x%x \n", rssi_compensation_param.customerID);
6183
6238
A_MEMZERO(wpaie->rsn_ie, IEEE80211_MAX_IE);
6186
A_MEMCPY(wpaie->wpa_ie, conn->wpa_ie, IEEE80211_MAX_IE);
6241
memcpy(wpaie->wpa_ie, conn->wpa_ie, IEEE80211_MAX_IE);
6193
is_iwioctl_allowed(A_UINT8 mode, A_UINT16 cmd)
6248
is_iwioctl_allowed(u8 mode, u16 cmd)
6195
6250
if(cmd >= SIOCSIWCOMMIT && cmd <= SIOCGIWPOWER) {
6196
6251
cmd -= SIOCSIWCOMMIT;
6197
if(sioctl_filter[cmd] == 0xFF) return A_OK;
6198
if(sioctl_filter[cmd] & mode) return A_OK;
6252
if(sioctl_filter[cmd] == 0xFF) return 0;
6253
if(sioctl_filter[cmd] & mode) return 0;
6199
6254
} else if(cmd >= SIOCIWFIRSTPRIV && cmd <= (SIOCIWFIRSTPRIV+30)) {
6200
6255
cmd -= SIOCIWFIRSTPRIV;
6201
if(pioctl_filter[cmd] == 0xFF) return A_OK;
6202
if(pioctl_filter[cmd] & mode) return A_OK;
6256
if(pioctl_filter[cmd] == 0xFF) return 0;
6257
if(pioctl_filter[cmd] & mode) return 0;
6204
6259
return A_ERROR;
6206
6261
return A_ENOTSUP;
6210
is_xioctl_allowed(A_UINT8 mode, int cmd)
6265
is_xioctl_allowed(u8 mode, int cmd)
6212
6267
if(sizeof(xioctl_filter)-1 < cmd) {
6213
6268
A_PRINTF("Filter for this cmd=%d not defined\n",cmd);
6216
if(xioctl_filter[cmd] == 0xFF) return A_OK;
6217
if(xioctl_filter[cmd] & mode) return A_OK;
6271
if(xioctl_filter[cmd] == 0xFF) return 0;
6272
if(xioctl_filter[cmd] & mode) return 0;
6218
6273
return A_ERROR;
6339
6394
* Add support for adding and removing a virtual adapter for soft AP.
6340
6395
* Some OS requires different adapters names for station and soft AP mode.
6341
* To support these requirement, create and destory a netdevice instance
6396
* To support these requirement, create and destroy a netdevice instance
6342
6397
* when the AP mode is operational. A full fledged support for virual device
6343
6398
* is not implemented. Rather a virtual interface is created and is linked
6344
6399
* with the existing physical device instance during the operation of the
6348
A_STATUS ar6000_start_ap_interface(AR_SOFTC_T *ar)
6403
int ar6000_start_ap_interface(struct ar6_softc *ar)
6350
AR_VIRTUAL_INTERFACE_T *arApDev;
6405
struct ar_virtual_interface *arApDev;
6352
6407
/* Change net_device to point to AP instance */
6353
arApDev = (AR_VIRTUAL_INTERFACE_T *)ar->arApDev;
6408
arApDev = (struct ar_virtual_interface *)ar->arApDev;
6354
6409
ar->arNetDev = arApDev->arNetDev;
6359
A_STATUS ar6000_stop_ap_interface(AR_SOFTC_T *ar)
6414
int ar6000_stop_ap_interface(struct ar6_softc *ar)
6361
AR_VIRTUAL_INTERFACE_T *arApDev;
6416
struct ar_virtual_interface *arApDev;
6363
6418
/* Change net_device to point to sta instance */
6364
arApDev = (AR_VIRTUAL_INTERFACE_T *)ar->arApDev;
6419
arApDev = (struct ar_virtual_interface *)ar->arApDev;
6366
6421
ar->arNetDev = arApDev->arStaNetDev;
6373
A_STATUS ar6000_create_ap_interface(AR_SOFTC_T *ar, char *ap_ifname)
6428
int ar6000_create_ap_interface(struct ar6_softc *ar, char *ap_ifname)
6375
6430
struct net_device *dev;
6376
AR_VIRTUAL_INTERFACE_T *arApDev;
6431
struct ar_virtual_interface *arApDev;
6378
dev = alloc_etherdev(sizeof(AR_VIRTUAL_INTERFACE_T));
6433
dev = alloc_etherdev(sizeof(struct ar_virtual_interface));
6379
6434
if (dev == NULL) {
6380
6435
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("ar6000_create_ap_interface: can't alloc etherdev\n"));
6381
6436
return A_ERROR;