Skip to content

Commit

Permalink
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/gi…
Browse files Browse the repository at this point in the history
…t/linville/wireless into for-davem
  • Loading branch information
linvjw committed Aug 26, 2011
2 parents bc909d9 + 8b2a382 commit e2e6be5
Show file tree
Hide file tree
Showing 27 changed files with 143 additions and 153 deletions.
12 changes: 12 additions & 0 deletions drivers/bcma/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ MODULE_LICENSE("GPL");
static int bcma_bus_match(struct device *dev, struct device_driver *drv);
static int bcma_device_probe(struct device *dev);
static int bcma_device_remove(struct device *dev);
static int bcma_device_uevent(struct device *dev, struct kobj_uevent_env *env);

static ssize_t manuf_show(struct device *dev, struct device_attribute *attr, char *buf)
{
Expand Down Expand Up @@ -49,6 +50,7 @@ static struct bus_type bcma_bus_type = {
.match = bcma_bus_match,
.probe = bcma_device_probe,
.remove = bcma_device_remove,
.uevent = bcma_device_uevent,
.dev_attrs = bcma_device_attrs,
};

Expand Down Expand Up @@ -227,6 +229,16 @@ static int bcma_device_remove(struct device *dev)
return 0;
}

static int bcma_device_uevent(struct device *dev, struct kobj_uevent_env *env)
{
struct bcma_device *core = container_of(dev, struct bcma_device, dev);

return add_uevent_var(env,
"MODALIAS=bcma:m%04Xid%04Xrev%02Xcl%02X",
core->id.manuf, core->id.id,
core->id.rev, core->id.class);
}

static int __init bcma_modinit(void)
{
int err;
Expand Down
1 change: 1 addition & 0 deletions drivers/bluetooth/ath3k.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ static struct usb_device_id ath3k_table[] = {
/* Atheros AR3011 with sflash firmware*/
{ USB_DEVICE(0x0CF3, 0x3002) },
{ USB_DEVICE(0x13d3, 0x3304) },
{ USB_DEVICE(0x0930, 0x0215) },

/* Atheros AR9285 Malbec with sflash firmware */
{ USB_DEVICE(0x03F0, 0x311D) },
Expand Down
13 changes: 10 additions & 3 deletions drivers/bluetooth/btusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ static struct usb_device_id blacklist_table[] = {
/* Atheros 3011 with sflash firmware */
{ USB_DEVICE(0x0cf3, 0x3002), .driver_info = BTUSB_IGNORE },
{ USB_DEVICE(0x13d3, 0x3304), .driver_info = BTUSB_IGNORE },
{ USB_DEVICE(0x0930, 0x0215), .driver_info = BTUSB_IGNORE },

/* Atheros AR9285 Malbec with sflash firmware */
{ USB_DEVICE(0x03f0, 0x311d), .driver_info = BTUSB_IGNORE },
Expand Down Expand Up @@ -256,7 +257,9 @@ static void btusb_intr_complete(struct urb *urb)

err = usb_submit_urb(urb, GFP_ATOMIC);
if (err < 0) {
if (err != -EPERM)
/* -EPERM: urb is being killed;
* -ENODEV: device got disconnected */
if (err != -EPERM && err != -ENODEV)
BT_ERR("%s urb %p failed to resubmit (%d)",
hdev->name, urb, -err);
usb_unanchor_urb(urb);
Expand Down Expand Up @@ -341,7 +344,9 @@ static void btusb_bulk_complete(struct urb *urb)

err = usb_submit_urb(urb, GFP_ATOMIC);
if (err < 0) {
if (err != -EPERM)
/* -EPERM: urb is being killed;
* -ENODEV: device got disconnected */
if (err != -EPERM && err != -ENODEV)
BT_ERR("%s urb %p failed to resubmit (%d)",
hdev->name, urb, -err);
usb_unanchor_urb(urb);
Expand Down Expand Up @@ -431,7 +436,9 @@ static void btusb_isoc_complete(struct urb *urb)

err = usb_submit_urb(urb, GFP_ATOMIC);
if (err < 0) {
if (err != -EPERM)
/* -EPERM: urb is being killed;
* -ENODEV: device got disconnected */
if (err != -EPERM && err != -ENODEV)
BT_ERR("%s urb %p failed to resubmit (%d)",
hdev->name, urb, -err);
usb_unanchor_urb(urb);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ static int ar9003_hw_power_interpolate(int32_t x,
static const struct ar9300_eeprom ar9300_default = {
.eepromVersion = 2,
.templateVersion = 2,
.macAddr = {1, 2, 3, 4, 5, 6},
.macAddr = {0, 2, 3, 4, 5, 6},
.custData = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
.baseEepHeader = {
Expand Down
4 changes: 4 additions & 0 deletions drivers/net/wireless/ath/ath9k/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2283,7 +2283,11 @@ static void ath9k_set_coverage_class(struct ieee80211_hw *hw, u8 coverage_class)

mutex_lock(&sc->mutex);
ah->coverage_class = coverage_class;

ath9k_ps_wakeup(sc);
ath9k_hw_init_global_settings(ah);
ath9k_ps_restore(sc);

mutex_unlock(&sc->mutex);
}

Expand Down
4 changes: 3 additions & 1 deletion drivers/net/wireless/ath/carl9170/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1066,8 +1066,10 @@ static int carl9170_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
* the high througput speed in 802.11n networks.
*/

if (!is_main_vif(ar, vif))
if (!is_main_vif(ar, vif)) {
mutex_lock(&ar->mutex);
goto err_softw;
}

/*
* While the hardware supports *catch-all* key, for offloading
Expand Down
14 changes: 1 addition & 13 deletions drivers/net/wireless/rt2x00/rt2x00usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -871,18 +871,8 @@ int rt2x00usb_suspend(struct usb_interface *usb_intf, pm_message_t state)
{
struct ieee80211_hw *hw = usb_get_intfdata(usb_intf);
struct rt2x00_dev *rt2x00dev = hw->priv;
int retval;

retval = rt2x00lib_suspend(rt2x00dev, state);
if (retval)
return retval;

/*
* Decrease usbdev refcount.
*/
usb_put_dev(interface_to_usbdev(usb_intf));

return 0;
return rt2x00lib_suspend(rt2x00dev, state);
}
EXPORT_SYMBOL_GPL(rt2x00usb_suspend);

Expand All @@ -891,8 +881,6 @@ int rt2x00usb_resume(struct usb_interface *usb_intf)
struct ieee80211_hw *hw = usb_get_intfdata(usb_intf);
struct rt2x00_dev *rt2x00dev = hw->priv;

usb_get_dev(interface_to_usbdev(usb_intf));

return rt2x00lib_resume(rt2x00dev);
}
EXPORT_SYMBOL_GPL(rt2x00usb_resume);
Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/wl12xx/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4283,6 +4283,7 @@ int wl1271_init_ieee80211(struct wl1271 *wl)
wl->hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
BIT(NL80211_IFTYPE_ADHOC) | BIT(NL80211_IFTYPE_AP);
wl->hw->wiphy->max_scan_ssids = 1;
wl->hw->wiphy->max_sched_scan_ssids = 1;
/*
* Maximum length of elements in scanning probe request templates
* should be the maximum length possible for a template, without
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/wl12xx/sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ static int wl1271_sdio_power_on(struct wl1271 *wl)
/* If enabled, tell runtime PM not to power off the card */
if (pm_runtime_enabled(&func->dev)) {
ret = pm_runtime_get_sync(&func->dev);
if (ret)
if (ret < 0)
goto out;
} else {
/* Runtime PM is disabled: power up the card manually */
Expand Down
45 changes: 0 additions & 45 deletions drivers/net/wireless/wl12xx/testmode.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ enum wl1271_tm_commands {
WL1271_TM_CMD_TEST,
WL1271_TM_CMD_INTERROGATE,
WL1271_TM_CMD_CONFIGURE,
WL1271_TM_CMD_NVS_PUSH,
WL1271_TM_CMD_SET_PLT_MODE,
WL1271_TM_CMD_RECOVER,

Expand Down Expand Up @@ -190,48 +189,6 @@ static int wl1271_tm_cmd_configure(struct wl1271 *wl, struct nlattr *tb[])
return 0;
}

static int wl1271_tm_cmd_nvs_push(struct wl1271 *wl, struct nlattr *tb[])
{
int ret = 0;
size_t len;
void *buf;

wl1271_debug(DEBUG_TESTMODE, "testmode cmd nvs push");

if (!tb[WL1271_TM_ATTR_DATA])
return -EINVAL;

buf = nla_data(tb[WL1271_TM_ATTR_DATA]);
len = nla_len(tb[WL1271_TM_ATTR_DATA]);

mutex_lock(&wl->mutex);

kfree(wl->nvs);

if ((wl->chip.id == CHIP_ID_1283_PG20) &&
(len != sizeof(struct wl128x_nvs_file)))
return -EINVAL;
else if (len != sizeof(struct wl1271_nvs_file))
return -EINVAL;

wl->nvs = kzalloc(len, GFP_KERNEL);
if (!wl->nvs) {
wl1271_error("could not allocate memory for the nvs file");
ret = -ENOMEM;
goto out;
}

memcpy(wl->nvs, buf, len);
wl->nvs_len = len;

wl1271_debug(DEBUG_TESTMODE, "testmode pushed nvs");

out:
mutex_unlock(&wl->mutex);

return ret;
}

static int wl1271_tm_cmd_set_plt_mode(struct wl1271 *wl, struct nlattr *tb[])
{
u32 val;
Expand Down Expand Up @@ -288,8 +245,6 @@ int wl1271_tm_cmd(struct ieee80211_hw *hw, void *data, int len)
return wl1271_tm_cmd_interrogate(wl, tb);
case WL1271_TM_CMD_CONFIGURE:
return wl1271_tm_cmd_configure(wl, tb);
case WL1271_TM_CMD_NVS_PUSH:
return wl1271_tm_cmd_nvs_push(wl, tb);
case WL1271_TM_CMD_SET_PLT_MODE:
return wl1271_tm_cmd_set_plt_mode(wl, tb);
case WL1271_TM_CMD_RECOVER:
Expand Down
3 changes: 3 additions & 0 deletions include/net/cfg80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -1865,6 +1865,9 @@ struct wiphy {
* you need use set_wiphy_dev() (see below) */
struct device dev;

/* protects ->resume, ->suspend sysfs callbacks against unregister hw */
bool registered;

/* dir in debugfs: ieee80211/<wiphyname> */
struct dentry *debugfsdir;

Expand Down
6 changes: 3 additions & 3 deletions net/bluetooth/af_bluetooth.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,9 +494,8 @@ int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo)
BT_DBG("sk %p", sk);

add_wait_queue(sk_sleep(sk), &wait);
set_current_state(TASK_INTERRUPTIBLE);
while (sk->sk_state != state) {
set_current_state(TASK_INTERRUPTIBLE);

if (!timeo) {
err = -EINPROGRESS;
break;
Expand All @@ -510,12 +509,13 @@ int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo)
release_sock(sk);
timeo = schedule_timeout(timeo);
lock_sock(sk);
set_current_state(TASK_INTERRUPTIBLE);

err = sock_error(sk);
if (err)
break;
}
set_current_state(TASK_RUNNING);
__set_current_state(TASK_RUNNING);
remove_wait_queue(sk_sleep(sk), &wait);
return err;
}
Expand Down
1 change: 1 addition & 0 deletions net/bluetooth/bnep/bnep.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ struct bnep_session {
unsigned int role;
unsigned long state;
unsigned long flags;
atomic_t terminate;
struct task_struct *task;

struct ethhdr eh;
Expand Down
13 changes: 8 additions & 5 deletions net/bluetooth/bnep/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,9 +484,11 @@ static int bnep_session(void *arg)

init_waitqueue_entry(&wait, current);
add_wait_queue(sk_sleep(sk), &wait);
while (!kthread_should_stop()) {
while (1) {
set_current_state(TASK_INTERRUPTIBLE);

if (atomic_read(&s->terminate))
break;
/* RX */
while ((skb = skb_dequeue(&sk->sk_receive_queue))) {
skb_orphan(skb);
Expand All @@ -504,7 +506,7 @@ static int bnep_session(void *arg)

schedule();
}
set_current_state(TASK_RUNNING);
__set_current_state(TASK_RUNNING);
remove_wait_queue(sk_sleep(sk), &wait);

/* Cleanup session */
Expand Down Expand Up @@ -640,9 +642,10 @@ int bnep_del_connection(struct bnep_conndel_req *req)
down_read(&bnep_session_sem);

s = __bnep_get_session(req->dst);
if (s)
kthread_stop(s->task);
else
if (s) {
atomic_inc(&s->terminate);
wake_up_process(s->task);
} else
err = -ENOENT;

up_read(&bnep_session_sem);
Expand Down
3 changes: 2 additions & 1 deletion net/bluetooth/cmtp/capi.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,8 @@ static void cmtp_reset_ctr(struct capi_ctr *ctrl)

capi_ctr_down(ctrl);

kthread_stop(session->task);
atomic_inc(&session->terminate);
wake_up_process(session->task);
}

static void cmtp_register_appl(struct capi_ctr *ctrl, __u16 appl, capi_register_params *rp)
Expand Down
1 change: 1 addition & 0 deletions net/bluetooth/cmtp/cmtp.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ struct cmtp_session {

char name[BTNAMSIZ];

atomic_t terminate;
struct task_struct *task;

wait_queue_head_t wait;
Expand Down
20 changes: 12 additions & 8 deletions net/bluetooth/cmtp/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,11 @@ static int cmtp_session(void *arg)

init_waitqueue_entry(&wait, current);
add_wait_queue(sk_sleep(sk), &wait);
while (!kthread_should_stop()) {
while (1) {
set_current_state(TASK_INTERRUPTIBLE);

if (atomic_read(&session->terminate))
break;
if (sk->sk_state != BT_CONNECTED)
break;

Expand All @@ -307,7 +309,7 @@ static int cmtp_session(void *arg)

schedule();
}
set_current_state(TASK_RUNNING);
__set_current_state(TASK_RUNNING);
remove_wait_queue(sk_sleep(sk), &wait);

down_write(&cmtp_session_sem);
Expand Down Expand Up @@ -380,16 +382,17 @@ int cmtp_add_connection(struct cmtp_connadd_req *req, struct socket *sock)

if (!(session->flags & (1 << CMTP_LOOPBACK))) {
err = cmtp_attach_device(session);
if (err < 0)
goto detach;
if (err < 0) {
atomic_inc(&session->terminate);
wake_up_process(session->task);
up_write(&cmtp_session_sem);
return err;
}
}

up_write(&cmtp_session_sem);
return 0;

detach:
cmtp_detach_device(session);

unlink:
__cmtp_unlink_session(session);

Expand All @@ -414,7 +417,8 @@ int cmtp_del_connection(struct cmtp_conndel_req *req)
skb_queue_purge(&session->transmit);

/* Stop session thread */
kthread_stop(session->task);
atomic_inc(&session->terminate);
wake_up_process(session->task);
} else
err = -ENOENT;

Expand Down
Loading

0 comments on commit e2e6be5

Please sign in to comment.