OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2004-2008 Atheros Communications Inc. | 2 * Copyright (c) 2004-2010 Atheros Communications Inc. |
3 * All rights reserved. | 3 * All rights reserved. |
4 * | 4 * |
5 * This file implements the Atheros PS and patch downloaded for HCI UART Transpo
rt driver. | 5 * This file implements the Atheros PS and patch downloaded for HCI UART Transpo
rt driver. |
6 * This file can be used for HCI SDIO transport implementation for AR6002 with H
CI_TRANSPORT_SDIO | 6 * This file can be used for HCI SDIO transport implementation for AR6002 with H
CI_TRANSPORT_SDIO |
7 * defined. | 7 * defined. |
8 * | 8 * |
9 * | 9 * |
10 * ar3kcpsconfig.c | 10 * ar3kcpsconfig.c |
11 * | 11 * |
12 * | 12 * |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 HciCmdList[0].Hcipacket, | 280 HciCmdList[0].Hcipacket, |
281 HciCmdList[0].packetLen, | 281 HciCmdList[0].packetLen, |
282 &event, | 282 &event, |
283 &bufferToFree) == A_OK) { | 283 &bufferToFree) == A_OK) { |
284 if(ReadPSEvent(event) == A_OK) { /* Exit if the status is success */ | 284 if(ReadPSEvent(event) == A_OK) { /* Exit if the status is success */ |
285 if(bufferToFree != NULL) { | 285 if(bufferToFree != NULL) { |
286 A_FREE(bufferToFree); | 286 A_FREE(bufferToFree); |
287 } | 287 } |
288 | 288 |
289 #ifndef HCI_TRANSPORT_SDIO | 289 #ifndef HCI_TRANSPORT_SDIO |
290 » » » if(bdaddr[0] !='\0') { | 290 » » » if(bdaddr && bdaddr[0] !='\0') { |
291 write_bdaddr(hdev,bdaddr,BDADDR_TYPE_STRING); | 291 write_bdaddr(hdev,bdaddr,BDADDR_TYPE_STRING); |
292 } | 292 } |
293 #endif | 293 #endif |
294 status = 1; | 294 status = 1; |
295 goto complete; | 295 goto complete; |
296 } | 296 } |
297 if(bufferToFree != NULL) { | 297 if(bufferToFree != NULL) { |
298 A_FREE(bufferToFree); | 298 A_FREE(bufferToFree); |
299 } | 299 } |
300 } else { | 300 } else { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 if(A_REQUEST_FIRMWARE(&firmware,config_path,firmwareDev) < 0) { | 354 if(A_REQUEST_FIRMWARE(&firmware,config_path,firmwareDev) < 0) { |
355 AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("%s: firmware file open error\n",
__FUNCTION__ )); | 355 AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("%s: firmware file open error\n",
__FUNCTION__ )); |
356 status = 1; | 356 status = 1; |
357 goto complete; | 357 goto complete; |
358 } | 358 } |
359 if(NULL == firmware || firmware->size == 0) { | 359 if(NULL == firmware || firmware->size == 0) { |
360 status = 1; | 360 status = 1; |
361 goto complete; | 361 goto complete; |
362 } | 362 } |
363 len = (firmware->size > MAX_BDADDR_FORMAT_LENGTH)? MAX_BDADDR_FORMAT_LEN
GTH: firmware->size; | 363 len = (firmware->size > MAX_BDADDR_FORMAT_LENGTH)? MAX_BDADDR_FORMAT_LEN
GTH: firmware->size; |
364 memcpy(config_bdaddr, firmware->data,len); | 364 » memcpy(config_bdaddr, firmware->data,len); |
365 config_bdaddr[len] = '\0'; | 365 » config_bdaddr[len] = '\0'; |
366 write_bdaddr(hdev,config_bdaddr,BDADDR_TYPE_STRING); | 366 » write_bdaddr(hdev,config_bdaddr,BDADDR_TYPE_STRING); |
367 A_RELEASE_FIRMWARE(firmware); | 367 A_RELEASE_FIRMWARE(firmware); |
368 } | 368 } |
369 complete: | 369 complete: |
370 #ifndef HCI_TRANSPORT_SDIO | 370 #ifndef HCI_TRANSPORT_SDIO |
371 AthEnableSyncCommandOp(FALSE); | 371 AthEnableSyncCommandOp(FALSE); |
372 PSTagMode = FALSE; | 372 PSTagMode = FALSE; |
373 wake_up_interruptible(&PsCompleteEvent); | 373 wake_up_interruptible(&PsCompleteEvent); |
374 #endif /* HCI_TRANSPORT_SDIO */ | 374 #endif /* HCI_TRANSPORT_SDIO */ |
375 if(NULL != HciCmdList) { | 375 if(NULL != HciCmdList) { |
376 AthFreeCommandList(&HciCmdList,numCmds); | 376 AthFreeCommandList(&HciCmdList,numCmds); |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 } | 563 } |
564 | 564 |
565 } | 565 } |
566 if(bufferToFree != NULL) { | 566 if(bufferToFree != NULL) { |
567 A_FREE(bufferToFree); | 567 A_FREE(bufferToFree); |
568 } | 568 } |
569 return result; | 569 return result; |
570 } | 570 } |
571 | 571 |
572 | 572 |
OLD | NEW |