Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 256386
b: refs/heads/master
c: d859898
h: refs/heads/master
v: v3
  • Loading branch information
John W. Linville committed Jul 11, 2011
1 parent df08e38 commit 2bdbc85
Show file tree
Hide file tree
Showing 18 changed files with 89 additions and 45 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8ae2e12f1534e647d4a816755e5a09c2de6f9fca
refs/heads/master: d8598981146241064993e371cea8333f59553cb6
8 changes: 3 additions & 5 deletions trunk/drivers/net/wireless/ath/ath5k/eeprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -693,14 +693,12 @@ ath5k_eeprom_free_pcal_info(struct ath5k_hw *ah, int mode)
if (!chinfo[pier].pd_curves)
continue;

for (pdg = 0; pdg < ee->ee_pd_gains[mode]; pdg++) {
for (pdg = 0; pdg < AR5K_EEPROM_N_PD_CURVES; pdg++) {
struct ath5k_pdgain_info *pd =
&chinfo[pier].pd_curves[pdg];

if (pd != NULL) {
kfree(pd->pd_step);
kfree(pd->pd_pwr);
}
kfree(pd->pd_step);
kfree(pd->pd_pwr);
}

kfree(chinfo[pier].pd_curves);
Expand Down
7 changes: 5 additions & 2 deletions trunk/drivers/net/wireless/ath/ath5k/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,9 @@ ath5k_pci_remove(struct pci_dev *pdev)
#ifdef CONFIG_PM_SLEEP
static int ath5k_pci_suspend(struct device *dev)
{
struct ath5k_softc *sc = pci_get_drvdata(to_pci_dev(dev));
struct pci_dev *pdev = to_pci_dev(dev);
struct ieee80211_hw *hw = pci_get_drvdata(pdev);
struct ath5k_softc *sc = hw->priv;

ath5k_led_off(sc);
return 0;
Expand All @@ -306,7 +308,8 @@ static int ath5k_pci_suspend(struct device *dev)
static int ath5k_pci_resume(struct device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev);
struct ath5k_softc *sc = pci_get_drvdata(pdev);
struct ieee80211_hw *hw = pci_get_drvdata(pdev);
struct ath5k_softc *sc = hw->priv;

/*
* Suspend/Resume resets the PCI configuration space, so we have to
Expand Down
9 changes: 6 additions & 3 deletions trunk/drivers/net/wireless/ath/ath5k/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@ static ssize_t ath5k_attr_show_##name(struct device *dev, \
struct device_attribute *attr, \
char *buf) \
{ \
struct ath5k_softc *sc = dev_get_drvdata(dev); \
struct ieee80211_hw *hw = dev_get_drvdata(dev); \
struct ath5k_softc *sc = hw->priv; \
return snprintf(buf, PAGE_SIZE, "%d\n", get); \
} \
\
static ssize_t ath5k_attr_store_##name(struct device *dev, \
struct device_attribute *attr, \
const char *buf, size_t count) \
{ \
struct ath5k_softc *sc = dev_get_drvdata(dev); \
struct ieee80211_hw *hw = dev_get_drvdata(dev); \
struct ath5k_softc *sc = hw->priv; \
int val, ret; \
\
ret = kstrtoint(buf, 10, &val); \
Expand All @@ -35,7 +37,8 @@ static ssize_t ath5k_attr_show_##name(struct device *dev, \
struct device_attribute *attr, \
char *buf) \
{ \
struct ath5k_softc *sc = dev_get_drvdata(dev); \
struct ieee80211_hw *hw = dev_get_drvdata(dev); \
struct ath5k_softc *sc = hw->priv; \
return snprintf(buf, PAGE_SIZE, "%d\n", get); \
} \
static DEVICE_ATTR(name, S_IRUGO, ath5k_attr_show_##name, NULL)
Expand Down
6 changes: 6 additions & 0 deletions trunk/drivers/net/wireless/ath/ath9k/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,12 @@ static int ath_pci_suspend(struct device *device)

ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 1);

/* The device has to be moved to FULLSLEEP forcibly.
* Otherwise the chip never moved to full sleep,
* when no interface is up.
*/
ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_FULL_SLEEP);

return 0;
}

Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/net/wireless/ath/ath9k/xmit.c
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,8 @@ static int ath_compute_num_delims(struct ath_softc *sc, struct ath_atx_tid *tid,
* TODO - this could be improved to be dependent on the rate.
* The hardware can keep up at lower rates, but not higher rates
*/
if (fi->keyix != ATH9K_TXKEYIX_INVALID)
if ((fi->keyix != ATH9K_TXKEYIX_INVALID) &&
!(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA))
ndelim += ATH_AGGR_ENCRYPTDELIM;

/*
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/net/wireless/ath/carl9170/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ static struct usb_device_id carl9170_usb_ids[] = {
{ USB_DEVICE(0x04bb, 0x093f) },
/* NEC WL300NU-G */
{ USB_DEVICE(0x0409, 0x0249) },
/* NEC WL300NU-AG */
{ USB_DEVICE(0x0409, 0x02b4) },
/* AVM FRITZ!WLAN USB Stick N */
{ USB_DEVICE(0x057c, 0x8401) },
/* AVM FRITZ!WLAN USB Stick N 2.4 */
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ static struct usb_device_id rtl8192c_usb_ids[] = {
{RTL_USB_DEVICE(0x06f8, 0xe033, rtl92cu_hal_cfg)}, /*Hercules - Edimax*/
{RTL_USB_DEVICE(0x07b8, 0x8188, rtl92cu_hal_cfg)}, /*Abocom - Abocom*/
{RTL_USB_DEVICE(0x07b8, 0x8189, rtl92cu_hal_cfg)}, /*Funai - Abocom*/
{RTL_USB_DEVICE(0x0846, 0x9041, rtl92cu_hal_cfg)}, /*NetGear WNA1000M*/
{RTL_USB_DEVICE(0x0Df6, 0x0052, rtl92cu_hal_cfg)}, /*Sitecom - Edimax*/
{RTL_USB_DEVICE(0x0eb0, 0x9071, rtl92cu_hal_cfg)}, /*NO Brand - Etop*/
/* HP - Lite-On ,8188CUS Slim Combo */
Expand Down
18 changes: 9 additions & 9 deletions trunk/drivers/ssb/driver_pcicore.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,17 @@ static void ssb_pcicore_pcie_setup_workarounds(struct ssb_pcicore *pc)

static void __devinit ssb_pcicore_init_clientmode(struct ssb_pcicore *pc)
{
ssb_pcicore_fix_sprom_core_index(pc);

/* Disable PCI interrupts. */
ssb_write32(pc->dev, SSB_INTVEC, 0);

/* Additional PCIe always once-executed workarounds */
if (pc->dev->id.coreid == SSB_DEV_PCIE) {
ssb_pcicore_serdes_workaround(pc);
/* TODO: ASPM */
/* TODO: Clock Request Update */
}
}

void __devinit ssb_pcicore_init(struct ssb_pcicore *pc)
Expand All @@ -529,22 +538,13 @@ void __devinit ssb_pcicore_init(struct ssb_pcicore *pc)
if (!ssb_device_is_enabled(dev))
ssb_device_enable(dev, 0);

ssb_pcicore_fix_sprom_core_index(pc);

#ifdef CONFIG_SSB_PCICORE_HOSTMODE
pc->hostmode = pcicore_is_in_hostmode(pc);
if (pc->hostmode)
ssb_pcicore_init_hostmode(pc);
#endif /* CONFIG_SSB_PCICORE_HOSTMODE */
if (!pc->hostmode)
ssb_pcicore_init_clientmode(pc);

/* Additional PCIe always once-executed workarounds */
if (dev->id.coreid == SSB_DEV_PCIE) {
ssb_pcicore_serdes_workaround(pc);
/* TODO: ASPM */
/* TODO: Clock Request Update */
}
}

static u32 ssb_pcie_read(struct ssb_pcicore *pc, u32 address)
Expand Down
3 changes: 3 additions & 0 deletions trunk/net/bluetooth/hci_conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,9 @@ int hci_conn_del(struct hci_conn *conn)

hci_dev_put(hdev);

if (conn->handle == 0)
kfree(conn);

return 0;
}

Expand Down
18 changes: 11 additions & 7 deletions trunk/net/bluetooth/hidp/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,8 @@ static void hidp_idle_timeout(unsigned long arg)
{
struct hidp_session *session = (struct hidp_session *) arg;

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

static void hidp_set_timer(struct hidp_session *session)
Expand Down Expand Up @@ -535,7 +536,8 @@ static void hidp_process_hid_control(struct hidp_session *session,
skb_queue_purge(&session->ctrl_transmit);
skb_queue_purge(&session->intr_transmit);

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

Expand Down Expand Up @@ -706,9 +708,8 @@ static int hidp_session(void *arg)
add_wait_queue(sk_sleep(intr_sk), &intr_wait);
session->waiting_for_startup = 0;
wake_up_interruptible(&session->startup_queue);
while (!kthread_should_stop()) {
set_current_state(TASK_INTERRUPTIBLE);

set_current_state(TASK_INTERRUPTIBLE);
while (!atomic_read(&session->terminate)) {
if (ctrl_sk->sk_state != BT_CONNECTED ||
intr_sk->sk_state != BT_CONNECTED)
break;
Expand All @@ -726,6 +727,7 @@ static int hidp_session(void *arg)
hidp_process_transmit(session);

schedule();
set_current_state(TASK_INTERRUPTIBLE);
}
set_current_state(TASK_RUNNING);
remove_wait_queue(sk_sleep(intr_sk), &intr_wait);
Expand Down Expand Up @@ -1060,7 +1062,8 @@ int hidp_add_connection(struct hidp_connadd_req *req, struct socket *ctrl_sock,
err_add_device:
hid_destroy_device(session->hid);
session->hid = NULL;
kthread_stop(session->task);
atomic_inc(&session->terminate);
wake_up_process(session->task);

unlink:
hidp_del_timer(session);
Expand Down Expand Up @@ -1111,7 +1114,8 @@ int hidp_del_connection(struct hidp_conndel_req *req)
skb_queue_purge(&session->ctrl_transmit);
skb_queue_purge(&session->intr_transmit);

kthread_stop(session->task);
atomic_inc(&session->terminate);
wake_up_process(session->task);
}
} else
err = -ENOENT;
Expand Down
1 change: 1 addition & 0 deletions trunk/net/bluetooth/hidp/hidp.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ struct hidp_session {
uint ctrl_mtu;
uint intr_mtu;

atomic_t terminate;
struct task_struct *task;

unsigned char keys[8];
Expand Down
5 changes: 3 additions & 2 deletions trunk/net/bluetooth/l2cap_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2530,7 +2530,8 @@ static inline int l2cap_config_req(struct l2cap_conn *conn, struct l2cap_cmd_hdr

sk = chan->sk;

if (chan->state != BT_CONFIG) {
if ((bt_sk(sk)->defer_setup && chan->state != BT_CONNECT2) ||
(!bt_sk(sk)->defer_setup && chan->state != BT_CONFIG)) {
struct l2cap_cmd_rej rej;

rej.reason = cpu_to_le16(0x0002);
Expand All @@ -2541,7 +2542,7 @@ static inline int l2cap_config_req(struct l2cap_conn *conn, struct l2cap_cmd_hdr

/* Reject if config buffer is too small. */
len = cmd_len - sizeof(*req);
if (chan->conf_len + len > sizeof(chan->conf_req)) {
if (len < 0 || chan->conf_len + len > sizeof(chan->conf_req)) {
l2cap_send_cmd(conn, cmd->ident, L2CAP_CONF_RSP,
l2cap_build_conf_rsp(chan, rsp,
L2CAP_CONF_REJECT, flags), rsp);
Expand Down
3 changes: 2 additions & 1 deletion trunk/net/mac80211/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,8 @@ int ieee80211_request_sched_scan_start(struct ieee80211_sub_if_data *sdata,
for (i = 0; i < IEEE80211_NUM_BANDS; i++) {
local->sched_scan_ies.ie[i] = kzalloc(2 +
IEEE80211_MAX_SSID_LEN +
local->scan_ies_len,
local->scan_ies_len +
req->ie_len,
GFP_KERNEL);
if (!local->sched_scan_ies.ie[i]) {
ret = -ENOMEM;
Expand Down
12 changes: 9 additions & 3 deletions trunk/net/wireless/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ struct wiphy *wiphy_new(const struct cfg80211_ops *ops, int sizeof_priv)

mutex_init(&rdev->mtx);
mutex_init(&rdev->devlist_mtx);
mutex_init(&rdev->sched_scan_mtx);
INIT_LIST_HEAD(&rdev->netdev_list);
spin_lock_init(&rdev->bss_lock);
INIT_LIST_HEAD(&rdev->bss_list);
Expand Down Expand Up @@ -701,6 +702,7 @@ void cfg80211_dev_free(struct cfg80211_registered_device *rdev)
rfkill_destroy(rdev->rfkill);
mutex_destroy(&rdev->mtx);
mutex_destroy(&rdev->devlist_mtx);
mutex_destroy(&rdev->sched_scan_mtx);
list_for_each_entry_safe(scan, tmp, &rdev->bss_list, list)
cfg80211_put_bss(&scan->pub);
cfg80211_rdev_free_wowlan(rdev);
Expand Down Expand Up @@ -737,12 +739,16 @@ static void wdev_cleanup_work(struct work_struct *work)
___cfg80211_scan_done(rdev, true);
}

cfg80211_unlock_rdev(rdev);

mutex_lock(&rdev->sched_scan_mtx);

if (WARN_ON(rdev->sched_scan_req &&
rdev->sched_scan_req->dev == wdev->netdev)) {
__cfg80211_stop_sched_scan(rdev, false);
}

cfg80211_unlock_rdev(rdev);
mutex_unlock(&rdev->sched_scan_mtx);

mutex_lock(&rdev->devlist_mtx);
rdev->opencount--;
Expand Down Expand Up @@ -830,9 +836,9 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb,
break;
case NL80211_IFTYPE_P2P_CLIENT:
case NL80211_IFTYPE_STATION:
cfg80211_lock_rdev(rdev);
mutex_lock(&rdev->sched_scan_mtx);
__cfg80211_stop_sched_scan(rdev, false);
cfg80211_unlock_rdev(rdev);
mutex_unlock(&rdev->sched_scan_mtx);

wdev_lock(wdev);
#ifdef CONFIG_CFG80211_WEXT
Expand Down
2 changes: 2 additions & 0 deletions trunk/net/wireless/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ struct cfg80211_registered_device {
struct work_struct scan_done_wk;
struct work_struct sched_scan_results_wk;

struct mutex sched_scan_mtx;

#ifdef CONFIG_NL80211_TESTMODE
struct genl_info *testmode_info;
#endif
Expand Down
24 changes: 18 additions & 6 deletions trunk/net/wireless/nl80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -3470,9 +3470,6 @@ static int nl80211_start_sched_scan(struct sk_buff *skb,
if (!is_valid_ie_attr(info->attrs[NL80211_ATTR_IE]))
return -EINVAL;

if (rdev->sched_scan_req)
return -EINPROGRESS;

if (!info->attrs[NL80211_ATTR_SCHED_SCAN_INTERVAL])
return -EINVAL;

Expand Down Expand Up @@ -3511,12 +3508,21 @@ static int nl80211_start_sched_scan(struct sk_buff *skb,
if (ie_len > wiphy->max_scan_ie_len)
return -EINVAL;

mutex_lock(&rdev->sched_scan_mtx);

if (rdev->sched_scan_req) {
err = -EINPROGRESS;
goto out;
}

request = kzalloc(sizeof(*request)
+ sizeof(*request->ssids) * n_ssids
+ sizeof(*request->channels) * n_channels
+ ie_len, GFP_KERNEL);
if (!request)
return -ENOMEM;
if (!request) {
err = -ENOMEM;
goto out;
}

if (n_ssids)
request->ssids = (void *)&request->channels[n_channels];
Expand Down Expand Up @@ -3614,19 +3620,25 @@ static int nl80211_start_sched_scan(struct sk_buff *skb,
out_free:
kfree(request);
out:
mutex_unlock(&rdev->sched_scan_mtx);
return err;
}

static int nl80211_stop_sched_scan(struct sk_buff *skb,
struct genl_info *info)
{
struct cfg80211_registered_device *rdev = info->user_ptr[0];
int err;

if (!(rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_SCHED_SCAN) ||
!rdev->ops->sched_scan_stop)
return -EOPNOTSUPP;

return __cfg80211_stop_sched_scan(rdev, false);
mutex_lock(&rdev->sched_scan_mtx);
err = __cfg80211_stop_sched_scan(rdev, false);
mutex_unlock(&rdev->sched_scan_mtx);

return err;
}

static int nl80211_send_bss(struct sk_buff *msg, struct netlink_callback *cb,
Expand Down
Loading

0 comments on commit 2bdbc85

Please sign in to comment.