Skip to content

Commit

Permalink
ath6kl: document all spinlocks
Browse files Browse the repository at this point in the history
Also fixes quite a few checkpatch warnings like this:

ath6kl/hif.h:226: CHECK: spinlock_t definition without comment

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
  • Loading branch information
Kalle Valo committed Mar 7, 2012
1 parent 8c9bb05 commit 12eb944
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 0 deletions.
21 changes: 21 additions & 0 deletions drivers/net/wireless/ath/ath6kl/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,12 @@ struct rxtid {
u32 hold_q_sz;
struct skb_hold_q *hold_q;
struct sk_buff_head q;

/*
* FIXME: No clue what this should protect. Apparently it should
* protect some of the fields above but they are also accessed
* without taking the lock.
*/
spinlock_t lock;
};

Expand Down Expand Up @@ -311,7 +317,10 @@ struct ath6kl_sta {
u8 auth;
u8 wpa_ie[ATH6KL_MAX_IE];
struct sk_buff_head psq;

/* protects psq, mgmt_psq, apsdq, and mgmt_psq_len fields */
spinlock_t psq_lock;

struct list_head mgmt_psq;
size_t mgmt_psq_len;
u8 apsd_info;
Expand Down Expand Up @@ -572,7 +581,13 @@ struct ath6kl {
unsigned int vif_max;
u8 max_norm_iface;
u8 avail_idx_map;

/*
* Protects at least amsdu_rx_buffer_queue, ath6kl_alloc_cookie()
* calls, tx_pending and total_tx_data_pend.
*/
spinlock_t lock;

struct semaphore sem;
u8 lrssi_roam_threshold;
struct ath6kl_version version;
Expand All @@ -599,7 +614,13 @@ struct ath6kl {
u8 sta_list_index;
struct ath6kl_req_key ap_mode_bkey;
struct sk_buff_head mcastpsq;

/*
* FIXME: protects access to mcastpsq but is actually useless as
* all skbe_queue_*() functions provide serialisation themselves
*/
spinlock_t mcastpsq_lock;

u8 intra_bss;
struct wmi_ap_mode_stat ap_stats;
u8 ap_country_code[3];
Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/ath/ath6kl/hif.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ struct ath6kl_irq_enable_reg {
} __packed;

struct ath6kl_device {
/* protects irq_proc_reg and irq_en_reg below */
spinlock_t lock;
struct ath6kl_irq_proc_registers irq_proc_reg;
struct ath6kl_irq_enable_reg irq_en_reg;
Expand Down
7 changes: 7 additions & 0 deletions drivers/net/wireless/ath/ath6kl/htc.h
Original file line number Diff line number Diff line change
Expand Up @@ -523,9 +523,16 @@ struct htc_target {
struct ath6kl_htc_credit_info *credit_info;
int tgt_creds;
unsigned int tgt_cred_sz;

/* protects free_ctrl_txbuf and free_ctrl_rxbuf */
spinlock_t htc_lock;

/* FIXME: does this protext rx_bufq and endpoint structures or what? */
spinlock_t rx_lock;

/* protects endpoint->txq */
spinlock_t tx_lock;

struct ath6kl_device *dev;
u32 htc_flags;
u32 rx_st_flags;
Expand Down
5 changes: 5 additions & 0 deletions drivers/net/wireless/ath/ath6kl/sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
struct ath6kl_sdio {
struct sdio_func *func;

/* protects access to bus_req_freeq */
spinlock_t lock;

/* free list */
Expand All @@ -53,13 +54,17 @@ struct ath6kl_sdio {
atomic_t irq_handling;
wait_queue_head_t irq_wq;

/* protects access to scat_req */
spinlock_t scat_lock;

bool scatter_enabled;

bool is_disabled;
const struct sdio_device_id *id;
struct work_struct wr_async_work;
struct list_head wr_asyncq;

/* protects access to wr_asyncq */
spinlock_t wr_async_lock;
};

Expand Down
2 changes: 2 additions & 0 deletions drivers/net/wireless/ath/ath6kl/wmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ struct wmi {
u8 fat_pipe_exist;
struct ath6kl *parent_dev;
u8 pwr_mode;

/* protects fat_pipe_exist and stream_exist_for_ac */
spinlock_t lock;
enum htc_endpoint_id ep_id;
struct sq_threshold_params
Expand Down

0 comments on commit 12eb944

Please sign in to comment.