| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2010 Atheros Communications Inc. | 2 * Copyright (c) 2010 Atheros Communications Inc. |
| 3 * | 3 * |
| 4 * Permission to use, copy, modify, and/or distribute this software for any | 4 * Permission to use, copy, modify, and/or distribute this software for any |
| 5 * purpose with or without fee is hereby granted, provided that the above | 5 * purpose with or without fee is hereby granted, provided that the above |
| 6 * copyright notice and this permission notice appear in all copies. | 6 * copyright notice and this permission notice appear in all copies. |
| 7 * | 7 * |
| 8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | 8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| 9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | 9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | 10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| (...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 792 kfree(buf); | 792 kfree(buf); |
| 793 return err; | 793 return err; |
| 794 } | 794 } |
| 795 | 795 |
| 796 len -= transfer; | 796 len -= transfer; |
| 797 data += transfer; | 797 data += transfer; |
| 798 addr += transfer; | 798 addr += transfer; |
| 799 } | 799 } |
| 800 kfree(buf); | 800 kfree(buf); |
| 801 | 801 |
| 802 » if (hif_dev->device_id == 0x7010) | 802 » switch (hif_dev->device_id) { |
| 803 » case 0x7010: |
| 804 » case 0x7015: |
| 805 » case 0x9018: |
| 803 firm_offset = AR7010_FIRMWARE_TEXT; | 806 firm_offset = AR7010_FIRMWARE_TEXT; |
| 804 » else | 807 » » break; |
| 808 » default: |
| 805 firm_offset = AR9271_FIRMWARE_TEXT; | 809 firm_offset = AR9271_FIRMWARE_TEXT; |
| 810 break; |
| 811 } |
| 806 | 812 |
| 807 /* | 813 /* |
| 808 * Issue FW download complete command to firmware. | 814 * Issue FW download complete command to firmware. |
| 809 */ | 815 */ |
| 810 err = usb_control_msg(hif_dev->udev, usb_sndctrlpipe(hif_dev->udev, 0), | 816 err = usb_control_msg(hif_dev->udev, usb_sndctrlpipe(hif_dev->udev, 0), |
| 811 FIRMWARE_DOWNLOAD_COMP, | 817 FIRMWARE_DOWNLOAD_COMP, |
| 812 0x40 | USB_DIR_OUT, | 818 0x40 | USB_DIR_OUT, |
| 813 firm_offset >> 8, 0, NULL, 0, HZ); | 819 firm_offset >> 8, 0, NULL, 0, HZ); |
| 814 if (err) | 820 if (err) |
| 815 return -EIO; | 821 return -EIO; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 894 &hif_dev->udev->dev); | 900 &hif_dev->udev->dev); |
| 895 if (hif_dev->htc_handle == NULL) { | 901 if (hif_dev->htc_handle == NULL) { |
| 896 ret = -ENOMEM; | 902 ret = -ENOMEM; |
| 897 goto err_htc_hw_alloc; | 903 goto err_htc_hw_alloc; |
| 898 } | 904 } |
| 899 | 905 |
| 900 /* Find out which firmware to load */ | 906 /* Find out which firmware to load */ |
| 901 | 907 |
| 902 switch(hif_dev->device_id) { | 908 switch(hif_dev->device_id) { |
| 903 case 0x7010: | 909 case 0x7010: |
| 910 case 0x7015: |
| 904 case 0x9018: | 911 case 0x9018: |
| 905 if (le16_to_cpu(udev->descriptor.bcdDevice) == 0x0202) | 912 if (le16_to_cpu(udev->descriptor.bcdDevice) == 0x0202) |
| 906 hif_dev->fw_name = FIRMWARE_AR7010_1_1; | 913 hif_dev->fw_name = FIRMWARE_AR7010_1_1; |
| 907 else | 914 else |
| 908 hif_dev->fw_name = FIRMWARE_AR7010; | 915 hif_dev->fw_name = FIRMWARE_AR7010; |
| 909 break; | 916 break; |
| 910 default: | 917 default: |
| 911 hif_dev->fw_name = FIRMWARE_AR9271; | 918 hif_dev->fw_name = FIRMWARE_AR9271; |
| 912 break; | 919 break; |
| 913 } | 920 } |
| 914 | 921 |
| 915 if (!hif_dev->fw_name) { | |
| 916 dev_err(&udev->dev, "Can't determine firmware !\n"); | |
| 917 goto err_htc_hw_alloc; | |
| 918 } | |
| 919 | |
| 920 ret = ath9k_hif_usb_dev_init(hif_dev); | 922 ret = ath9k_hif_usb_dev_init(hif_dev); |
| 921 if (ret) { | 923 if (ret) { |
| 922 ret = -EINVAL; | 924 ret = -EINVAL; |
| 923 goto err_hif_init_usb; | 925 goto err_hif_init_usb; |
| 924 } | 926 } |
| 925 | 927 |
| 926 ret = ath9k_htc_hw_init(hif_dev->htc_handle, | 928 ret = ath9k_htc_hw_init(hif_dev->htc_handle, |
| 927 &hif_dev->udev->dev, hif_dev->device_id); | 929 &hif_dev->udev->dev, hif_dev->device_id); |
| 928 if (ret) { | 930 if (ret) { |
| 929 ret = -EINVAL; | 931 ret = -EINVAL; |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1050 | 1052 |
| 1051 int ath9k_hif_usb_init(void) | 1053 int ath9k_hif_usb_init(void) |
| 1052 { | 1054 { |
| 1053 return usb_register(&ath9k_hif_usb_driver); | 1055 return usb_register(&ath9k_hif_usb_driver); |
| 1054 } | 1056 } |
| 1055 | 1057 |
| 1056 void ath9k_hif_usb_exit(void) | 1058 void ath9k_hif_usb_exit(void) |
| 1057 { | 1059 { |
| 1058 usb_deregister(&ath9k_hif_usb_driver); | 1060 usb_deregister(&ath9k_hif_usb_driver); |
| 1059 } | 1061 } |
| OLD | NEW |