Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 290268
b: refs/heads/master
c: 45eaa78
h: refs/heads/master
v: v3
  • Loading branch information
Kalle Valo committed Jan 18, 2012
1 parent 1e92ec4 commit 739a934
Show file tree
Hide file tree
Showing 9 changed files with 333 additions and 289 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: f29af97853599e9537191c4f33f8ac87f3f503a9
refs/heads/master: 45eaa78f757b3b3992ca02c753764665e9fba0a4
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/ath/ath6kl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@ ath6kl-y += init.o
ath6kl-y += main.o
ath6kl-y += txrx.o
ath6kl-y += wmi.o
ath6kl-y += core.o
ath6kl-y += sdio.o
ath6kl-$(CONFIG_NL80211_TESTMODE) += testmode.o
94 changes: 24 additions & 70 deletions trunk/drivers/net/wireless/ath/ath6kl/cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@
#include "hif-ops.h"
#include "testmode.h"

static unsigned int ath6kl_p2p;

module_param(ath6kl_p2p, uint, 0644);

#define RATETAB_ENT(_rate, _rateid, _flags) { \
.bitrate = (_rate), \
.flags = (_flags), \
Expand Down Expand Up @@ -2693,68 +2689,6 @@ void ath6kl_cfg80211_stop_all(struct ath6kl *ar)
ath6kl_cfg80211_stop(vif);
}

struct ath6kl *ath6kl_core_alloc(struct device *dev)
{
struct ath6kl *ar;
struct wiphy *wiphy;
u8 ctr;

/* create a new wiphy for use with cfg80211 */
wiphy = wiphy_new(&ath6kl_cfg80211_ops, sizeof(struct ath6kl));

if (!wiphy) {
ath6kl_err("couldn't allocate wiphy device\n");
return NULL;
}

ar = wiphy_priv(wiphy);
ar->p2p = !!ath6kl_p2p;
ar->wiphy = wiphy;
ar->dev = dev;

ar->vif_max = 1;

ar->max_norm_iface = 1;

spin_lock_init(&ar->lock);
spin_lock_init(&ar->mcastpsq_lock);
spin_lock_init(&ar->list_lock);

init_waitqueue_head(&ar->event_wq);
sema_init(&ar->sem, 1);

INIT_LIST_HEAD(&ar->amsdu_rx_buffer_queue);
INIT_LIST_HEAD(&ar->vif_list);

clear_bit(WMI_ENABLED, &ar->flag);
clear_bit(SKIP_SCAN, &ar->flag);
clear_bit(DESTROY_IN_PROGRESS, &ar->flag);

ar->listen_intvl_b = A_DEFAULT_LISTEN_INTERVAL;
ar->tx_pwr = 0;

ar->intra_bss = 1;
ar->lrssi_roam_threshold = DEF_LRSSI_ROAM_THRESHOLD;

ar->state = ATH6KL_STATE_OFF;

memset((u8 *)ar->sta_list, 0,
AP_MAX_NUM_STA * sizeof(struct ath6kl_sta));

/* Init the PS queues */
for (ctr = 0; ctr < AP_MAX_NUM_STA; ctr++) {
spin_lock_init(&ar->sta_list[ctr].psq_lock);
skb_queue_head_init(&ar->sta_list[ctr].psq);
skb_queue_head_init(&ar->sta_list[ctr].apsdq);
}

skb_queue_head_init(&ar->mcastpsq);

memcpy(ar->ap_country_code, DEF_AP_COUNTRY_CODE, 3);

return ar;
}

static int ath6kl_cfg80211_vif_init(struct ath6kl_vif *vif)
{
vif->aggr_cntxt = aggr_init(vif->ndev);
Expand Down Expand Up @@ -2910,10 +2844,30 @@ int ath6kl_cfg80211_init(struct ath6kl *ar)
void ath6kl_cfg80211_cleanup(struct ath6kl *ar)
{
wiphy_unregister(ar->wiphy);
}

/*
* FIXME: should be removed as we remove wiphy in
* ath6kl_core_free(). Most likely this causes a use after free.
*/
struct ath6kl *ath6kl_cfg80211_create(void)
{
struct ath6kl *ar;
struct wiphy *wiphy;

/* create a new wiphy for use with cfg80211 */
wiphy = wiphy_new(&ath6kl_cfg80211_ops, sizeof(struct ath6kl));

if (!wiphy) {
ath6kl_err("couldn't allocate wiphy device\n");
return NULL;
}

ar = wiphy_priv(wiphy);
ar->wiphy = wiphy;

return ar;
}

/* Note: ar variable must not be accessed after calling this! */
void ath6kl_cfg80211_destroy(struct ath6kl *ar)
{
wiphy_free(ar->wiphy);
}

4 changes: 3 additions & 1 deletion trunk/drivers/net/wireless/ath/ath6kl/cfg80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ enum ath6kl_cfg_suspend_mode {
struct net_device *ath6kl_interface_add(struct ath6kl *ar, char *name,
enum nl80211_iftype type,
u8 fw_vif_idx, u8 nw_type);
struct ath6kl *ath6kl_core_alloc(struct device *dev);
void ath6kl_cfg80211_scan_complete_event(struct ath6kl_vif *vif, bool aborted);

void ath6kl_cfg80211_connect_event(struct ath6kl_vif *vif, u16 channel,
Expand Down Expand Up @@ -58,4 +57,7 @@ void ath6kl_cfg80211_stop_all(struct ath6kl *ar);
int ath6kl_cfg80211_init(struct ath6kl *ar);
void ath6kl_cfg80211_cleanup(struct ath6kl *ar);

struct ath6kl *ath6kl_cfg80211_create(void);
void ath6kl_cfg80211_destroy(struct ath6kl *ar);

#endif /* ATH6KL_CFG80211_H */
3 changes: 0 additions & 3 deletions trunk/drivers/net/wireless/ath/ath6kl/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,5 @@ struct ath6kl;
enum htc_credit_dist_reason;
struct ath6kl_htc_credit_info;

struct ath6kl *ath6kl_core_alloc(struct device *sdev);
int ath6kl_core_init(struct ath6kl *ar);
void ath6kl_core_cleanup(struct ath6kl *ar);
struct sk_buff *ath6kl_buf_alloc(int size);
#endif /* COMMON_H */
Loading

0 comments on commit 739a934

Please sign in to comment.