Commit 3100cdd8 authored by John W. Linville's avatar John W. Linville

Merge branch 'for-linville' of git://github.com/kvalo/ath6kl

parents fca97d76 37291fc6
...@@ -1240,20 +1240,14 @@ static ssize_t ath6kl_force_roam_write(struct file *file, ...@@ -1240,20 +1240,14 @@ static ssize_t ath6kl_force_roam_write(struct file *file,
char buf[20]; char buf[20];
size_t len; size_t len;
u8 bssid[ETH_ALEN]; u8 bssid[ETH_ALEN];
int i;
int addr[ETH_ALEN];
len = min(count, sizeof(buf) - 1); len = min(count, sizeof(buf) - 1);
if (copy_from_user(buf, user_buf, len)) if (copy_from_user(buf, user_buf, len))
return -EFAULT; return -EFAULT;
buf[len] = '\0'; buf[len] = '\0';
if (sscanf(buf, "%02x:%02x:%02x:%02x:%02x:%02x", if (!mac_pton(buf, bssid))
&addr[0], &addr[1], &addr[2], &addr[3], &addr[4], &addr[5])
!= ETH_ALEN)
return -EINVAL; return -EINVAL;
for (i = 0; i < ETH_ALEN; i++)
bssid[i] = addr[i];
ret = ath6kl_wmi_force_roam_cmd(ar->wmi, bssid); ret = ath6kl_wmi_force_roam_cmd(ar->wmi, bssid);
if (ret) if (ret)
......
...@@ -1696,10 +1696,16 @@ static int __ath6kl_init_hw_start(struct ath6kl *ar) ...@@ -1696,10 +1696,16 @@ static int __ath6kl_init_hw_start(struct ath6kl *ar)
test_bit(WMI_READY, test_bit(WMI_READY,
&ar->flag), &ar->flag),
WMI_TIMEOUT); WMI_TIMEOUT);
if (timeleft <= 0) {
clear_bit(WMI_READY, &ar->flag);
ath6kl_err("wmi is not ready or wait was interrupted: %ld\n",
timeleft);
ret = -EIO;
goto err_htc_stop;
}
ath6kl_dbg(ATH6KL_DBG_BOOT, "firmware booted\n"); ath6kl_dbg(ATH6KL_DBG_BOOT, "firmware booted\n");
if (test_and_clear_bit(FIRST_BOOT, &ar->flag)) { if (test_and_clear_bit(FIRST_BOOT, &ar->flag)) {
ath6kl_info("%s %s fw %s api %d%s\n", ath6kl_info("%s %s fw %s api %d%s\n",
ar->hw.name, ar->hw.name,
...@@ -1718,12 +1724,6 @@ static int __ath6kl_init_hw_start(struct ath6kl *ar) ...@@ -1718,12 +1724,6 @@ static int __ath6kl_init_hw_start(struct ath6kl *ar)
goto err_htc_stop; goto err_htc_stop;
} }
if (!timeleft || signal_pending(current)) {
ath6kl_err("wmi is not ready or wait was interrupted\n");
ret = -EIO;
goto err_htc_stop;
}
ath6kl_dbg(ATH6KL_DBG_TRC, "%s: wmi is ready\n", __func__); ath6kl_dbg(ATH6KL_DBG_TRC, "%s: wmi is ready\n", __func__);
/* communicate the wmi protocol verision to the target */ /* communicate the wmi protocol verision to the target */
......
...@@ -345,16 +345,16 @@ static int ath6kl_sdio_alloc_prep_scat_req(struct ath6kl_sdio *ar_sdio, ...@@ -345,16 +345,16 @@ static int ath6kl_sdio_alloc_prep_scat_req(struct ath6kl_sdio *ar_sdio,
{ {
struct hif_scatter_req *s_req; struct hif_scatter_req *s_req;
struct bus_request *bus_req; struct bus_request *bus_req;
int i, scat_req_sz, scat_list_sz, sg_sz, buf_sz; int i, scat_req_sz, scat_list_sz, size;
u8 *virt_buf; u8 *virt_buf;
scat_list_sz = (n_scat_entry - 1) * sizeof(struct hif_scatter_item); scat_list_sz = (n_scat_entry - 1) * sizeof(struct hif_scatter_item);
scat_req_sz = sizeof(*s_req) + scat_list_sz; scat_req_sz = sizeof(*s_req) + scat_list_sz;
if (!virt_scat) if (!virt_scat)
sg_sz = sizeof(struct scatterlist) * n_scat_entry; size = sizeof(struct scatterlist) * n_scat_entry;
else else
buf_sz = 2 * L1_CACHE_BYTES + size = 2 * L1_CACHE_BYTES +
ATH6KL_MAX_TRANSFER_SIZE_PER_SCATTER; ATH6KL_MAX_TRANSFER_SIZE_PER_SCATTER;
for (i = 0; i < n_scat_req; i++) { for (i = 0; i < n_scat_req; i++) {
...@@ -364,7 +364,7 @@ static int ath6kl_sdio_alloc_prep_scat_req(struct ath6kl_sdio *ar_sdio, ...@@ -364,7 +364,7 @@ static int ath6kl_sdio_alloc_prep_scat_req(struct ath6kl_sdio *ar_sdio,
return -ENOMEM; return -ENOMEM;
if (virt_scat) { if (virt_scat) {
virt_buf = kzalloc(buf_sz, GFP_KERNEL); virt_buf = kzalloc(size, GFP_KERNEL);
if (!virt_buf) { if (!virt_buf) {
kfree(s_req); kfree(s_req);
return -ENOMEM; return -ENOMEM;
...@@ -374,7 +374,7 @@ static int ath6kl_sdio_alloc_prep_scat_req(struct ath6kl_sdio *ar_sdio, ...@@ -374,7 +374,7 @@ static int ath6kl_sdio_alloc_prep_scat_req(struct ath6kl_sdio *ar_sdio,
(u8 *)L1_CACHE_ALIGN((unsigned long)virt_buf); (u8 *)L1_CACHE_ALIGN((unsigned long)virt_buf);
} else { } else {
/* allocate sglist */ /* allocate sglist */
s_req->sgentries = kzalloc(sg_sz, GFP_KERNEL); s_req->sgentries = kzalloc(size, GFP_KERNEL);
if (!s_req->sgentries) { if (!s_req->sgentries) {
kfree(s_req); kfree(s_req);
......
...@@ -1061,6 +1061,22 @@ static void ath6kl_usb_cleanup_scatter(struct ath6kl *ar) ...@@ -1061,6 +1061,22 @@ static void ath6kl_usb_cleanup_scatter(struct ath6kl *ar)
return; return;
} }
static int ath6kl_usb_suspend(struct ath6kl *ar, struct cfg80211_wowlan *wow)
{
/*
* cfg80211 suspend/WOW currently not supported for USB.
*/
return 0;
}
static int ath6kl_usb_resume(struct ath6kl *ar)
{
/*
* cfg80211 resume currently not supported for USB.
*/
return 0;
}
static const struct ath6kl_hif_ops ath6kl_usb_ops = { static const struct ath6kl_hif_ops ath6kl_usb_ops = {
.diag_read32 = ath6kl_usb_diag_read32, .diag_read32 = ath6kl_usb_diag_read32,
.diag_write32 = ath6kl_usb_diag_write32, .diag_write32 = ath6kl_usb_diag_write32,
...@@ -1074,6 +1090,8 @@ static const struct ath6kl_hif_ops ath6kl_usb_ops = { ...@@ -1074,6 +1090,8 @@ static const struct ath6kl_hif_ops ath6kl_usb_ops = {
.pipe_map_service = ath6kl_usb_map_service_pipe, .pipe_map_service = ath6kl_usb_map_service_pipe,
.pipe_get_free_queue_number = ath6kl_usb_get_free_queue_number, .pipe_get_free_queue_number = ath6kl_usb_get_free_queue_number,
.cleanup_scatter = ath6kl_usb_cleanup_scatter, .cleanup_scatter = ath6kl_usb_cleanup_scatter,
.suspend = ath6kl_usb_suspend,
.resume = ath6kl_usb_resume,
}; };
/* ath6kl usb driver registered functions */ /* ath6kl usb driver registered functions */
...@@ -1152,7 +1170,7 @@ static void ath6kl_usb_remove(struct usb_interface *interface) ...@@ -1152,7 +1170,7 @@ static void ath6kl_usb_remove(struct usb_interface *interface)
#ifdef CONFIG_PM #ifdef CONFIG_PM
static int ath6kl_usb_suspend(struct usb_interface *interface, static int ath6kl_usb_pm_suspend(struct usb_interface *interface,
pm_message_t message) pm_message_t message)
{ {
struct ath6kl_usb *device; struct ath6kl_usb *device;
...@@ -1162,7 +1180,7 @@ static int ath6kl_usb_suspend(struct usb_interface *interface, ...@@ -1162,7 +1180,7 @@ static int ath6kl_usb_suspend(struct usb_interface *interface,
return 0; return 0;
} }
static int ath6kl_usb_resume(struct usb_interface *interface) static int ath6kl_usb_pm_resume(struct usb_interface *interface)
{ {
struct ath6kl_usb *device; struct ath6kl_usb *device;
device = usb_get_intfdata(interface); device = usb_get_intfdata(interface);
...@@ -1175,7 +1193,7 @@ static int ath6kl_usb_resume(struct usb_interface *interface) ...@@ -1175,7 +1193,7 @@ static int ath6kl_usb_resume(struct usb_interface *interface)
return 0; return 0;
} }
static int ath6kl_usb_reset_resume(struct usb_interface *intf) static int ath6kl_usb_pm_reset_resume(struct usb_interface *intf)
{ {
if (usb_get_intfdata(intf)) if (usb_get_intfdata(intf))
ath6kl_usb_remove(intf); ath6kl_usb_remove(intf);
...@@ -1184,9 +1202,9 @@ static int ath6kl_usb_reset_resume(struct usb_interface *intf) ...@@ -1184,9 +1202,9 @@ static int ath6kl_usb_reset_resume(struct usb_interface *intf)
#else #else
#define ath6kl_usb_suspend NULL #define ath6kl_usb_pm_suspend NULL
#define ath6kl_usb_resume NULL #define ath6kl_usb_pm_resume NULL
#define ath6kl_usb_reset_resume NULL #define ath6kl_usb_pm_reset_resume NULL
#endif #endif
...@@ -1201,9 +1219,9 @@ MODULE_DEVICE_TABLE(usb, ath6kl_usb_ids); ...@@ -1201,9 +1219,9 @@ MODULE_DEVICE_TABLE(usb, ath6kl_usb_ids);
static struct usb_driver ath6kl_usb_driver = { static struct usb_driver ath6kl_usb_driver = {
.name = "ath6kl_usb", .name = "ath6kl_usb",
.probe = ath6kl_usb_probe, .probe = ath6kl_usb_probe,
.suspend = ath6kl_usb_suspend, .suspend = ath6kl_usb_pm_suspend,
.resume = ath6kl_usb_resume, .resume = ath6kl_usb_pm_resume,
.reset_resume = ath6kl_usb_reset_resume, .reset_resume = ath6kl_usb_pm_reset_resume,
.disconnect = ath6kl_usb_remove, .disconnect = ath6kl_usb_remove,
.id_table = ath6kl_usb_ids, .id_table = ath6kl_usb_ids,
.supports_autosuspend = true, .supports_autosuspend = true,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment