* [PATCH 00/12] ath6kl: checkpatch fixes
@ 2012-02-29 17:18 Kalle Valo
2012-02-29 17:18 ` [PATCH 01/12] ath6kl: fix pointer style Kalle Valo
` (13 more replies)
0 siblings, 14 replies; 22+ messages in thread
From: Kalle Valo @ 2012-02-29 17:18 UTC (permalink / raw)
To: kvalo; +Cc: ath6kl-devel, linux-wireless
Here are quite a few checkpatch fixes and other cleanups.
Especially I would like to people review these two macros, they ended up
a bit too clever and I'm sure there are issues:
#define ath6kl_bmi_write_hi32(ar, item, val) \
({ \
u32 addr; \
__le32 v; \
\
addr = ath6kl_get_hi_item_addr(ar, HI_ITEM(item)); \
v = cpu_to_le32(val); \
ath6kl_bmi_write(ar, addr, (u8 *) &v, sizeof(v)); \
})
#define ath6kl_bmi_read_hi32(ar, item, val) \
({ \
u32 addr, *check_type = val; \
__le32 tmp; \
int ret; \
\
(void) (check_type == val); \
addr = ath6kl_get_hi_item_addr(ar, HI_ITEM(item)); \
ret = ath6kl_bmi_read(ar, addr, (u8 *) &tmp, 4); \
*val = le32_to_cpu(tmp); \
ret; \
})
---
Kalle Valo (12):
ath6kl: fix pointer style
ath6kl: fix checkpatch error with EPSTAT() macro
ath6kl: alignment should match open parenthesis
ath6kl: logical continuations should be on the previous line
ath6kl: remove multiple assignments
ath6kl: add ath6kl_bmi_write_hi32()
ath6kl: add ath6kl_bmi_read_hi32()
ath6kl: fix error handling ath6kl_target_config_wlan_params()
ath6kl: fix open paranthesis alignment in ath6kl_cfg80211_connect()
ath6kl: document all spinlocks
ath6kl: fix too long lines
ath6kl: make ath6kl_bmi_[read|write]_hi32() endian safe
drivers/net/wireless/ath/ath6kl/bmi.c | 6 -
drivers/net/wireless/ath/ath6kl/bmi.h | 23 +++
drivers/net/wireless/ath/ath6kl/cfg80211.c | 46 ++++--
drivers/net/wireless/ath/ath6kl/core.c | 6 -
drivers/net/wireless/ath/ath6kl/core.h | 25 +++
drivers/net/wireless/ath/ath6kl/debug.c | 58 ++++----
drivers/net/wireless/ath/ath6kl/hif.c | 6 -
drivers/net/wireless/ath/ath6kl/hif.h | 1
drivers/net/wireless/ath/ath6kl/htc.c | 105 +++++++-------
drivers/net/wireless/ath/ath6kl/htc.h | 7 +
drivers/net/wireless/ath/ath6kl/init.c | 203 ++++++++++------------------
drivers/net/wireless/ath/ath6kl/main.c | 22 ++-
drivers/net/wireless/ath/ath6kl/sdio.c | 11 +-
drivers/net/wireless/ath/ath6kl/txrx.c | 18 +-
drivers/net/wireless/ath/ath6kl/wmi.c | 31 ++--
drivers/net/wireless/ath/ath6kl/wmi.h | 6 +
16 files changed, 295 insertions(+), 279 deletions(-)
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 01/12] ath6kl: fix pointer style
2012-02-29 17:18 [PATCH 00/12] ath6kl: checkpatch fixes Kalle Valo
@ 2012-02-29 17:18 ` Kalle Valo
2012-02-29 17:18 ` [PATCH 02/12] ath6kl: fix checkpatch error with EPSTAT() macro Kalle Valo
` (12 subsequent siblings)
13 siblings, 0 replies; 22+ messages in thread
From: Kalle Valo @ 2012-02-29 17:18 UTC (permalink / raw)
To: kvalo; +Cc: ath6kl-devel, linux-wireless
reported by checkpatch:
ath6kl/core.h:748: ERROR: "foo * bar" should be "foo *bar"
ath6kl/core.h:751: ERROR: "foo * bar" should be "foo *bar"
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/core.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/core.h b/drivers/net/wireless/ath/ath6kl/core.h
index 5bbc595..d80b421 100644
--- a/drivers/net/wireless/ath/ath6kl/core.h
+++ b/drivers/net/wireless/ath/ath6kl/core.h
@@ -745,10 +745,10 @@ struct htc_packet *ath6kl_alloc_amsdu_rxbuf(struct htc_target *target,
void aggr_module_destroy(struct aggr_info *aggr_info);
void aggr_reset_state(struct aggr_info_conn *aggr_conn);
-struct ath6kl_sta *ath6kl_find_sta(struct ath6kl_vif *vif, u8 * node_addr);
+struct ath6kl_sta *ath6kl_find_sta(struct ath6kl_vif *vif, u8 *node_addr);
struct ath6kl_sta *ath6kl_find_sta_by_aid(struct ath6kl *ar, u8 aid);
-void ath6kl_ready_event(void *devt, u8 * datap, u32 sw_ver, u32 abi_ver);
+void ath6kl_ready_event(void *devt, u8 *datap, u32 sw_ver, u32 abi_ver);
int ath6kl_control_tx(void *devt, struct sk_buff *skb,
enum htc_endpoint_id eid);
void ath6kl_connect_event(struct ath6kl_vif *vif, u16 channel,
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 02/12] ath6kl: fix checkpatch error with EPSTAT() macro
2012-02-29 17:18 [PATCH 00/12] ath6kl: checkpatch fixes Kalle Valo
2012-02-29 17:18 ` [PATCH 01/12] ath6kl: fix pointer style Kalle Valo
@ 2012-02-29 17:18 ` Kalle Valo
2012-02-29 17:18 ` [PATCH 03/12] ath6kl: alignment should match open parenthesis Kalle Valo
` (11 subsequent siblings)
13 siblings, 0 replies; 22+ messages in thread
From: Kalle Valo @ 2012-02-29 17:18 UTC (permalink / raw)
To: kvalo; +Cc: ath6kl-devel, linux-wireless
ath6kl/debug.c:739: ERROR: Macros with complex values should be
enclosed in parenthesis
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/debug.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/debug.c b/drivers/net/wireless/ath/ath6kl/debug.c
index 3d0713d..ff4c614 100644
--- a/drivers/net/wireless/ath/ath6kl/debug.c
+++ b/drivers/net/wireless/ath/ath6kl/debug.c
@@ -737,9 +737,13 @@ static ssize_t ath6kl_endpoint_stats_read(struct file *file,
return -ENOMEM;
#define EPSTAT(name) \
- len = print_endpoint_stat(target, buf, buf_len, len, \
- offsetof(struct htc_endpoint_stats, name), \
- #name)
+ do { \
+ len = print_endpoint_stat(target, buf, buf_len, len, \
+ offsetof(struct htc_endpoint_stats, \
+ name), \
+ #name); \
+ } while (0)
+
EPSTAT(cred_low_indicate);
EPSTAT(tx_issued);
EPSTAT(tx_pkt_bundled);
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 03/12] ath6kl: alignment should match open parenthesis
2012-02-29 17:18 [PATCH 00/12] ath6kl: checkpatch fixes Kalle Valo
2012-02-29 17:18 ` [PATCH 01/12] ath6kl: fix pointer style Kalle Valo
2012-02-29 17:18 ` [PATCH 02/12] ath6kl: fix checkpatch error with EPSTAT() macro Kalle Valo
@ 2012-02-29 17:18 ` Kalle Valo
2012-03-07 19:26 ` Joe Perches
2012-02-29 17:19 ` [PATCH 04/12] ath6kl: logical continuations should be on the previous line Kalle Valo
` (10 subsequent siblings)
13 siblings, 1 reply; 22+ messages in thread
From: Kalle Valo @ 2012-02-29 17:18 UTC (permalink / raw)
To: kvalo; +Cc: ath6kl-devel, linux-wireless
Fix the issues which checkpatch found and were easy to fix. Especially
callers of ath6kl_bmi_write() are tricky and that needs to be fixed
separately.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/bmi.c | 6 +--
drivers/net/wireless/ath/ath6kl/cfg80211.c | 18 ++++----
drivers/net/wireless/ath/ath6kl/core.c | 6 +--
drivers/net/wireless/ath/ath6kl/debug.c | 48 +++++++++++-----------
drivers/net/wireless/ath/ath6kl/hif.c | 6 +--
drivers/net/wireless/ath/ath6kl/htc.c | 62 ++++++++++++++--------------
drivers/net/wireless/ath/ath6kl/init.c | 20 +++++----
drivers/net/wireless/ath/ath6kl/main.c | 18 ++++----
drivers/net/wireless/ath/ath6kl/sdio.c | 6 +--
drivers/net/wireless/ath/ath6kl/txrx.c | 18 ++++----
drivers/net/wireless/ath/ath6kl/wmi.c | 22 +++++-----
11 files changed, 115 insertions(+), 115 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/bmi.c b/drivers/net/wireless/ath/ath6kl/bmi.c
index 05d1d89..334dbd8 100644
--- a/drivers/net/wireless/ath/ath6kl/bmi.c
+++ b/drivers/net/wireless/ath/ath6kl/bmi.c
@@ -106,7 +106,7 @@ int ath6kl_bmi_get_target_info(struct ath6kl *ar,
}
ath6kl_dbg(ATH6KL_DBG_BMI, "target info (ver: 0x%x type: 0x%x)\n",
- targ_info->version, targ_info->type);
+ targ_info->version, targ_info->type);
return 0;
}
@@ -193,7 +193,7 @@ int ath6kl_bmi_write(struct ath6kl *ar, u32 addr, u8 *buf, u32 len)
memset(ar->bmi.cmd_buf, 0, ar->bmi.max_data_size + header);
ath6kl_dbg(ATH6KL_DBG_BMI,
- "bmi write memory: addr: 0x%x, len: %d\n", addr, len);
+ "bmi write memory: addr: 0x%x, len: %d\n", addr, len);
len_remain = len;
while (len_remain) {
@@ -435,7 +435,7 @@ int ath6kl_bmi_lz_data(struct ath6kl *ar, u8 *buf, u32 len)
memcpy(&(ar->bmi.cmd_buf[offset]), &tx_len, sizeof(tx_len));
offset += sizeof(tx_len);
memcpy(&(ar->bmi.cmd_buf[offset]), &buf[len - len_remain],
- tx_len);
+ tx_len);
offset += tx_len;
ret = ath6kl_hif_bmi_write(ar, ar->bmi.cmd_buf, offset);
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 5da0f29..308cc9b 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -390,7 +390,7 @@ static bool ath6kl_is_valid_iftype(struct ath6kl *ar, enum nl80211_iftype type,
return false;
if (ar->ibss_if_active || ((type == NL80211_IFTYPE_ADHOC) &&
- ar->num_vif))
+ ar->num_vif))
return false;
if (type == NL80211_IFTYPE_STATION ||
@@ -555,7 +555,7 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
if (!ar->usr_bss_filter) {
clear_bit(CLEAR_BSSFILTER_ON_BEACON, &vif->flags);
if (ath6kl_wmi_bssfilter_cmd(ar->wmi, vif->fw_vif_idx,
- ALL_BSS_FILTER, 0) != 0) {
+ ALL_BSS_FILTER, 0) != 0) {
ath6kl_err("couldn't set bss filtering\n");
up(&ar->sem);
return -EIO;
@@ -833,13 +833,13 @@ void ath6kl_cfg80211_disconnect_event(struct ath6kl_vif *vif, u8 reason,
if (vif->sme_state == SME_CONNECTING) {
cfg80211_connect_result(vif->ndev,
- bssid, NULL, 0,
- NULL, 0,
- WLAN_STATUS_UNSPECIFIED_FAILURE,
- GFP_KERNEL);
+ bssid, NULL, 0,
+ NULL, 0,
+ WLAN_STATUS_UNSPECIFIED_FAILURE,
+ GFP_KERNEL);
} else if (vif->sme_state == SME_CONNECTED) {
cfg80211_disconnected(vif->ndev, reason,
- NULL, 0, GFP_KERNEL);
+ NULL, 0, GFP_KERNEL);
}
vif->sme_state = SME_DISCONNECTED;
@@ -926,7 +926,7 @@ static int ath6kl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
force_fg_scan = 1;
if (test_bit(ATH6KL_FW_CAPABILITY_STA_P2PDEV_DUPLEX,
- ar->fw_capabilities)) {
+ ar->fw_capabilities)) {
/*
* If capable of doing P2P mgmt operations using
* station interface, send additional information like
@@ -1361,7 +1361,7 @@ static int ath6kl_cfg80211_set_power_mgmt(struct wiphy *wiphy,
}
if (ath6kl_wmi_powermode_cmd(ar->wmi, vif->fw_vif_idx,
- mode.pwr_mode) != 0) {
+ mode.pwr_mode) != 0) {
ath6kl_err("wmi_powermode_cmd failed\n");
return -EIO;
}
diff --git a/drivers/net/wireless/ath/ath6kl/core.c b/drivers/net/wireless/ath/ath6kl/core.c
index 3968465..3a67a52 100644
--- a/drivers/net/wireless/ath/ath6kl/core.c
+++ b/drivers/net/wireless/ath/ath6kl/core.c
@@ -128,7 +128,7 @@ int ath6kl_core_init(struct ath6kl *ar)
ath6kl_dbg(ATH6KL_DBG_TRC, "%s: name=%s dev=0x%p, ar=0x%p\n",
- __func__, ndev->name, ndev, ar);
+ __func__, ndev->name, ndev, ar);
/* setup access class priority mappings */
ar->ac_stream_pri_map[WMM_AC_BK] = 0; /* lowest */
@@ -145,8 +145,8 @@ int ath6kl_core_init(struct ath6kl *ar)
ATH6KL_CONF_ENABLE_11N | ATH6KL_CONF_ENABLE_TX_BURST;
if (suspend_mode &&
- suspend_mode >= WLAN_POWER_STATE_CUT_PWR &&
- suspend_mode <= WLAN_POWER_STATE_WOW)
+ suspend_mode >= WLAN_POWER_STATE_CUT_PWR &&
+ suspend_mode <= WLAN_POWER_STATE_WOW)
ar->suspend_mode = suspend_mode;
else
ar->suspend_mode = 0;
diff --git a/drivers/net/wireless/ath/ath6kl/debug.c b/drivers/net/wireless/ath/ath6kl/debug.c
index ff4c614..ba07452 100644
--- a/drivers/net/wireless/ath/ath6kl/debug.c
+++ b/drivers/net/wireless/ath/ath6kl/debug.c
@@ -119,29 +119,29 @@ void ath6kl_dump_registers(struct ath6kl_device *dev,
if (irq_proc_reg != NULL) {
ath6kl_dbg(ATH6KL_DBG_IRQ,
- "Host Int status: 0x%x\n",
- irq_proc_reg->host_int_status);
+ "Host Int status: 0x%x\n",
+ irq_proc_reg->host_int_status);
ath6kl_dbg(ATH6KL_DBG_IRQ,
"CPU Int status: 0x%x\n",
- irq_proc_reg->cpu_int_status);
+ irq_proc_reg->cpu_int_status);
ath6kl_dbg(ATH6KL_DBG_IRQ,
"Error Int status: 0x%x\n",
- irq_proc_reg->error_int_status);
+ irq_proc_reg->error_int_status);
ath6kl_dbg(ATH6KL_DBG_IRQ,
"Counter Int status: 0x%x\n",
- irq_proc_reg->counter_int_status);
+ irq_proc_reg->counter_int_status);
ath6kl_dbg(ATH6KL_DBG_IRQ,
"Mbox Frame: 0x%x\n",
- irq_proc_reg->mbox_frame);
+ irq_proc_reg->mbox_frame);
ath6kl_dbg(ATH6KL_DBG_IRQ,
"Rx Lookahead Valid: 0x%x\n",
- irq_proc_reg->rx_lkahd_valid);
+ irq_proc_reg->rx_lkahd_valid);
ath6kl_dbg(ATH6KL_DBG_IRQ,
"Rx Lookahead 0: 0x%x\n",
- irq_proc_reg->rx_lkahd[0]);
+ irq_proc_reg->rx_lkahd[0]);
ath6kl_dbg(ATH6KL_DBG_IRQ,
"Rx Lookahead 1: 0x%x\n",
- irq_proc_reg->rx_lkahd[1]);
+ irq_proc_reg->rx_lkahd[1]);
if (dev->ar->mbox_info.gmbox_addr != 0) {
/*
@@ -149,27 +149,27 @@ void ath6kl_dump_registers(struct ath6kl_device *dev,
* additional state.
*/
ath6kl_dbg(ATH6KL_DBG_IRQ,
- "GMBOX Host Int status 2: 0x%x\n",
- irq_proc_reg->host_int_status2);
+ "GMBOX Host Int status 2: 0x%x\n",
+ irq_proc_reg->host_int_status2);
ath6kl_dbg(ATH6KL_DBG_IRQ,
- "GMBOX RX Avail: 0x%x\n",
- irq_proc_reg->gmbox_rx_avail);
+ "GMBOX RX Avail: 0x%x\n",
+ irq_proc_reg->gmbox_rx_avail);
ath6kl_dbg(ATH6KL_DBG_IRQ,
- "GMBOX lookahead alias 0: 0x%x\n",
- irq_proc_reg->rx_gmbox_lkahd_alias[0]);
+ "GMBOX lookahead alias 0: 0x%x\n",
+ irq_proc_reg->rx_gmbox_lkahd_alias[0]);
ath6kl_dbg(ATH6KL_DBG_IRQ,
- "GMBOX lookahead alias 1: 0x%x\n",
- irq_proc_reg->rx_gmbox_lkahd_alias[1]);
+ "GMBOX lookahead alias 1: 0x%x\n",
+ irq_proc_reg->rx_gmbox_lkahd_alias[1]);
}
}
if (irq_enable_reg != NULL) {
ath6kl_dbg(ATH6KL_DBG_IRQ,
- "Int status Enable: 0x%x\n",
- irq_enable_reg->int_status_en);
+ "Int status Enable: 0x%x\n",
+ irq_enable_reg->int_status_en);
ath6kl_dbg(ATH6KL_DBG_IRQ, "Counter Int status Enable: 0x%x\n",
- irq_enable_reg->cntr_int_status_en);
+ irq_enable_reg->cntr_int_status_en);
}
ath6kl_dbg(ATH6KL_DBG_IRQ, "<------------------------------->\n");
}
@@ -1788,19 +1788,19 @@ int ath6kl_debug_init(struct ath6kl *ar)
ar->debugfs_phy, ar, &fops_disconnect_timeout);
debugfs_create_file("create_qos", S_IWUSR, ar->debugfs_phy, ar,
- &fops_create_qos);
+ &fops_create_qos);
debugfs_create_file("delete_qos", S_IWUSR, ar->debugfs_phy, ar,
- &fops_delete_qos);
+ &fops_delete_qos);
debugfs_create_file("bgscan_interval", S_IWUSR,
- ar->debugfs_phy, ar, &fops_bgscan_int);
+ ar->debugfs_phy, ar, &fops_bgscan_int);
debugfs_create_file("listen_interval", S_IRUSR | S_IWUSR,
ar->debugfs_phy, ar, &fops_listen_int);
debugfs_create_file("power_params", S_IWUSR, ar->debugfs_phy, ar,
- &fops_power_params);
+ &fops_power_params);
return 0;
}
diff --git a/drivers/net/wireless/ath/ath6kl/hif.c b/drivers/net/wireless/ath/ath6kl/hif.c
index ef650b6..29f0e85 100644
--- a/drivers/net/wireless/ath/ath6kl/hif.c
+++ b/drivers/net/wireless/ath/ath6kl/hif.c
@@ -90,7 +90,7 @@ static void ath6kl_hif_dump_fw_crash(struct ath6kl *ar)
}
ath6kl_dbg(ATH6KL_DBG_IRQ, "register dump data address 0x%x\n",
- regdump_addr);
+ regdump_addr);
regdump_addr = TARG_VTOP(ar->target_type, regdump_addr);
/* fetch register dump data */
@@ -284,7 +284,7 @@ static int ath6kl_hif_proc_counter_intr(struct ath6kl_device *dev)
dev->irq_en_reg.cntr_int_status_en;
ath6kl_dbg(ATH6KL_DBG_IRQ,
- "valid interrupt source(s) in COUNTER_INT_STATUS: 0x%x\n",
+ "valid interrupt source(s) in COUNTER_INT_STATUS: 0x%x\n",
counter_int_status);
/*
@@ -359,7 +359,7 @@ static int ath6kl_hif_proc_cpu_intr(struct ath6kl_device *dev)
}
ath6kl_dbg(ATH6KL_DBG_IRQ,
- "valid interrupt source(s) in CPU_INT_STATUS: 0x%x\n",
+ "valid interrupt source(s) in CPU_INT_STATUS: 0x%x\n",
cpu_int_status);
/* Clear the interrupt */
diff --git a/drivers/net/wireless/ath/ath6kl/htc.c b/drivers/net/wireless/ath/ath6kl/htc.c
index c6f45a7..0204b83 100644
--- a/drivers/net/wireless/ath/ath6kl/htc.c
+++ b/drivers/net/wireless/ath/ath6kl/htc.c
@@ -185,8 +185,8 @@ static void ath6kl_credit_update(struct ath6kl_htc_credit_info *cred_info,
if (cur_dist_list->credits >
cur_dist_list->cred_assngd)
ath6kl_credit_reduce(cred_info,
- cur_dist_list,
- cur_dist_list->cred_assngd);
+ cur_dist_list,
+ cur_dist_list->cred_assngd);
if (cur_dist_list->credits >
cur_dist_list->cred_norm)
@@ -464,8 +464,8 @@ static void htc_async_tx_scat_complete(struct htc_target *target,
INIT_LIST_HEAD(&tx_compq);
ath6kl_dbg(ATH6KL_DBG_HTC,
- "htc tx scat complete len %d entries %d\n",
- scat_req->len, scat_req->scat_entries);
+ "htc tx scat complete len %d entries %d\n",
+ scat_req->len, scat_req->scat_entries);
if (scat_req->status)
ath6kl_err("send scatter req failed: %d\n", scat_req->status);
@@ -603,8 +603,8 @@ static void ath6kl_htc_tx_pkts_get(struct htc_target *target,
list);
ath6kl_dbg(ATH6KL_DBG_HTC,
- "htc tx got packet 0x%p queue depth %d\n",
- packet, get_queue_depth(&endpoint->txq));
+ "htc tx got packet 0x%p queue depth %d\n",
+ packet, get_queue_depth(&endpoint->txq));
len = CALC_TXRX_PADDED_LEN(target,
packet->act_len + HTC_HDR_LENGTH);
@@ -701,8 +701,8 @@ static int ath6kl_htc_tx_setup_scat_list(struct htc_target *target,
scat_req->scat_list[i].packet = packet;
/* prepare packet and flag message as part of a send bundle */
ath6kl_htc_tx_prep_pkt(packet,
- packet->info.tx.flags | HTC_FLAGS_SEND_BUNDLE,
- cred_pad, packet->info.tx.seqno);
+ packet->info.tx.flags | HTC_FLAGS_SEND_BUNDLE,
+ cred_pad, packet->info.tx.seqno);
/* Make sure the buffer is 4-byte aligned */
ath6kl_htc_tx_buf_align(&packet->buf,
packet->act_len + HTC_HDR_LENGTH);
@@ -752,7 +752,7 @@ static void ath6kl_htc_tx_bundle(struct htc_endpoint *endpoint,
u8 ac = WMM_NUM_AC;
if ((HTC_CTRL_RSVD_SVC != endpoint->svc_id) ||
- (WMI_CONTROL_SVC != endpoint->svc_id))
+ (WMI_CONTROL_SVC != endpoint->svc_id))
ac = target->dev->ar->ep2ac_map[endpoint->eid];
while (true) {
@@ -769,7 +769,7 @@ static void ath6kl_htc_tx_bundle(struct htc_endpoint *endpoint,
if (!scat_req) {
/* no scatter resources */
ath6kl_dbg(ATH6KL_DBG_HTC,
- "htc tx no more scatter resources\n");
+ "htc tx no more scatter resources\n");
break;
}
@@ -860,7 +860,7 @@ static void ath6kl_htc_tx_from_queue(struct htc_target *target,
INIT_LIST_HEAD(&txq);
if ((HTC_CTRL_RSVD_SVC != endpoint->svc_id) ||
- (WMI_CONTROL_SVC != endpoint->svc_id))
+ (WMI_CONTROL_SVC != endpoint->svc_id))
ac = target->dev->ar->ep2ac_map[endpoint->eid];
while (true) {
@@ -918,7 +918,7 @@ static void ath6kl_htc_tx_from_queue(struct htc_target *target,
*/
if (!bundle_sent) {
if (!(target->tx_bndl_mask & (1 << ac)) &&
- (ac < WMM_NUM_AC)) {
+ (ac < WMM_NUM_AC)) {
if (++target->ac_tx_count[ac] >=
TX_RESUME_BUNDLE_THRESHOLD) {
target->ac_tx_count[ac] = 0;
@@ -1042,8 +1042,8 @@ static int htc_setup_tx_complete(struct htc_target *target)
memcpy(&setup_comp_ext->flags, &flags,
sizeof(setup_comp_ext->flags));
set_htc_pkt_info(send_pkt, NULL, (u8 *) setup_comp_ext,
- sizeof(struct htc_setup_comp_ext_msg),
- ENDPOINT_0, HTC_SERVICE_TX_PACKET_TAG);
+ sizeof(struct htc_setup_comp_ext_msg),
+ ENDPOINT_0, HTC_SERVICE_TX_PACKET_TAG);
} else {
struct htc_setup_comp_msg *setup_comp;
@@ -1051,8 +1051,8 @@ static int htc_setup_tx_complete(struct htc_target *target)
memset(setup_comp, 0, sizeof(struct htc_setup_comp_msg));
setup_comp->msg_id = cpu_to_le16(HTC_MSG_SETUP_COMPLETE_ID);
set_htc_pkt_info(send_pkt, NULL, (u8 *) setup_comp,
- sizeof(struct htc_setup_comp_msg),
- ENDPOINT_0, HTC_SERVICE_TX_PACKET_TAG);
+ sizeof(struct htc_setup_comp_msg),
+ ENDPOINT_0, HTC_SERVICE_TX_PACKET_TAG);
}
/* we want synchronous operation */
@@ -1151,9 +1151,9 @@ void ath6kl_htc_flush_txep(struct htc_target *target,
packet->status = -ECANCELED;
list_del(&packet->list);
ath6kl_dbg(ATH6KL_DBG_HTC,
- "htc tx flushing pkt 0x%p len %d ep %d tag 0x%x\n",
- packet, packet->act_len,
- packet->endpoint, packet->info.tx.tag);
+ "htc tx flushing pkt 0x%p len %d ep %d tag 0x%x\n",
+ packet, packet->act_len,
+ packet->endpoint, packet->info.tx.tag);
INIT_LIST_HEAD(&container);
list_add_tail(&packet->list, &container);
@@ -1553,7 +1553,7 @@ static void htc_ctrl_rx(struct htc_target *context, struct htc_packet *packets)
if (packets->act_len > 0) {
ath6kl_err("htc_ctrl_rx, got message with len:%zu\n",
- packets->act_len + HTC_HDR_LENGTH);
+ packets->act_len + HTC_HDR_LENGTH);
ath6kl_dbg_dump(ATH6KL_DBG_HTC,
"htc rx unexpected endpoint 0 message", "",
@@ -2101,13 +2101,13 @@ fail_rx:
list_for_each_entry_safe(packet, tmp_pkt, rx_pktq, list) {
list_del(&packet->list);
htc_reclaim_rxbuf(target, packet,
- &target->endpoint[packet->endpoint]);
+ &target->endpoint[packet->endpoint]);
}
list_for_each_entry_safe(packet, tmp_pkt, &tmp_rxq, list) {
list_del(&packet->list);
htc_reclaim_rxbuf(target, packet,
- &target->endpoint[packet->endpoint]);
+ &target->endpoint[packet->endpoint]);
}
return status;
@@ -2239,11 +2239,11 @@ static struct htc_packet *htc_wait_for_ctrl_msg(struct htc_target *target)
u32 look_ahead;
if (ath6kl_hif_poll_mboxmsg_rx(target->dev, &look_ahead,
- HTC_TARGET_RESPONSE_TIMEOUT))
+ HTC_TARGET_RESPONSE_TIMEOUT))
return NULL;
ath6kl_dbg(ATH6KL_DBG_HTC,
- "htc rx wait ctrl look_ahead 0x%X\n", look_ahead);
+ "htc rx wait ctrl look_ahead 0x%X\n", look_ahead);
htc_hdr = (struct htc_frame_hdr *)&look_ahead;
@@ -2308,7 +2308,7 @@ int ath6kl_htc_add_rxbuf_multiple(struct htc_target *target,
depth = get_queue_depth(pkt_queue);
ath6kl_dbg(ATH6KL_DBG_HTC,
- "htc rx add multiple ep id %d cnt %d len %d\n",
+ "htc rx add multiple ep id %d cnt %d len %d\n",
first_pkt->endpoint, depth, first_pkt->buf_len);
endpoint = &target->endpoint[first_pkt->endpoint];
@@ -2334,8 +2334,8 @@ int ath6kl_htc_add_rxbuf_multiple(struct htc_target *target,
if (target->rx_st_flags & HTC_RECV_WAIT_BUFFERS) {
if (target->ep_waiting == first_pkt->endpoint) {
ath6kl_dbg(ATH6KL_DBG_HTC,
- "htc rx blocked on ep %d, unblocking\n",
- target->ep_waiting);
+ "htc rx blocked on ep %d, unblocking\n",
+ target->ep_waiting);
target->rx_st_flags &= ~HTC_RECV_WAIT_BUFFERS;
target->ep_waiting = ENDPOINT_MAX;
rx_unblock = true;
@@ -2676,8 +2676,8 @@ int ath6kl_htc_wait_target(struct htc_target *target)
}
ath6kl_dbg(ATH6KL_DBG_BOOT, "htc using protocol %s (%d)\n",
- (target->htc_tgt_ver == HTC_VERSION_2P0) ? "2.0" : ">= 2.1",
- target->htc_tgt_ver);
+ (target->htc_tgt_ver == HTC_VERSION_2P0) ? "2.0" : ">= 2.1",
+ target->htc_tgt_ver);
if (target->msg_per_bndl_max > 0)
htc_setup_msg_bndl(target);
@@ -2871,14 +2871,14 @@ void ath6kl_htc_cleanup(struct htc_target *target)
ath6kl_hif_cleanup_scatter(target->dev->ar);
list_for_each_entry_safe(packet, tmp_packet,
- &target->free_ctrl_txbuf, list) {
+ &target->free_ctrl_txbuf, list) {
list_del(&packet->list);
kfree(packet->buf_start);
kfree(packet);
}
list_for_each_entry_safe(packet, tmp_packet,
- &target->free_ctrl_rxbuf, list) {
+ &target->free_ctrl_rxbuf, list) {
list_del(&packet->list);
kfree(packet->buf_start);
kfree(packet);
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
index f3b5502..445426f 100644
--- a/drivers/net/wireless/ath/ath6kl/init.c
+++ b/drivers/net/wireless/ath/ath6kl/init.c
@@ -414,13 +414,13 @@ static int ath6kl_target_config_wlan_params(struct ath6kl *ar, int idx)
}
if (ath6kl_wmi_set_keepalive_cmd(ar->wmi, idx,
- WLAN_CONFIG_KEEP_ALIVE_INTERVAL)) {
+ WLAN_CONFIG_KEEP_ALIVE_INTERVAL)) {
ath6kl_err("unable to set keep alive interval\n");
status = -EIO;
}
if (ath6kl_wmi_disctimeout_cmd(ar->wmi, idx,
- WLAN_CONFIG_DISCONNECT_TIMEOUT)) {
+ WLAN_CONFIG_DISCONNECT_TIMEOUT)) {
ath6kl_err("unable to set disconnect timeout\n");
status = -EIO;
}
@@ -833,13 +833,13 @@ static int ath6kl_fetch_testscript_file(struct ath6kl *ar)
return 0;
snprintf(filename, sizeof(filename), "%s/%s",
- ar->hw.fw.dir, ar->hw.fw.testscript);
+ ar->hw.fw.dir, ar->hw.fw.testscript);
ret = ath6kl_get_fw(ar, filename, &ar->fw_testscript,
&ar->fw_testscript_len);
if (ret) {
ath6kl_err("Failed to get testscript file %s: %d\n",
- filename, ret);
+ filename, ret);
return ret;
}
@@ -923,7 +923,7 @@ static int ath6kl_fetch_fw_apin(struct ath6kl *ar, const char *name)
switch (ie_id) {
case ATH6KL_FW_IE_OTP_IMAGE:
ath6kl_dbg(ATH6KL_DBG_BOOT, "found otp image ie (%zd B)\n",
- ie_len);
+ ie_len);
ar->fw_otp = kmemdup(data, ie_len, GFP_KERNEL);
@@ -936,7 +936,7 @@ static int ath6kl_fetch_fw_apin(struct ath6kl *ar, const char *name)
break;
case ATH6KL_FW_IE_FW_IMAGE:
ath6kl_dbg(ATH6KL_DBG_BOOT, "found fw image ie (%zd B)\n",
- ie_len);
+ ie_len);
/* in testmode we already might have a fw file */
if (ar->fw != NULL)
@@ -953,7 +953,7 @@ static int ath6kl_fetch_fw_apin(struct ath6kl *ar, const char *name)
break;
case ATH6KL_FW_IE_PATCH_IMAGE:
ath6kl_dbg(ATH6KL_DBG_BOOT, "found patch image ie (%zd B)\n",
- ie_len);
+ ie_len);
ar->fw_patch = kmemdup(data, ie_len, GFP_KERNEL);
@@ -1313,7 +1313,7 @@ static int ath6kl_upload_testscript(struct ath6kl *ar)
address = ar->hw.testscript_addr;
ath6kl_dbg(ATH6KL_DBG_BOOT, "writing testscript to 0x%x (%zd B)\n",
- address, ar->fw_testscript_len);
+ address, ar->fw_testscript_len);
ret = ath6kl_bmi_write(ar, address, ar->fw_testscript,
ar->fw_testscript_len);
@@ -1349,7 +1349,7 @@ static int ath6kl_init_upload(struct ath6kl *ar)
int status = 0;
if (ar->target_type != TARGET_TYPE_AR6003 &&
- ar->target_type != TARGET_TYPE_AR6004)
+ ar->target_type != TARGET_TYPE_AR6004)
return -EINVAL;
/* temporarily disable system sleep */
@@ -1730,7 +1730,7 @@ void ath6kl_stop_txrx(struct ath6kl *ar)
* configure NOT to reset the target during a debug session.
*/
ath6kl_dbg(ATH6KL_DBG_TRC,
- "attempting to reset target on instance destroy\n");
+ "attempting to reset target on instance destroy\n");
ath6kl_reset_device(ar, ar->target_type, true, true);
clear_bit(WLAN_ENABLED, &ar->flag);
diff --git a/drivers/net/wireless/ath/ath6kl/main.c b/drivers/net/wireless/ath/ath6kl/main.c
index 0d6e352..18b4e16 100644
--- a/drivers/net/wireless/ath/ath6kl/main.c
+++ b/drivers/net/wireless/ath/ath6kl/main.c
@@ -350,7 +350,7 @@ void ath6kl_reset_device(struct ath6kl *ar, u32 target_type,
__le32 data;
if (target_type != TARGET_TYPE_AR6003 &&
- target_type != TARGET_TYPE_AR6004)
+ target_type != TARGET_TYPE_AR6004)
return;
data = cold_reset ? cpu_to_le32(RESET_CONTROL_COLD_RST) :
@@ -950,8 +950,8 @@ void ath6kl_disconnect_event(struct ath6kl_vif *vif, u8 reason, u8 *bssid,
}
ath6kl_cfg80211_disconnect_event(vif, reason, bssid,
- assoc_resp_len, assoc_info,
- prot_reason_status);
+ assoc_resp_len, assoc_info,
+ prot_reason_status);
aggr_reset_state(vif->aggr_cntxt->aggr_conn);
@@ -971,7 +971,7 @@ void ath6kl_disconnect_event(struct ath6kl_vif *vif, u8 reason, u8 *bssid,
} else {
set_bit(CONNECT_PEND, &vif->flags);
if (((reason == ASSOC_FAILED) &&
- (prot_reason_status == 0x11)) ||
+ (prot_reason_status == 0x11)) ||
((reason == ASSOC_FAILED) && (prot_reason_status == 0x0)
&& (vif->reconnect_flag == 1))) {
set_bit(CONNECTED, &vif->flags);
@@ -1107,7 +1107,7 @@ static void ath6kl_set_multicast_list(struct net_device *ndev)
if (mc_all_on || mc_all_off) {
/* Enable/disable all multicast */
ath6kl_dbg(ATH6KL_DBG_TRC, "%s multicast filter\n",
- mc_all_on ? "enabling" : "disabling");
+ mc_all_on ? "enabling" : "disabling");
ret = ath6kl_wmi_mcast_filter_cmd(vif->ar->wmi, vif->fw_vif_idx,
mc_all_on);
if (ret)
@@ -1120,7 +1120,7 @@ static void ath6kl_set_multicast_list(struct net_device *ndev)
found = false;
netdev_for_each_mc_addr(ha, ndev) {
if (memcmp(ha->addr, mc_filter->hw_addr,
- ATH6KL_MCAST_FILTER_MAC_ADDR_SIZE) == 0) {
+ ATH6KL_MCAST_FILTER_MAC_ADDR_SIZE) == 0) {
found = true;
break;
}
@@ -1139,7 +1139,7 @@ static void ath6kl_set_multicast_list(struct net_device *ndev)
false);
if (ret) {
ath6kl_warn("Failed to remove multicast filter:%pM\n",
- mc_filter->hw_addr);
+ mc_filter->hw_addr);
return;
}
@@ -1154,7 +1154,7 @@ static void ath6kl_set_multicast_list(struct net_device *ndev)
found = false;
list_for_each_entry(mc_filter, &vif->mc_filter, list) {
if (memcmp(ha->addr, mc_filter->hw_addr,
- ATH6KL_MCAST_FILTER_MAC_ADDR_SIZE) == 0) {
+ ATH6KL_MCAST_FILTER_MAC_ADDR_SIZE) == 0) {
found = true;
break;
}
@@ -1179,7 +1179,7 @@ static void ath6kl_set_multicast_list(struct net_device *ndev)
true);
if (ret) {
ath6kl_warn("Failed to add multicast filter :%pM\n",
- mc_filter->hw_addr);
+ mc_filter->hw_addr);
kfree(mc_filter);
goto out;
}
diff --git a/drivers/net/wireless/ath/ath6kl/sdio.c b/drivers/net/wireless/ath/ath6kl/sdio.c
index cae446b..da14ca6 100644
--- a/drivers/net/wireless/ath/ath6kl/sdio.c
+++ b/drivers/net/wireless/ath/ath6kl/sdio.c
@@ -636,8 +636,8 @@ static int ath6kl_sdio_async_rw_scatter(struct ath6kl *ar,
return -EINVAL;
ath6kl_dbg(ATH6KL_DBG_SCATTER,
- "hif-scatter: total len: %d scatter entries: %d\n",
- scat_req->len, scat_req->scat_entries);
+ "hif-scatter: total len: %d scatter entries: %d\n",
+ scat_req->len, scat_req->scat_entries);
if (request & HIF_SYNCHRONOUS)
status = ath6kl_sdio_scat_rw(ar_sdio, scat_req->busrequest);
@@ -984,7 +984,7 @@ static int ath6kl_sdio_diag_read32(struct ath6kl *ar, u32 address, u32 *data)
(u8 *)data, sizeof(u32), HIF_RD_SYNC_BYTE_INC);
if (status) {
ath6kl_err("%s: failed to read from window data addr\n",
- __func__);
+ __func__);
return status;
}
diff --git a/drivers/net/wireless/ath/ath6kl/txrx.c b/drivers/net/wireless/ath/ath6kl/txrx.c
index 8022913..67fe599 100644
--- a/drivers/net/wireless/ath/ath6kl/txrx.c
+++ b/drivers/net/wireless/ath/ath6kl/txrx.c
@@ -159,8 +159,8 @@ static bool ath6kl_process_uapsdq(struct ath6kl_sta *conn,
*/
if (is_apsdq_empty) {
ath6kl_wmi_set_apsd_bfrd_traf(ar->wmi,
- vif->fw_vif_idx,
- conn->aid, 1, 0);
+ vif->fw_vif_idx,
+ conn->aid, 1, 0);
}
*flags |= WMI_DATA_HDR_FLAGS_UAPSD;
@@ -371,7 +371,7 @@ int ath6kl_data_tx(struct sk_buff *skb, struct net_device *dev)
if (test_bit(WMI_ENABLED, &ar->flag)) {
if ((dev->features & NETIF_F_IP_CSUM) &&
- (csum == CHECKSUM_PARTIAL)) {
+ (csum == CHECKSUM_PARTIAL)) {
csum_start = skb->csum_start -
(skb_network_header(skb) - skb->head) +
sizeof(struct ath6kl_llc_snap_hdr);
@@ -395,7 +395,7 @@ int ath6kl_data_tx(struct sk_buff *skb, struct net_device *dev)
}
if ((dev->features & NETIF_F_IP_CSUM) &&
- (csum == CHECKSUM_PARTIAL)) {
+ (csum == CHECKSUM_PARTIAL)) {
meta_v2.csum_start = csum_start;
meta_v2.csum_dest = csum_dest;
@@ -420,7 +420,7 @@ int ath6kl_data_tx(struct sk_buff *skb, struct net_device *dev)
}
if ((vif->nw_type == ADHOC_NETWORK) &&
- ar->ibss_ps_enable && test_bit(CONNECTED, &vif->flags))
+ ar->ibss_ps_enable && test_bit(CONNECTED, &vif->flags))
chk_adhoc_ps_mapping = true;
else {
/* get the stream mapping */
@@ -878,7 +878,7 @@ void ath6kl_rx_refill(struct htc_target *target, enum htc_endpoint_id endpoint)
if (!IS_ALIGNED((unsigned long) skb->data, 4))
skb->data = PTR_ALIGN(skb->data - 4, 4);
set_htc_rxpkt_info(packet, skb, skb->data,
- ATH6KL_BUFFER_SIZE, endpoint);
+ ATH6KL_BUFFER_SIZE, endpoint);
list_add_tail(&packet->list, &queue);
}
@@ -1258,8 +1258,8 @@ static void ath6kl_uapsd_trigger_frame_rx(struct ath6kl_vif *vif,
flags = 0;
ath6kl_wmi_set_apsd_bfrd_traf(ar->wmi,
- vif->fw_vif_idx,
- conn->aid, 0, flags);
+ vif->fw_vif_idx,
+ conn->aid, 0, flags);
}
return;
@@ -1568,7 +1568,7 @@ void ath6kl_rx(struct htc_target *target, struct htc_packet *packet)
aggr_conn = vif->aggr_cntxt->aggr_conn;
if (aggr_process_recv_frm(aggr_conn, tid, seq_no,
- is_amsdu, skb)) {
+ is_amsdu, skb)) {
/* aggregation code will handle the skb */
return;
}
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c
index fce29f7..1269f6a 100644
--- a/drivers/net/wireless/ath/ath6kl/wmi.c
+++ b/drivers/net/wireless/ath/ath6kl/wmi.c
@@ -127,7 +127,7 @@ int ath6kl_wmi_dix_2_dot3(struct wmi *wmi, struct sk_buff *skb)
if (!is_ethertype(be16_to_cpu(type))) {
ath6kl_dbg(ATH6KL_DBG_WMI,
- "%s: pkt is already in 802.3 format\n", __func__);
+ "%s: pkt is already in 802.3 format\n", __func__);
return 0;
}
@@ -911,7 +911,7 @@ static void ath6kl_wmi_regdomain_event(struct wmi *wmi, u8 *datap, int len)
regpair = ath6kl_get_regpair((u16) reg_code);
country = ath6kl_regd_find_country_by_rd((u16) reg_code);
ath6kl_dbg(ATH6KL_DBG_WMI, "Regpair used: 0x%0x\n",
- regpair->regDmnEnum);
+ regpair->regDmnEnum);
}
if (country) {
@@ -921,7 +921,7 @@ static void ath6kl_wmi_regdomain_event(struct wmi *wmi, u8 *datap, int len)
regulatory_hint(wmi->parent_dev->wiphy, alpha2);
ath6kl_dbg(ATH6KL_DBG_WMI, "Country alpha2 being used: %c%c\n",
- alpha2[0], alpha2[1]);
+ alpha2[0], alpha2[1]);
}
}
@@ -1365,8 +1365,8 @@ static int ath6kl_wmi_rssi_threshold_event_rx(struct wmi *wmi, u8 *datap,
/* Upper threshold breached */
if (rssi < sq_thresh->upper_threshold[0]) {
ath6kl_dbg(ATH6KL_DBG_WMI,
- "spurious upper rssi threshold event: %d\n",
- rssi);
+ "spurious upper rssi threshold event: %d\n",
+ rssi);
} else if ((rssi < sq_thresh->upper_threshold[1]) &&
(rssi >= sq_thresh->upper_threshold[0])) {
new_threshold = WMI_RSSI_THRESHOLD1_ABOVE;
@@ -1389,7 +1389,7 @@ static int ath6kl_wmi_rssi_threshold_event_rx(struct wmi *wmi, u8 *datap,
/* Lower threshold breached */
if (rssi > sq_thresh->lower_threshold[0]) {
ath6kl_dbg(ATH6KL_DBG_WMI,
- "spurious lower rssi threshold event: %d %d\n",
+ "spurious lower rssi threshold event: %d %d\n",
rssi, sq_thresh->lower_threshold[0]);
} else if ((rssi > sq_thresh->lower_threshold[1]) &&
(rssi <= sq_thresh->lower_threshold[0])) {
@@ -1550,8 +1550,8 @@ static int ath6kl_wmi_snr_threshold_event_rx(struct wmi *wmi, u8 *datap,
/* Upper threshold breached */
if (snr < sq_thresh->upper_threshold[0]) {
ath6kl_dbg(ATH6KL_DBG_WMI,
- "spurious upper snr threshold event: %d\n",
- snr);
+ "spurious upper snr threshold event: %d\n",
+ snr);
} else if ((snr < sq_thresh->upper_threshold[1]) &&
(snr >= sq_thresh->upper_threshold[0])) {
new_threshold = WMI_SNR_THRESHOLD1_ABOVE;
@@ -1568,8 +1568,8 @@ static int ath6kl_wmi_snr_threshold_event_rx(struct wmi *wmi, u8 *datap,
/* Lower threshold breached */
if (snr > sq_thresh->lower_threshold[0]) {
ath6kl_dbg(ATH6KL_DBG_WMI,
- "spurious lower snr threshold event: %d\n",
- sq_thresh->lower_threshold[0]);
+ "spurious lower snr threshold event: %d\n",
+ sq_thresh->lower_threshold[0]);
} else if ((snr > sq_thresh->lower_threshold[1]) &&
(snr <= sq_thresh->lower_threshold[0])) {
new_threshold = WMI_SNR_THRESHOLD4_BELOW;
@@ -2612,7 +2612,7 @@ int ath6kl_wmi_set_wow_mode_cmd(struct wmi *wmi, u8 if_idx,
int ret;
if ((wow_mode != ATH6KL_WOW_MODE_ENABLE) &&
- wow_mode != ATH6KL_WOW_MODE_DISABLE) {
+ wow_mode != ATH6KL_WOW_MODE_DISABLE) {
ath6kl_err("invalid wow mode: %d\n", wow_mode);
return -EINVAL;
}
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 04/12] ath6kl: logical continuations should be on the previous line
2012-02-29 17:18 [PATCH 00/12] ath6kl: checkpatch fixes Kalle Valo
` (2 preceding siblings ...)
2012-02-29 17:18 ` [PATCH 03/12] ath6kl: alignment should match open parenthesis Kalle Valo
@ 2012-02-29 17:19 ` Kalle Valo
2012-02-29 17:19 ` [PATCH 05/12] ath6kl: remove multiple assignments Kalle Valo
` (9 subsequent siblings)
13 siblings, 0 replies; 22+ messages in thread
From: Kalle Valo @ 2012-02-29 17:19 UTC (permalink / raw)
To: kvalo; +Cc: ath6kl-devel, linux-wireless
All found by checkpatch:
ath6kl/wmi.c:1036: CHECK: Logical continuations should be on the previous line
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/cfg80211.c | 10 +++++-----
drivers/net/wireless/ath/ath6kl/htc.c | 8 ++++----
drivers/net/wireless/ath/ath6kl/main.c | 4 ++--
drivers/net/wireless/ath/ath6kl/wmi.c | 9 +++++----
4 files changed, 16 insertions(+), 15 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 308cc9b..c69de7b 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -599,8 +599,8 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
}
if ((!(ar->connect_ctrl_flags & CONNECT_DO_WPA_OFFLOAD)) &&
- ((vif->auth_mode == WPA_PSK_AUTH)
- || (vif->auth_mode == WPA2_PSK_AUTH))) {
+ ((vif->auth_mode == WPA_PSK_AUTH) ||
+ (vif->auth_mode == WPA2_PSK_AUTH))) {
mod_timer(&vif->disconnect_timer,
jiffies + msecs_to_jiffies(DISCON_TIMER_INTVAL));
}
@@ -1058,9 +1058,9 @@ static int ath6kl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev,
return -ENOTSUPP;
}
- if (((vif->auth_mode == WPA_PSK_AUTH)
- || (vif->auth_mode == WPA2_PSK_AUTH))
- && (key_usage & GROUP_USAGE))
+ if (((vif->auth_mode == WPA_PSK_AUTH) ||
+ (vif->auth_mode == WPA2_PSK_AUTH)) &&
+ (key_usage & GROUP_USAGE))
del_timer(&vif->disconnect_timer);
ath6kl_dbg(ATH6KL_DBG_WLAN_CFG,
diff --git a/drivers/net/wireless/ath/ath6kl/htc.c b/drivers/net/wireless/ath/ath6kl/htc.c
index 0204b83..24cfc3b 100644
--- a/drivers/net/wireless/ath/ath6kl/htc.c
+++ b/drivers/net/wireless/ath/ath6kl/htc.c
@@ -1672,8 +1672,8 @@ static int htc_parse_trailer(struct htc_target *target,
}
lk_ahd = (struct htc_lookahead_report *) record_buf;
- if ((lk_ahd->pre_valid == ((~lk_ahd->post_valid) & 0xFF))
- && next_lk_ahds) {
+ if ((lk_ahd->pre_valid == ((~lk_ahd->post_valid) & 0xFF)) &&
+ next_lk_ahds) {
ath6kl_dbg(ATH6KL_DBG_HTC,
"htc rx lk_ahd found pre_valid 0x%x post_valid 0x%x\n",
@@ -2449,8 +2449,8 @@ int ath6kl_htc_conn_service(struct htc_target *target,
resp_msg = (struct htc_conn_service_resp *)rx_pkt->buf;
- if ((le16_to_cpu(resp_msg->msg_id) != HTC_MSG_CONN_SVC_RESP_ID)
- || (rx_pkt->act_len < sizeof(*resp_msg))) {
+ if ((le16_to_cpu(resp_msg->msg_id) != HTC_MSG_CONN_SVC_RESP_ID) ||
+ (rx_pkt->act_len < sizeof(*resp_msg))) {
status = -ENOMEM;
goto fail_tx;
}
diff --git a/drivers/net/wireless/ath/ath6kl/main.c b/drivers/net/wireless/ath/ath6kl/main.c
index 18b4e16..16f7de2 100644
--- a/drivers/net/wireless/ath/ath6kl/main.c
+++ b/drivers/net/wireless/ath/ath6kl/main.c
@@ -972,8 +972,8 @@ void ath6kl_disconnect_event(struct ath6kl_vif *vif, u8 reason, u8 *bssid,
set_bit(CONNECT_PEND, &vif->flags);
if (((reason == ASSOC_FAILED) &&
(prot_reason_status == 0x11)) ||
- ((reason == ASSOC_FAILED) && (prot_reason_status == 0x0)
- && (vif->reconnect_flag == 1))) {
+ ((reason == ASSOC_FAILED) && (prot_reason_status == 0x0) &&
+ (vif->reconnect_flag == 1))) {
set_bit(CONNECTED, &vif->flags);
return;
}
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c
index 1269f6a..60a11b2 100644
--- a/drivers/net/wireless/ath/ath6kl/wmi.c
+++ b/drivers/net/wireless/ath/ath6kl/wmi.c
@@ -826,8 +826,8 @@ static int ath6kl_wmi_connect_event_rx(struct wmi *wmi, u8 *datap, int len,
if (pie[1] > 3 && pie[2] == 0x00 && pie[3] == 0x50 &&
pie[4] == 0xf2 && pie[5] == WMM_OUI_TYPE) {
/* WMM OUT (00:50:F2) */
- if (pie[1] > 5
- && pie[6] == WMM_PARAM_OUI_SUBTYPE)
+ if (pie[1] > 5 &&
+ pie[6] == WMM_PARAM_OUI_SUBTYPE)
wmi->is_wmm_enabled = true;
}
break;
@@ -1032,8 +1032,9 @@ static int ath6kl_wmi_bssinfo_event_rx(struct wmi *wmi, u8 *datap, int len,
if (len < 8 + 2 + 2)
return -EINVAL;
- if (bih->frame_type == BEACON_FTYPE && test_bit(CONNECTED, &vif->flags)
- && memcmp(bih->bssid, vif->bssid, ETH_ALEN) == 0) {
+ if (bih->frame_type == BEACON_FTYPE &&
+ test_bit(CONNECTED, &vif->flags) &&
+ memcmp(bih->bssid, vif->bssid, ETH_ALEN) == 0) {
const u8 *tim;
tim = cfg80211_find_ie(WLAN_EID_TIM, buf + 8 + 2 + 2,
len - 8 - 2 - 2);
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 05/12] ath6kl: remove multiple assignments
2012-02-29 17:18 [PATCH 00/12] ath6kl: checkpatch fixes Kalle Valo
` (3 preceding siblings ...)
2012-02-29 17:19 ` [PATCH 04/12] ath6kl: logical continuations should be on the previous line Kalle Valo
@ 2012-02-29 17:19 ` Kalle Valo
2012-02-29 17:19 ` [PATCH 06/12] ath6kl: add ath6kl_bmi_write_hi32() Kalle Valo
` (8 subsequent siblings)
13 siblings, 0 replies; 22+ messages in thread
From: Kalle Valo @ 2012-02-29 17:19 UTC (permalink / raw)
To: kvalo; +Cc: ath6kl-devel, linux-wireless
Found by checkpatch:
drivers/net/wireless/ath/ath6kl/cfg80211.c:1295: CHECK: multiple assignments should be avoided
drivers/net/wireless/ath/ath6kl/cfg80211.c:3000: CHECK: multiple assignments should be avoided
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/cfg80211.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index c69de7b..6aa4c71 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -1275,7 +1275,6 @@ static int ath6kl_cfg80211_set_txpower(struct wiphy *wiphy,
{
struct ath6kl *ar = (struct ath6kl *)wiphy_priv(wiphy);
struct ath6kl_vif *vif;
- u8 ath6kl_dbm;
int dbm = MBM_TO_DBM(mbm);
ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: type 0x%x, dbm %d\n", __func__,
@@ -1292,7 +1291,7 @@ static int ath6kl_cfg80211_set_txpower(struct wiphy *wiphy,
case NL80211_TX_POWER_AUTOMATIC:
return 0;
case NL80211_TX_POWER_LIMITED:
- ar->tx_pwr = ath6kl_dbm = dbm;
+ ar->tx_pwr = dbm;
break;
default:
ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: type 0x%x not supported\n",
@@ -1300,7 +1299,7 @@ static int ath6kl_cfg80211_set_txpower(struct wiphy *wiphy,
return -EOPNOTSUPP;
}
- ath6kl_wmi_set_tx_pwr_cmd(ar->wmi, vif->fw_vif_idx, ath6kl_dbm);
+ ath6kl_wmi_set_tx_pwr_cmd(ar->wmi, vif->fw_vif_idx, dbm);
return 0;
}
@@ -2997,7 +2996,8 @@ struct net_device *ath6kl_interface_add(struct ath6kl *ar, char *name,
vif->wdev.netdev = ndev;
vif->wdev.iftype = type;
vif->fw_vif_idx = fw_vif_idx;
- vif->nw_type = vif->next_mode = nw_type;
+ vif->nw_type = nw_type;
+ vif->next_mode = nw_type;
memcpy(ndev->dev_addr, ar->mac_addr, ETH_ALEN);
if (fw_vif_idx != 0)
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 06/12] ath6kl: add ath6kl_bmi_write_hi32()
2012-02-29 17:18 [PATCH 00/12] ath6kl: checkpatch fixes Kalle Valo
` (4 preceding siblings ...)
2012-02-29 17:19 ` [PATCH 05/12] ath6kl: remove multiple assignments Kalle Valo
@ 2012-02-29 17:19 ` Kalle Valo
2012-02-29 17:19 ` [PATCH 07/12] ath6kl: add ath6kl_bmi_read_hi32() Kalle Valo
` (7 subsequent siblings)
13 siblings, 0 replies; 22+ messages in thread
From: Kalle Valo @ 2012-02-29 17:19 UTC (permalink / raw)
To: kvalo; +Cc: ath6kl-devel, linux-wireless
We have a lot of 32 bit writes to the host interest area and the code
doing that is ugly. Clean that up by adding ath6kl_bmi_write_hi32().
This also fixes few checkpatch warnings.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/bmi.h | 9 +++
drivers/net/wireless/ath/ath6kl/init.c | 99 +++++++-------------------------
2 files changed, 32 insertions(+), 76 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/bmi.h b/drivers/net/wireless/ath/ath6kl/bmi.h
index 114f7b2..e6a7330 100644
--- a/drivers/net/wireless/ath/ath6kl/bmi.h
+++ b/drivers/net/wireless/ath/ath6kl/bmi.h
@@ -223,6 +223,15 @@ struct ath6kl_bmi_target_info {
__le32 type; /* target type */
} __packed;
+#define ath6kl_bmi_write_hi32(ar, item, val) \
+ ({ \
+ u32 addr, v; \
+ addr = ath6kl_get_hi_item_addr(ar, HI_ITEM(item)); \
+ v = val; \
+ ath6kl_bmi_write(ar, addr, (u8 *) &v, sizeof(v)); \
+ })
+
+
int ath6kl_bmi_init(struct ath6kl *ar);
void ath6kl_bmi_cleanup(struct ath6kl *ar);
void ath6kl_bmi_reset(struct ath6kl *ar);
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
index 445426f..da5900d 100644
--- a/drivers/net/wireless/ath/ath6kl/init.c
+++ b/drivers/net/wireless/ath/ath6kl/init.c
@@ -352,11 +352,7 @@ static int ath6kl_set_htc_params(struct ath6kl *ar, u32 mbox_isr_yield_val,
blk_size |= ((u32)htc_ctrl_buf) << 16;
/* set the host interest area for the block size */
- status = ath6kl_bmi_write(ar,
- ath6kl_get_hi_item_addr(ar,
- HI_ITEM(hi_mbox_io_block_sz)),
- (u8 *)&blk_size,
- 4);
+ status = ath6kl_bmi_write_hi32(ar, hi_mbox_io_block_sz, blk_size);
if (status) {
ath6kl_err("bmi_write_memory for IO block size failed\n");
goto out;
@@ -368,11 +364,8 @@ static int ath6kl_set_htc_params(struct ath6kl *ar, u32 mbox_isr_yield_val,
if (mbox_isr_yield_val) {
/* set the host interest area for the mbox ISR yield limit */
- status = ath6kl_bmi_write(ar,
- ath6kl_get_hi_item_addr(ar,
- HI_ITEM(hi_mbox_isr_yield_limit)),
- (u8 *)&mbox_isr_yield_val,
- 4);
+ status = ath6kl_bmi_write_hi32(ar, hi_mbox_isr_yield_limit,
+ mbox_isr_yield_val);
if (status) {
ath6kl_err("bmi_write_memory for yield limit failed\n");
goto out;
@@ -463,8 +456,7 @@ int ath6kl_configure_target(struct ath6kl *ar)
int i, status;
param = !!(ar->conf_flags & ATH6KL_CONF_UART_DEBUG);
- if (ath6kl_bmi_write(ar, ath6kl_get_hi_item_addr(ar,
- HI_ITEM(hi_serial_enable)), (u8 *)¶m, 4)) {
+ if (ath6kl_bmi_write_hi32(ar, hi_serial_enable, param)) {
ath6kl_err("bmi_write_memory for uart debug failed\n");
return -EIO;
}
@@ -500,11 +492,8 @@ int ath6kl_configure_target(struct ath6kl *ar)
if (ar->p2p && ar->vif_max == 1)
fw_submode = HI_OPTION_FW_SUBMODE_P2PDEV;
- param = HTC_PROTOCOL_VERSION;
- if (ath6kl_bmi_write(ar,
- ath6kl_get_hi_item_addr(ar,
- HI_ITEM(hi_app_host_interest)),
- (u8 *)¶m, 4) != 0) {
+ if (ath6kl_bmi_write_hi32(ar, hi_app_host_interest,
+ HTC_PROTOCOL_VERSION) != 0) {
ath6kl_err("bmi_write_memory for htc version failed\n");
return -EIO;
}
@@ -527,11 +516,7 @@ int ath6kl_configure_target(struct ath6kl *ar)
param |= (0 << HI_OPTION_MAC_ADDR_METHOD_SHIFT);
param |= (0 << HI_OPTION_FW_BRIDGE_SHIFT);
- if (ath6kl_bmi_write(ar,
- ath6kl_get_hi_item_addr(ar,
- HI_ITEM(hi_option_flag)),
- (u8 *)¶m,
- 4) != 0) {
+ if (ath6kl_bmi_write_hi32(ar, hi_option_flag, param) != 0) {
ath6kl_err("bmi_write_memory for setting fwmode failed\n");
return -EIO;
}
@@ -550,16 +535,13 @@ int ath6kl_configure_target(struct ath6kl *ar)
param = ar->hw.board_ext_data_addr;
ram_reserved_size = ar->hw.reserved_ram_size;
- if (ath6kl_bmi_write(ar, ath6kl_get_hi_item_addr(ar,
- HI_ITEM(hi_board_ext_data)),
- (u8 *)¶m, 4) != 0) {
+ if (ath6kl_bmi_write_hi32(ar, hi_board_ext_data, param) != 0) {
ath6kl_err("bmi_write_memory for hi_board_ext_data failed\n");
return -EIO;
}
- if (ath6kl_bmi_write(ar, ath6kl_get_hi_item_addr(ar,
- HI_ITEM(hi_end_ram_reserve_sz)),
- (u8 *)&ram_reserved_size, 4) != 0) {
+ if (ath6kl_bmi_write_hi32(ar, hi_end_ram_reserve_sz,
+ ram_reserved_size) != 0) {
ath6kl_err("bmi_write_memory for hi_end_ram_reserve_sz failed\n");
return -EIO;
}
@@ -570,20 +552,13 @@ int ath6kl_configure_target(struct ath6kl *ar)
return -EIO;
/* Configure GPIO AR600x UART */
- param = ar->hw.uarttx_pin;
- status = ath6kl_bmi_write(ar,
- ath6kl_get_hi_item_addr(ar,
- HI_ITEM(hi_dbg_uart_txpin)),
- (u8 *)¶m, 4);
+ status = ath6kl_bmi_write_hi32(ar, hi_dbg_uart_txpin,
+ ar->hw.uarttx_pin);
if (status)
return status;
/* Configure target refclk_hz */
- param = ar->hw.refclk_hz;
- status = ath6kl_bmi_write(ar,
- ath6kl_get_hi_item_addr(ar,
- HI_ITEM(hi_refclk_hz)),
- (u8 *)¶m, 4);
+ status = ath6kl_bmi_write_hi32(ar, hi_refclk_hz, ar->hw.refclk_hz);
if (status)
return status;
@@ -1096,11 +1071,8 @@ static int ath6kl_upload_board_file(struct ath6kl *ar)
* writing board data.
*/
if (ar->hw.board_addr != 0) {
- board_address = ar->hw.board_addr;
- ath6kl_bmi_write(ar,
- ath6kl_get_hi_item_addr(ar,
- HI_ITEM(hi_board_data)),
- (u8 *) &board_address, 4);
+ ath6kl_bmi_write_hi32(ar, hi_board_data,
+ ar->hw.board_addr);
} else {
ath6kl_bmi_read(ar,
ath6kl_get_hi_item_addr(ar,
@@ -1157,10 +1129,7 @@ static int ath6kl_upload_board_file(struct ath6kl *ar)
/* record that extended board data is initialized */
param = (board_ext_data_size << 16) | 1;
- ath6kl_bmi_write(ar,
- ath6kl_get_hi_item_addr(ar,
- HI_ITEM(hi_board_ext_data_config)),
- (unsigned char *) ¶m, 4);
+ ath6kl_bmi_write_hi32(ar, hi_board_ext_data_config, param);
}
if (ar->fw_board_len < board_data_size) {
@@ -1181,11 +1150,7 @@ static int ath6kl_upload_board_file(struct ath6kl *ar)
}
/* record the fact that Board Data IS initialized */
- param = 1;
- ath6kl_bmi_write(ar,
- ath6kl_get_hi_item_addr(ar,
- HI_ITEM(hi_board_data_initialized)),
- (u8 *)¶m, 4);
+ ath6kl_bmi_write_hi32(ar, hi_board_data_initialized, 1);
return ret;
}
@@ -1273,7 +1238,7 @@ static int ath6kl_upload_firmware(struct ath6kl *ar)
static int ath6kl_upload_patch(struct ath6kl *ar)
{
- u32 address, param;
+ u32 address;
int ret;
if (ar->fw_patch == NULL)
@@ -1290,18 +1255,14 @@ static int ath6kl_upload_patch(struct ath6kl *ar)
return ret;
}
- param = address;
- ath6kl_bmi_write(ar,
- ath6kl_get_hi_item_addr(ar,
- HI_ITEM(hi_dset_list_head)),
- (unsigned char *) ¶m, 4);
+ ath6kl_bmi_write_hi32(ar, hi_dset_list_head, address);
return 0;
}
static int ath6kl_upload_testscript(struct ath6kl *ar)
{
- u32 address, param;
+ u32 address;
int ret;
if (ar->testmode != 2)
@@ -1322,23 +1283,9 @@ static int ath6kl_upload_testscript(struct ath6kl *ar)
return ret;
}
- param = address;
- ath6kl_bmi_write(ar,
- ath6kl_get_hi_item_addr(ar,
- HI_ITEM(hi_ota_testscript)),
- (unsigned char *) ¶m, 4);
-
- param = 4096;
- ath6kl_bmi_write(ar,
- ath6kl_get_hi_item_addr(ar,
- HI_ITEM(hi_end_ram_reserve_sz)),
- (unsigned char *) ¶m, 4);
-
- param = 1;
- ath6kl_bmi_write(ar,
- ath6kl_get_hi_item_addr(ar,
- HI_ITEM(hi_test_apps_related)),
- (unsigned char *) ¶m, 4);
+ ath6kl_bmi_write_hi32(ar, hi_ota_testscript, address);
+ ath6kl_bmi_write_hi32(ar, hi_end_ram_reserve_sz, 4096);
+ ath6kl_bmi_write_hi32(ar, hi_test_apps_related, 1);
return 0;
}
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 07/12] ath6kl: add ath6kl_bmi_read_hi32()
2012-02-29 17:18 [PATCH 00/12] ath6kl: checkpatch fixes Kalle Valo
` (5 preceding siblings ...)
2012-02-29 17:19 ` [PATCH 06/12] ath6kl: add ath6kl_bmi_write_hi32() Kalle Valo
@ 2012-02-29 17:19 ` Kalle Valo
2012-02-29 17:19 ` [PATCH 08/12] ath6kl: fix error handling ath6kl_target_config_wlan_params() Kalle Valo
` (6 subsequent siblings)
13 siblings, 0 replies; 22+ messages in thread
From: Kalle Valo @ 2012-02-29 17:19 UTC (permalink / raw)
To: kvalo; +Cc: ath6kl-devel, linux-wireless
There are few 32 bit reads from the host interest area. Add
ath6kl_bmi_read_hi32() to make it easier to do that. As code is cleaner
this also fixes few checkpatch warnings.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/bmi.h | 7 +++++++
drivers/net/wireless/ath/ath6kl/init.c | 20 ++++----------------
2 files changed, 11 insertions(+), 16 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/bmi.h b/drivers/net/wireless/ath/ath6kl/bmi.h
index e6a7330..3c5b382 100644
--- a/drivers/net/wireless/ath/ath6kl/bmi.h
+++ b/drivers/net/wireless/ath/ath6kl/bmi.h
@@ -231,6 +231,13 @@ struct ath6kl_bmi_target_info {
ath6kl_bmi_write(ar, addr, (u8 *) &v, sizeof(v)); \
})
+#define ath6kl_bmi_read_hi32(ar, item, val) \
+ ({ \
+ u32 addr, *check_type = val; \
+ (void) (check_type == val); \
+ addr = ath6kl_get_hi_item_addr(ar, HI_ITEM(item)); \
+ ath6kl_bmi_read(ar, addr, (u8 *) val, 4); \
+ })
int ath6kl_bmi_init(struct ath6kl *ar);
void ath6kl_bmi_cleanup(struct ath6kl *ar);
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
index da5900d..d1d121d 100644
--- a/drivers/net/wireless/ath/ath6kl/init.c
+++ b/drivers/net/wireless/ath/ath6kl/init.c
@@ -501,10 +501,7 @@ int ath6kl_configure_target(struct ath6kl *ar)
/* set the firmware mode to STA/IBSS/AP */
param = 0;
- if (ath6kl_bmi_read(ar,
- ath6kl_get_hi_item_addr(ar,
- HI_ITEM(hi_option_flag)),
- (u8 *)¶m, 4) != 0) {
+ if (ath6kl_bmi_read_hi32(ar, hi_option_flag, ¶m) != 0) {
ath6kl_err("bmi_read_memory for setting fwmode failed\n");
return -EIO;
}
@@ -1074,17 +1071,11 @@ static int ath6kl_upload_board_file(struct ath6kl *ar)
ath6kl_bmi_write_hi32(ar, hi_board_data,
ar->hw.board_addr);
} else {
- ath6kl_bmi_read(ar,
- ath6kl_get_hi_item_addr(ar,
- HI_ITEM(hi_board_data)),
- (u8 *) &board_address, 4);
+ ath6kl_bmi_read_hi32(ar, hi_board_data, &board_address);
}
/* determine where in target ram to write extended board data */
- ath6kl_bmi_read(ar,
- ath6kl_get_hi_item_addr(ar,
- HI_ITEM(hi_board_ext_data)),
- (u8 *) &board_ext_address, 4);
+ ath6kl_bmi_read_hi32(ar, hi_board_ext_data, &board_ext_address);
if (ar->target_type == TARGET_TYPE_AR6003 &&
board_ext_address == 0) {
@@ -1177,10 +1168,7 @@ static int ath6kl_upload_otp(struct ath6kl *ar)
}
/* read firmware start address */
- ret = ath6kl_bmi_read(ar,
- ath6kl_get_hi_item_addr(ar,
- HI_ITEM(hi_app_start)),
- (u8 *) &address, sizeof(address));
+ ret = ath6kl_bmi_read_hi32(ar, hi_app_start, &address);
if (ret) {
ath6kl_err("Failed to read hi_app_start: %d\n", ret);
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 08/12] ath6kl: fix error handling ath6kl_target_config_wlan_params()
2012-02-29 17:18 [PATCH 00/12] ath6kl: checkpatch fixes Kalle Valo
` (6 preceding siblings ...)
2012-02-29 17:19 ` [PATCH 07/12] ath6kl: add ath6kl_bmi_read_hi32() Kalle Valo
@ 2012-02-29 17:19 ` Kalle Valo
2012-02-29 17:19 ` [PATCH 09/12] ath6kl: fix open paranthesis alignment in ath6kl_cfg80211_connect() Kalle Valo
` (5 subsequent siblings)
13 siblings, 0 replies; 22+ messages in thread
From: Kalle Valo @ 2012-02-29 17:19 UTC (permalink / raw)
To: kvalo; +Cc: ath6kl-devel, linux-wireless
The error handling in ath6kl_target_config_wlan_params() was just weird,
fix that. This also fixes some of the open parenthesis alignment issues
reported by checkpatch.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/init.c | 66 ++++++++++++++++++--------------
1 files changed, 38 insertions(+), 28 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
index d1d121d..c7d5149 100644
--- a/drivers/net/wireless/ath/ath6kl/init.c
+++ b/drivers/net/wireless/ath/ath6kl/init.c
@@ -378,7 +378,6 @@ out:
static int ath6kl_target_config_wlan_params(struct ath6kl *ar, int idx)
{
- int status = 0;
int ret;
/*
@@ -386,43 +385,54 @@ static int ath6kl_target_config_wlan_params(struct ath6kl *ar, int idx)
* default values. Required if checksum offload is needed. Set
* RxMetaVersion to 2.
*/
- if (ath6kl_wmi_set_rx_frame_format_cmd(ar->wmi, idx,
- ar->rx_meta_ver, 0, 0)) {
- ath6kl_err("unable to set the rx frame format\n");
- status = -EIO;
+ ret = ath6kl_wmi_set_rx_frame_format_cmd(ar->wmi, idx,
+ ar->rx_meta_ver, 0, 0);
+ if (ret) {
+ ath6kl_err("unable to set the rx frame format: %d\n", ret);
+ return ret;
}
- if (ar->conf_flags & ATH6KL_CONF_IGNORE_PS_FAIL_EVT_IN_SCAN)
- if ((ath6kl_wmi_pmparams_cmd(ar->wmi, idx, 0, 1, 0, 0, 1,
- IGNORE_POWER_SAVE_FAIL_EVENT_DURING_SCAN)) != 0) {
- ath6kl_err("unable to set power save fail event policy\n");
- status = -EIO;
+ if (ar->conf_flags & ATH6KL_CONF_IGNORE_PS_FAIL_EVT_IN_SCAN) {
+ ret = ath6kl_wmi_pmparams_cmd(ar->wmi, idx, 0, 1, 0, 0, 1,
+ IGNORE_POWER_SAVE_FAIL_EVENT_DURING_SCAN);
+ if (ret) {
+ ath6kl_err("unable to set power save fail event policy: %d\n",
+ ret);
+ return ret;
}
+ }
- if (!(ar->conf_flags & ATH6KL_CONF_IGNORE_ERP_BARKER))
- if ((ath6kl_wmi_set_lpreamble_cmd(ar->wmi, idx, 0,
- WMI_DONOT_IGNORE_BARKER_IN_ERP)) != 0) {
- ath6kl_err("unable to set barker preamble policy\n");
- status = -EIO;
+ if (!(ar->conf_flags & ATH6KL_CONF_IGNORE_ERP_BARKER)) {
+ ret = ath6kl_wmi_set_lpreamble_cmd(ar->wmi, idx, 0,
+ WMI_DONOT_IGNORE_BARKER_IN_ERP);
+ if (ret) {
+ ath6kl_err("unable to set barker preamble policy: %d\n",
+ ret);
+ return ret;
}
+ }
- if (ath6kl_wmi_set_keepalive_cmd(ar->wmi, idx,
- WLAN_CONFIG_KEEP_ALIVE_INTERVAL)) {
- ath6kl_err("unable to set keep alive interval\n");
- status = -EIO;
+ ret = ath6kl_wmi_set_keepalive_cmd(ar->wmi, idx,
+ WLAN_CONFIG_KEEP_ALIVE_INTERVAL);
+ if (ret) {
+ ath6kl_err("unable to set keep alive interval: %d\n", ret);
+ return ret;
}
- if (ath6kl_wmi_disctimeout_cmd(ar->wmi, idx,
- WLAN_CONFIG_DISCONNECT_TIMEOUT)) {
- ath6kl_err("unable to set disconnect timeout\n");
- status = -EIO;
+ ret = ath6kl_wmi_disctimeout_cmd(ar->wmi, idx,
+ WLAN_CONFIG_DISCONNECT_TIMEOUT);
+ if (ret) {
+ ath6kl_err("unable to set disconnect timeout: %d\n", ret);
+ return ret;
}
- if (!(ar->conf_flags & ATH6KL_CONF_ENABLE_TX_BURST))
- if (ath6kl_wmi_set_wmm_txop(ar->wmi, idx, WMI_TXOP_DISABLED)) {
- ath6kl_err("unable to set txop bursting\n");
- status = -EIO;
+ if (!(ar->conf_flags & ATH6KL_CONF_ENABLE_TX_BURST)) {
+ ret = ath6kl_wmi_set_wmm_txop(ar->wmi, idx, WMI_TXOP_DISABLED);
+ if (ret) {
+ ath6kl_err("unable to set txop bursting: %d\n", ret);
+ return ret;
}
+ }
if (ar->p2p && (ar->vif_max == 1 || idx)) {
ret = ath6kl_wmi_info_req_cmd(ar->wmi, idx,
@@ -446,7 +456,7 @@ static int ath6kl_target_config_wlan_params(struct ath6kl *ar, int idx)
}
}
- return status;
+ return ret;
}
int ath6kl_configure_target(struct ath6kl *ar)
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 09/12] ath6kl: fix open paranthesis alignment in ath6kl_cfg80211_connect()
2012-02-29 17:18 [PATCH 00/12] ath6kl: checkpatch fixes Kalle Valo
` (7 preceding siblings ...)
2012-02-29 17:19 ` [PATCH 08/12] ath6kl: fix error handling ath6kl_target_config_wlan_params() Kalle Valo
@ 2012-02-29 17:19 ` Kalle Valo
2012-02-29 17:19 ` [PATCH 10/12] ath6kl: document all spinlocks Kalle Valo
` (4 subsequent siblings)
13 siblings, 0 replies; 22+ messages in thread
From: Kalle Valo @ 2012-02-29 17:19 UTC (permalink / raw)
To: kvalo; +Cc: ath6kl-devel, linux-wireless
ath6kl/cfg80211.c:462: CHECK: Alignment should match open parenthesis
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/cfg80211.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 6aa4c71..45cf4f4 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -416,6 +416,12 @@ static bool ath6kl_is_valid_iftype(struct ath6kl *ar, enum nl80211_iftype type,
return false;
}
+static bool ath6kl_is_tx_pending(struct ath6kl *ar)
+{
+ return ar->tx_pending[ath6kl_wmi_get_control_ep(ar->wmi)] == 0;
+}
+
+
static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_connect_params *sme)
{
@@ -459,8 +465,8 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
* sleep until the command queue drains
*/
wait_event_interruptible_timeout(ar->event_wq,
- ar->tx_pending[ath6kl_wmi_get_control_ep(ar->wmi)] == 0,
- WMI_TIMEOUT);
+ ath6kl_is_tx_pending(ar),
+ WMI_TIMEOUT);
if (signal_pending(current)) {
ath6kl_err("cmd queue drain timeout\n");
up(&ar->sem);
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 10/12] ath6kl: document all spinlocks
2012-02-29 17:18 [PATCH 00/12] ath6kl: checkpatch fixes Kalle Valo
` (8 preceding siblings ...)
2012-02-29 17:19 ` [PATCH 09/12] ath6kl: fix open paranthesis alignment in ath6kl_cfg80211_connect() Kalle Valo
@ 2012-02-29 17:19 ` Kalle Valo
2012-02-29 17:20 ` [PATCH 11/12] ath6kl: fix too long lines Kalle Valo
` (3 subsequent siblings)
13 siblings, 0 replies; 22+ messages in thread
From: Kalle Valo @ 2012-02-29 17:19 UTC (permalink / raw)
To: kvalo; +Cc: ath6kl-devel, linux-wireless
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>
---
drivers/net/wireless/ath/ath6kl/core.h | 21 +++++++++++++++++++++
drivers/net/wireless/ath/ath6kl/hif.h | 1 +
drivers/net/wireless/ath/ath6kl/htc.h | 7 +++++++
drivers/net/wireless/ath/ath6kl/sdio.c | 5 +++++
drivers/net/wireless/ath/ath6kl/wmi.h | 2 ++
5 files changed, 36 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/core.h b/drivers/net/wireless/ath/ath6kl/core.h
index d80b421..50e2771 100644
--- a/drivers/net/wireless/ath/ath6kl/core.h
+++ b/drivers/net/wireless/ath/ath6kl/core.h
@@ -230,6 +230,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;
};
@@ -308,7 +314,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;
@@ -565,7 +574,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;
u16 listen_intvl_b;
u8 lrssi_roam_threshold;
@@ -593,7 +608,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];
diff --git a/drivers/net/wireless/ath/ath6kl/hif.h b/drivers/net/wireless/ath/ath6kl/hif.h
index 904458a..20ed6b7 100644
--- a/drivers/net/wireless/ath/ath6kl/hif.h
+++ b/drivers/net/wireless/ath/ath6kl/hif.h
@@ -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;
diff --git a/drivers/net/wireless/ath/ath6kl/htc.h b/drivers/net/wireless/ath/ath6kl/htc.h
index 2de4d6f..5027ccc 100644
--- a/drivers/net/wireless/ath/ath6kl/htc.h
+++ b/drivers/net/wireless/ath/ath6kl/htc.h
@@ -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;
diff --git a/drivers/net/wireless/ath/ath6kl/sdio.c b/drivers/net/wireless/ath/ath6kl/sdio.c
index da14ca6..144721e 100644
--- a/drivers/net/wireless/ath/ath6kl/sdio.c
+++ b/drivers/net/wireless/ath/ath6kl/sdio.c
@@ -32,6 +32,7 @@
struct ath6kl_sdio {
struct sdio_func *func;
+ /* protects access to bus_req_freeq */
spinlock_t lock;
/* free list */
@@ -53,13 +54,17 @@ struct ath6kl_sdio {
/* Avoids disabling irq while the interrupts being handled */
struct mutex mtx_irq;
+ /* 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;
};
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.h b/drivers/net/wireless/ath/ath6kl/wmi.h
index 38907f4..9137850 100644
--- a/drivers/net/wireless/ath/ath6kl/wmi.h
+++ b/drivers/net/wireless/ath/ath6kl/wmi.h
@@ -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
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 11/12] ath6kl: fix too long lines
2012-02-29 17:18 [PATCH 00/12] ath6kl: checkpatch fixes Kalle Valo
` (9 preceding siblings ...)
2012-02-29 17:19 ` [PATCH 10/12] ath6kl: document all spinlocks Kalle Valo
@ 2012-02-29 17:20 ` Kalle Valo
2012-02-29 17:20 ` [PATCH 12/12] ath6kl: make ath6kl_bmi_[read|write]_hi32() endian safe Kalle Valo
` (2 subsequent siblings)
13 siblings, 0 replies; 22+ messages in thread
From: Kalle Valo @ 2012-02-29 17:20 UTC (permalink / raw)
To: kvalo; +Cc: ath6kl-devel, linux-wireless
Found by checkpatch:
drivers/net/wireless/ath/ath6kl/init.c:78: WARNING: line over 80 characters
drivers/net/wireless/ath/ath6kl/init.c:397: WARNING: line over 80 characters
drivers/net/wireless/ath/ath6kl/init.c:407: WARNING: line over 80 characters
drivers/net/wireless/ath/ath6kl/htc.c:189: WARNING: line over 80 characters
drivers/net/wireless/ath/ath6kl/htc.c:704: WARNING: line over 80 characters
drivers/net/wireless/ath/ath6kl/htc.c:2452: WARNING: line over 80 characters
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/htc.c | 43 ++++++++++++++++----------------
drivers/net/wireless/ath/ath6kl/init.c | 6 ++--
drivers/net/wireless/ath/ath6kl/wmi.h | 4 +--
3 files changed, 27 insertions(+), 26 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/htc.c b/drivers/net/wireless/ath/ath6kl/htc.c
index 24cfc3b..4849d99 100644
--- a/drivers/net/wireless/ath/ath6kl/htc.c
+++ b/drivers/net/wireless/ath/ath6kl/htc.c
@@ -172,31 +172,29 @@ static void ath6kl_credit_reduce(struct ath6kl_htc_credit_info *cred_info,
static void ath6kl_credit_update(struct ath6kl_htc_credit_info *cred_info,
struct list_head *epdist_list)
{
- struct htc_endpoint_credit_dist *cur_dist_list;
+ struct htc_endpoint_credit_dist *cur_list;
- list_for_each_entry(cur_dist_list, epdist_list, list) {
- if (cur_dist_list->endpoint == ENDPOINT_0)
+ list_for_each_entry(cur_list, epdist_list, list) {
+ if (cur_list->endpoint == ENDPOINT_0)
continue;
- if (cur_dist_list->cred_to_dist > 0) {
- cur_dist_list->credits +=
- cur_dist_list->cred_to_dist;
- cur_dist_list->cred_to_dist = 0;
- if (cur_dist_list->credits >
- cur_dist_list->cred_assngd)
+ if (cur_list->cred_to_dist > 0) {
+ cur_list->credits += cur_list->cred_to_dist;
+ cur_list->cred_to_dist = 0;
+
+ if (cur_list->credits > cur_list->cred_assngd)
ath6kl_credit_reduce(cred_info,
- cur_dist_list,
- cur_dist_list->cred_assngd);
+ cur_list,
+ cur_list->cred_assngd);
- if (cur_dist_list->credits >
- cur_dist_list->cred_norm)
- ath6kl_credit_reduce(cred_info, cur_dist_list,
- cur_dist_list->cred_norm);
+ if (cur_list->credits > cur_list->cred_norm)
+ ath6kl_credit_reduce(cred_info, cur_list,
+ cur_list->cred_norm);
- if (!(cur_dist_list->dist_flags & HTC_EP_ACTIVE)) {
- if (cur_dist_list->txq_depth == 0)
+ if (!(cur_list->dist_flags & HTC_EP_ACTIVE)) {
+ if (cur_list->txq_depth == 0)
ath6kl_credit_reduce(cred_info,
- cur_dist_list, 0);
+ cur_list, 0);
}
}
}
@@ -674,6 +672,7 @@ static int ath6kl_htc_tx_setup_scat_list(struct htc_target *target,
struct htc_packet *packet;
int i, len, rem_scat, cred_pad;
int status = 0;
+ u8 flags;
rem_scat = target->max_tx_bndl_sz;
@@ -700,8 +699,8 @@ static int ath6kl_htc_tx_setup_scat_list(struct htc_target *target,
scat_req->scat_list[i].packet = packet;
/* prepare packet and flag message as part of a send bundle */
- ath6kl_htc_tx_prep_pkt(packet,
- packet->info.tx.flags | HTC_FLAGS_SEND_BUNDLE,
+ flags = packet->info.tx.flags | HTC_FLAGS_SEND_BUNDLE;
+ ath6kl_htc_tx_prep_pkt(packet, flags,
cred_pad, packet->info.tx.seqno);
/* Make sure the buffer is 4-byte aligned */
ath6kl_htc_tx_buf_align(&packet->buf,
@@ -2405,6 +2404,7 @@ int ath6kl_htc_conn_service(struct htc_target *target,
enum htc_endpoint_id assigned_ep = ENDPOINT_MAX;
unsigned int max_msg_sz = 0;
int status = 0;
+ u16 msg_id;
ath6kl_dbg(ATH6KL_DBG_HTC,
"htc connect service target 0x%p service id 0x%x\n",
@@ -2448,8 +2448,9 @@ int ath6kl_htc_conn_service(struct htc_target *target,
}
resp_msg = (struct htc_conn_service_resp *)rx_pkt->buf;
+ msg_id = le16_to_cpu(resp_msg->msg_id);
- if ((le16_to_cpu(resp_msg->msg_id) != HTC_MSG_CONN_SVC_RESP_ID) ||
+ if ((msg_id != HTC_MSG_CONN_SVC_RESP_ID) ||
(rx_pkt->act_len < sizeof(*resp_msg))) {
status = -ENOMEM;
goto fail_tx;
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
index c7d5149..231675d 100644
--- a/drivers/net/wireless/ath/ath6kl/init.c
+++ b/drivers/net/wireless/ath/ath6kl/init.c
@@ -75,7 +75,7 @@ static const struct ath6kl_hw hw_list[] = {
},
.fw_board = AR6003_HW_2_1_1_BOARD_DATA_FILE,
- .fw_default_board = AR6003_HW_2_1_1_DEFAULT_BOARD_DATA_FILE,
+ .fw_default_board = AR6003_HW_2_1_1_DEFAULT_BOARD_DATA_FILE,
},
{
.id = AR6004_HW_1_0_VERSION,
@@ -394,7 +394,7 @@ static int ath6kl_target_config_wlan_params(struct ath6kl *ar, int idx)
if (ar->conf_flags & ATH6KL_CONF_IGNORE_PS_FAIL_EVT_IN_SCAN) {
ret = ath6kl_wmi_pmparams_cmd(ar->wmi, idx, 0, 1, 0, 0, 1,
- IGNORE_POWER_SAVE_FAIL_EVENT_DURING_SCAN);
+ IGNORE_PS_FAIL_DURING_SCAN);
if (ret) {
ath6kl_err("unable to set power save fail event policy: %d\n",
ret);
@@ -404,7 +404,7 @@ static int ath6kl_target_config_wlan_params(struct ath6kl *ar, int idx)
if (!(ar->conf_flags & ATH6KL_CONF_IGNORE_ERP_BARKER)) {
ret = ath6kl_wmi_set_lpreamble_cmd(ar->wmi, idx, 0,
- WMI_DONOT_IGNORE_BARKER_IN_ERP);
+ WMI_FOLLOW_BARKER_IN_ERP);
if (ret) {
ath6kl_err("unable to set barker preamble policy: %d\n",
ret);
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.h b/drivers/net/wireless/ath/ath6kl/wmi.h
index 9137850..70bc2f7 100644
--- a/drivers/net/wireless/ath/ath6kl/wmi.h
+++ b/drivers/net/wireless/ath/ath6kl/wmi.h
@@ -1017,7 +1017,7 @@ struct wmi_power_mode_cmd {
*/
enum power_save_fail_event_policy {
SEND_POWER_SAVE_FAIL_EVENT_ALWAYS = 1,
- IGNORE_POWER_SAVE_FAIL_EVENT_DURING_SCAN = 2,
+ IGNORE_PS_FAIL_DURING_SCAN = 2,
};
struct wmi_power_params_cmd {
@@ -1215,7 +1215,7 @@ struct wmi_snr_threshold_params_cmd {
enum wmi_preamble_policy {
WMI_IGNORE_BARKER_IN_ERP = 0,
- WMI_DONOT_IGNORE_BARKER_IN_ERP
+ WMI_FOLLOW_BARKER_IN_ERP,
};
struct wmi_set_lpreamble_cmd {
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 12/12] ath6kl: make ath6kl_bmi_[read|write]_hi32() endian safe
2012-02-29 17:18 [PATCH 00/12] ath6kl: checkpatch fixes Kalle Valo
` (10 preceding siblings ...)
2012-02-29 17:20 ` [PATCH 11/12] ath6kl: fix too long lines Kalle Valo
@ 2012-02-29 17:20 ` Kalle Valo
2012-02-29 17:37 ` [PATCH 00/12] ath6kl: checkpatch fixes Joe Perches
2012-03-07 19:01 ` Kalle Valo
13 siblings, 0 replies; 22+ messages in thread
From: Kalle Valo @ 2012-02-29 17:20 UTC (permalink / raw)
To: kvalo; +Cc: ath6kl-devel, linux-wireless
ath6kl_bmi_[read|write]_hi32() did not have endian support, fix that.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/bmi.h | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/bmi.h b/drivers/net/wireless/ath/ath6kl/bmi.h
index 3c5b382..18fdd69 100644
--- a/drivers/net/wireless/ath/ath6kl/bmi.h
+++ b/drivers/net/wireless/ath/ath6kl/bmi.h
@@ -225,18 +225,25 @@ struct ath6kl_bmi_target_info {
#define ath6kl_bmi_write_hi32(ar, item, val) \
({ \
- u32 addr, v; \
+ u32 addr; \
+ __le32 v; \
+ \
addr = ath6kl_get_hi_item_addr(ar, HI_ITEM(item)); \
- v = val; \
+ v = cpu_to_le32(val); \
ath6kl_bmi_write(ar, addr, (u8 *) &v, sizeof(v)); \
})
#define ath6kl_bmi_read_hi32(ar, item, val) \
({ \
u32 addr, *check_type = val; \
+ __le32 tmp; \
+ int ret; \
+ \
(void) (check_type == val); \
addr = ath6kl_get_hi_item_addr(ar, HI_ITEM(item)); \
- ath6kl_bmi_read(ar, addr, (u8 *) val, 4); \
+ ret = ath6kl_bmi_read(ar, addr, (u8 *) &tmp, 4); \
+ *val = le32_to_cpu(tmp); \
+ ret; \
})
int ath6kl_bmi_init(struct ath6kl *ar);
^ permalink raw reply related [flat|nested] 22+ messages in thread
* Re: [PATCH 00/12] ath6kl: checkpatch fixes
2012-02-29 17:18 [PATCH 00/12] ath6kl: checkpatch fixes Kalle Valo
` (11 preceding siblings ...)
2012-02-29 17:20 ` [PATCH 12/12] ath6kl: make ath6kl_bmi_[read|write]_hi32() endian safe Kalle Valo
@ 2012-02-29 17:37 ` Joe Perches
2012-02-29 17:41 ` Kalle Valo
2012-03-07 19:01 ` Kalle Valo
13 siblings, 1 reply; 22+ messages in thread
From: Joe Perches @ 2012-02-29 17:37 UTC (permalink / raw)
To: Kalle Valo; +Cc: ath6kl-devel, linux-wireless
On Wed, 2012-02-29 at 19:18 +0200, Kalle Valo wrote:
> Here are quite a few checkpatch fixes and other cleanups.
>
> Especially I would like to people review these two macros, they ended up
> a bit too clever and I'm sure there are issues:
>
> #define ath6kl_bmi_write_hi32(ar, item, val) \
> ({ \
> u32 addr; \
> __le32 v; \
> \
> addr = ath6kl_get_hi_item_addr(ar, HI_ITEM(item)); \
> v = cpu_to_le32(val); \
> ath6kl_bmi_write(ar, addr, (u8 *) &v, sizeof(v)); \
> })
>
> #define ath6kl_bmi_read_hi32(ar, item, val) \
> ({ \
> u32 addr, *check_type = val; \
> __le32 tmp; \
> int ret; \
> \
> (void) (check_type == val); \
> addr = ath6kl_get_hi_item_addr(ar, HI_ITEM(item)); \
> ret = ath6kl_bmi_read(ar, addr, (u8 *) &tmp, 4); \
> *val = le32_to_cpu(tmp); \
> ret; \
> })
Why not just make these functions?
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 00/12] ath6kl: checkpatch fixes
2012-02-29 17:37 ` [PATCH 00/12] ath6kl: checkpatch fixes Joe Perches
@ 2012-02-29 17:41 ` Kalle Valo
2012-02-29 18:21 ` Joe Perches
0 siblings, 1 reply; 22+ messages in thread
From: Kalle Valo @ 2012-02-29 17:41 UTC (permalink / raw)
To: Joe Perches; +Cc: ath6kl-devel, linux-wireless
On 02/29/2012 07:37 PM, Joe Perches wrote:
> On Wed, 2012-02-29 at 19:18 +0200, Kalle Valo wrote:
>> Here are quite a few checkpatch fixes and other cleanups.
>>
>> Especially I would like to people review these two macros, they ended up
>> a bit too clever and I'm sure there are issues:
>>
>> #define ath6kl_bmi_write_hi32(ar, item, val) \
>> ({ \
>> u32 addr; \
>> __le32 v; \
>> \
>> addr = ath6kl_get_hi_item_addr(ar, HI_ITEM(item)); \
>> v = cpu_to_le32(val); \
>> ath6kl_bmi_write(ar, addr, (u8 *) &v, sizeof(v)); \
>> })
>>
>> #define ath6kl_bmi_read_hi32(ar, item, val) \
>> ({ \
>> u32 addr, *check_type = val; \
>> __le32 tmp; \
>> int ret; \
>> \
>> (void) (check_type == val); \
>> addr = ath6kl_get_hi_item_addr(ar, HI_ITEM(item)); \
>> ret = ath6kl_bmi_read(ar, addr, (u8 *) &tmp, 4); \
>> *val = le32_to_cpu(tmp); \
>> ret; \
>> })
>
> Why not just make these functions?
Because of the HI_ITEM() macro I can't pass the item parameter to a
function:
#define HI_ITEM(item) offsetof(struct host_interest, item)
I'm planning to change how host interest address are handled at some
point, but I don't have time to do that right now.
Kalle
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 00/12] ath6kl: checkpatch fixes
2012-02-29 17:41 ` Kalle Valo
@ 2012-02-29 18:21 ` Joe Perches
2012-03-05 16:33 ` Kalle Valo
2012-03-07 17:57 ` Kalle Valo
0 siblings, 2 replies; 22+ messages in thread
From: Joe Perches @ 2012-02-29 18:21 UTC (permalink / raw)
To: Kalle Valo; +Cc: ath6kl-devel, linux-wireless
On Wed, 2012-02-29 at 19:41 +0200, Kalle Valo wrote:
> On 02/29/2012 07:37 PM, Joe Perches wrote:
> > On Wed, 2012-02-29 at 19:18 +0200, Kalle Valo wrote:
> >> Here are quite a few checkpatch fixes and other cleanups.
> >>
> >> Especially I would like to people review these two macros, they ended up
> >> a bit too clever and I'm sure there are issues:
> >>
> >> #define ath6kl_bmi_write_hi32(ar, item, val) \
> >> ({ \
> >> u32 addr; \
> >> __le32 v; \
> >> \
> >> addr = ath6kl_get_hi_item_addr(ar, HI_ITEM(item)); \
> >> v = cpu_to_le32(val); \
> >> ath6kl_bmi_write(ar, addr, (u8 *) &v, sizeof(v)); \
> >> })
> >>
> >> #define ath6kl_bmi_read_hi32(ar, item, val) \
> >> ({ \
> >> u32 addr, *check_type = val; \
> >> __le32 tmp; \
> >> int ret; \
> >> \
> >> (void) (check_type == val); \
> >> addr = ath6kl_get_hi_item_addr(ar, HI_ITEM(item)); \
> >> ret = ath6kl_bmi_read(ar, addr, (u8 *) &tmp, 4); \
> >> *val = le32_to_cpu(tmp); \
> >> ret; \
> >> })
> >
> > Why not just make these functions?
>
> Because of the HI_ITEM() macro I can't pass the item parameter to a
> function:
>
> #define HI_ITEM(item) offsetof(struct host_interest, item)
Perhaps something like:
void _ath6kl_bmi_write_hi32(struct ath6kl ar, size_t offset, u32 *val)
{
u32 addr;
__le32 v;
addr = ath6kl_get_hi_item_addr(ar, offset);
v = cpu_to_le32(*val);
ath6kl_bmi_write(ar, addr, (u8 *)&v, sizeof(v));
}
#define ath6kl_bmi_write_hi32(ar, item, val) \
_ath6kl_bmi_write_hi32(ar, HI_ITEM(item), &(val))
etc...
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 00/12] ath6kl: checkpatch fixes
2012-02-29 18:21 ` Joe Perches
@ 2012-03-05 16:33 ` Kalle Valo
2012-03-07 17:57 ` Kalle Valo
1 sibling, 0 replies; 22+ messages in thread
From: Kalle Valo @ 2012-03-05 16:33 UTC (permalink / raw)
To: Joe Perches; +Cc: ath6kl-devel, linux-wireless
On 02/29/2012 08:21 PM, Joe Perches wrote:
> On Wed, 2012-02-29 at 19:41 +0200, Kalle Valo wrote:
>> On 02/29/2012 07:37 PM, Joe Perches wrote:
>>
>>> Why not just make these functions?
>>
>> Because of the HI_ITEM() macro I can't pass the item parameter to a
>> function:
>>
>> #define HI_ITEM(item) offsetof(struct host_interest, item)
>
> Perhaps something like:
> void _ath6kl_bmi_write_hi32(struct ath6kl ar, size_t offset, u32 *val)
> {
> u32 addr;
> __le32 v;
>
> addr = ath6kl_get_hi_item_addr(ar, offset);
> v = cpu_to_le32(*val);
> ath6kl_bmi_write(ar, addr, (u8 *)&v, sizeof(v));
> }
>
> #define ath6kl_bmi_write_hi32(ar, item, val) \
> _ath6kl_bmi_write_hi32(ar, HI_ITEM(item), &(val))
>
> etc...
This is much better, I use this style. Thanks.
Kalle
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 00/12] ath6kl: checkpatch fixes
2012-02-29 18:21 ` Joe Perches
2012-03-05 16:33 ` Kalle Valo
@ 2012-03-07 17:57 ` Kalle Valo
2012-03-07 18:37 ` Joe Perches
1 sibling, 1 reply; 22+ messages in thread
From: Kalle Valo @ 2012-03-07 17:57 UTC (permalink / raw)
To: Joe Perches; +Cc: ath6kl-devel, linux-wireless
On 02/29/2012 08:21 PM, Joe Perches wrote:
> On Wed, 2012-02-29 at 19:41 +0200, Kalle Valo wrote:
>> On 02/29/2012 07:37 PM, Joe Perches wrote:
>>
>>> Why not just make these functions?
>>
>> Because of the HI_ITEM() macro I can't pass the item parameter to a
>> function:
>>
>> #define HI_ITEM(item) offsetof(struct host_interest, item)
>
> Perhaps something like:
> void _ath6kl_bmi_write_hi32(struct ath6kl ar, size_t offset, u32 *val)
> {
> u32 addr;
> __le32 v;
>
> addr = ath6kl_get_hi_item_addr(ar, offset);
> v = cpu_to_le32(*val);
> ath6kl_bmi_write(ar, addr, (u8 *)&v, sizeof(v));
> }
>
> #define ath6kl_bmi_write_hi32(ar, item, val) \
> _ath6kl_bmi_write_hi32(ar, HI_ITEM(item), &(val))
I tried this but actually this ends to a header file dependency hell. I
don't want to deal with that right now so I have to use the original macros.
Kalle
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 00/12] ath6kl: checkpatch fixes
2012-03-07 17:57 ` Kalle Valo
@ 2012-03-07 18:37 ` Joe Perches
0 siblings, 0 replies; 22+ messages in thread
From: Joe Perches @ 2012-03-07 18:37 UTC (permalink / raw)
To: Kalle Valo; +Cc: ath6kl-devel, linux-wireless
On Wed, 2012-03-07 at 19:57 +0200, Kalle Valo wrote:
> On 02/29/2012 08:21 PM, Joe Perches wrote:
> > On Wed, 2012-02-29 at 19:41 +0200, Kalle Valo wrote:
> >> On 02/29/2012 07:37 PM, Joe Perches wrote:
> >>> Why not just make these functions?
> >> Because of the HI_ITEM() macro I can't pass the item parameter to a
> >> function:
> >> #define HI_ITEM(item) offsetof(struct host_interest, item)
> > Perhaps something like:
> > void _ath6kl_bmi_write_hi32(struct ath6kl ar, size_t offset, u32 *val)
> > {
> > u32 addr;
> > __le32 v;
> >
> > addr = ath6kl_get_hi_item_addr(ar, offset);
> > v = cpu_to_le32(*val);
> > ath6kl_bmi_write(ar, addr, (u8 *)&v, sizeof(v));
> > }
> > #define ath6kl_bmi_write_hi32(ar, item, val) \
> > _ath6kl_bmi_write_hi32(ar, HI_ITEM(item), &(val))
>
> I tried this but actually this ends to a header file dependency hell. I
> don't want to deal with that right now so I have to use the original macros.
No worries.
When your series is stable, maybe I'll play with it.
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 00/12] ath6kl: checkpatch fixes
2012-02-29 17:18 [PATCH 00/12] ath6kl: checkpatch fixes Kalle Valo
` (12 preceding siblings ...)
2012-02-29 17:37 ` [PATCH 00/12] ath6kl: checkpatch fixes Joe Perches
@ 2012-03-07 19:01 ` Kalle Valo
13 siblings, 0 replies; 22+ messages in thread
From: Kalle Valo @ 2012-03-07 19:01 UTC (permalink / raw)
To: Kalle Valo; +Cc: ath6kl-devel, linux-wireless
On 02/29/2012 07:18 PM, Kalle Valo wrote:
> Here are quite a few checkpatch fixes and other cleanups.
All 12 patches applied.
Kalle
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 03/12] ath6kl: alignment should match open parenthesis
2012-02-29 17:18 ` [PATCH 03/12] ath6kl: alignment should match open parenthesis Kalle Valo
@ 2012-03-07 19:26 ` Joe Perches
2012-03-07 20:18 ` Kalle Valo
0 siblings, 1 reply; 22+ messages in thread
From: Joe Perches @ 2012-03-07 19:26 UTC (permalink / raw)
To: Kalle Valo; +Cc: ath6kl-devel, linux-wireless
On Wed, 2012-02-29 at 19:18 +0200, Kalle Valo wrote:
> Fix the issues which checkpatch found and were easy to fix. Especially
> callers of ath6kl_bmi_write() are tricky and that needs to be fixed
> separately.
Just a trivial note.
> diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
[]
> @@ -390,7 +390,7 @@ static bool ath6kl_is_valid_iftype(struct ath6kl *ar, enum nl80211_iftype type,
> return false;
>
> if (ar->ibss_if_active || ((type == NL80211_IFTYPE_ADHOC) &&
> - ar->num_vif))
> + ar->num_vif))
I think this would be better as:
if (ar->ibss_if_active ||
(type == NL80211_IFTYPE_ADHOC && ar->num_vif))
Bundling dependent tests on a single line is sensible.
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 03/12] ath6kl: alignment should match open parenthesis
2012-03-07 19:26 ` Joe Perches
@ 2012-03-07 20:18 ` Kalle Valo
0 siblings, 0 replies; 22+ messages in thread
From: Kalle Valo @ 2012-03-07 20:18 UTC (permalink / raw)
To: Joe Perches; +Cc: ath6kl-devel, linux-wireless
On 03/07/2012 09:26 PM, Joe Perches wrote:
> On Wed, 2012-02-29 at 19:18 +0200, Kalle Valo wrote:
>> Fix the issues which checkpatch found and were easy to fix. Especially
>> callers of ath6kl_bmi_write() are tricky and that needs to be fixed
>> separately.
>
> Just a trivial note.
>
>> diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
> []
>> @@ -390,7 +390,7 @@ static bool ath6kl_is_valid_iftype(struct ath6kl *ar, enum nl80211_iftype type,
>> return false;
>>
>> if (ar->ibss_if_active || ((type == NL80211_IFTYPE_ADHOC) &&
>> - ar->num_vif))
>> + ar->num_vif))
>
> I think this would be better as:
>
> if (ar->ibss_if_active ||
> (type == NL80211_IFTYPE_ADHOC && ar->num_vif))
>
> Bundling dependent tests on a single line is sensible.
I agree, but I just pushed this patch and I can't change it anymore. I
try to remember this in the future.
Kalle
^ permalink raw reply [flat|nested] 22+ messages in thread
end of thread, other threads:[~2012-03-07 20:18 UTC | newest]
Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-29 17:18 [PATCH 00/12] ath6kl: checkpatch fixes Kalle Valo
2012-02-29 17:18 ` [PATCH 01/12] ath6kl: fix pointer style Kalle Valo
2012-02-29 17:18 ` [PATCH 02/12] ath6kl: fix checkpatch error with EPSTAT() macro Kalle Valo
2012-02-29 17:18 ` [PATCH 03/12] ath6kl: alignment should match open parenthesis Kalle Valo
2012-03-07 19:26 ` Joe Perches
2012-03-07 20:18 ` Kalle Valo
2012-02-29 17:19 ` [PATCH 04/12] ath6kl: logical continuations should be on the previous line Kalle Valo
2012-02-29 17:19 ` [PATCH 05/12] ath6kl: remove multiple assignments Kalle Valo
2012-02-29 17:19 ` [PATCH 06/12] ath6kl: add ath6kl_bmi_write_hi32() Kalle Valo
2012-02-29 17:19 ` [PATCH 07/12] ath6kl: add ath6kl_bmi_read_hi32() Kalle Valo
2012-02-29 17:19 ` [PATCH 08/12] ath6kl: fix error handling ath6kl_target_config_wlan_params() Kalle Valo
2012-02-29 17:19 ` [PATCH 09/12] ath6kl: fix open paranthesis alignment in ath6kl_cfg80211_connect() Kalle Valo
2012-02-29 17:19 ` [PATCH 10/12] ath6kl: document all spinlocks Kalle Valo
2012-02-29 17:20 ` [PATCH 11/12] ath6kl: fix too long lines Kalle Valo
2012-02-29 17:20 ` [PATCH 12/12] ath6kl: make ath6kl_bmi_[read|write]_hi32() endian safe Kalle Valo
2012-02-29 17:37 ` [PATCH 00/12] ath6kl: checkpatch fixes Joe Perches
2012-02-29 17:41 ` Kalle Valo
2012-02-29 18:21 ` Joe Perches
2012-03-05 16:33 ` Kalle Valo
2012-03-07 17:57 ` Kalle Valo
2012-03-07 18:37 ` Joe Perches
2012-03-07 19:01 ` Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).