Skip to content

Commit 12d9568

Browse files
committed
Merge branch 'for-linville' of git://github.com/kvalo/ath6kl
2 parents 5f561f6 + f374057 commit 12d9568

13 files changed

Lines changed: 455 additions & 178 deletions

File tree

‎drivers/net/wireless/ath/ath6kl/cfg80211.c‎

Lines changed: 167 additions & 71 deletions
Large diffs are not rendered by default.

‎drivers/net/wireless/ath/ath6kl/cfg80211.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ enum ath6kl_cfg_suspend_mode {
2828
struct net_device *ath6kl_interface_add(struct ath6kl *ar, char *name,
2929
enum nl80211_iftype type,
3030
u8 fw_vif_idx, u8 nw_type);
31+
void ath6kl_cfg80211_ch_switch_notify(struct ath6kl_vif *vif, int freq,
32+
enum wmi_phy_mode mode);
3133
void ath6kl_cfg80211_scan_complete_event(struct ath6kl_vif *vif, bool aborted);
3234

3335
void ath6kl_cfg80211_connect_event(struct ath6kl_vif *vif, u16 channel,

‎drivers/net/wireless/ath/ath6kl/core.h‎

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ struct ath6kl_fw_ie {
126126
#define AR6003_HW_2_0_FIRMWARE_FILE "athwlan.bin.z77"
127127
#define AR6003_HW_2_0_TCMD_FIRMWARE_FILE "athtcmd_ram.bin"
128128
#define AR6003_HW_2_0_PATCH_FILE "data.patch.bin"
129-
#define AR6003_HW_2_0_BOARD_DATA_FILE "ath6k/AR6003/hw2.0/bdata.bin"
129+
#define AR6003_HW_2_0_BOARD_DATA_FILE AR6003_HW_2_0_FW_DIR "/bdata.bin"
130130
#define AR6003_HW_2_0_DEFAULT_BOARD_DATA_FILE \
131-
"ath6k/AR6003/hw2.0/bdata.SD31.bin"
131+
AR6003_HW_2_0_FW_DIR "/bdata.SD31.bin"
132132

133133
/* AR6003 3.0 definitions */
134134
#define AR6003_HW_2_1_1_VERSION 0x30000582
@@ -139,25 +139,33 @@ struct ath6kl_fw_ie {
139139
#define AR6003_HW_2_1_1_UTF_FIRMWARE_FILE "utf.bin"
140140
#define AR6003_HW_2_1_1_TESTSCRIPT_FILE "nullTestFlow.bin"
141141
#define AR6003_HW_2_1_1_PATCH_FILE "data.patch.bin"
142-
#define AR6003_HW_2_1_1_BOARD_DATA_FILE "ath6k/AR6003/hw2.1.1/bdata.bin"
142+
#define AR6003_HW_2_1_1_BOARD_DATA_FILE AR6003_HW_2_1_1_FW_DIR "/bdata.bin"
143143
#define AR6003_HW_2_1_1_DEFAULT_BOARD_DATA_FILE \
144-
"ath6k/AR6003/hw2.1.1/bdata.SD31.bin"
144+
AR6003_HW_2_1_1_FW_DIR "/bdata.SD31.bin"
145145

146146
/* AR6004 1.0 definitions */
147147
#define AR6004_HW_1_0_VERSION 0x30000623
148148
#define AR6004_HW_1_0_FW_DIR "ath6k/AR6004/hw1.0"
149149
#define AR6004_HW_1_0_FIRMWARE_FILE "fw.ram.bin"
150-
#define AR6004_HW_1_0_BOARD_DATA_FILE "ath6k/AR6004/hw1.0/bdata.bin"
150+
#define AR6004_HW_1_0_BOARD_DATA_FILE AR6004_HW_1_0_FW_DIR "/bdata.bin"
151151
#define AR6004_HW_1_0_DEFAULT_BOARD_DATA_FILE \
152-
"ath6k/AR6004/hw1.0/bdata.DB132.bin"
152+
AR6004_HW_1_0_FW_DIR "/bdata.DB132.bin"
153153

154154
/* AR6004 1.1 definitions */
155155
#define AR6004_HW_1_1_VERSION 0x30000001
156156
#define AR6004_HW_1_1_FW_DIR "ath6k/AR6004/hw1.1"
157157
#define AR6004_HW_1_1_FIRMWARE_FILE "fw.ram.bin"
158-
#define AR6004_HW_1_1_BOARD_DATA_FILE "ath6k/AR6004/hw1.1/bdata.bin"
158+
#define AR6004_HW_1_1_BOARD_DATA_FILE AR6004_HW_1_1_FW_DIR "/bdata.bin"
159159
#define AR6004_HW_1_1_DEFAULT_BOARD_DATA_FILE \
160-
"ath6k/AR6004/hw1.1/bdata.DB132.bin"
160+
AR6004_HW_1_1_FW_DIR "/bdata.DB132.bin"
161+
162+
/* AR6004 1.2 definitions */
163+
#define AR6004_HW_1_2_VERSION 0x300007e8
164+
#define AR6004_HW_1_2_FW_DIR "ath6k/AR6004/hw1.2"
165+
#define AR6004_HW_1_2_FIRMWARE_FILE "fw.ram.bin"
166+
#define AR6004_HW_1_2_BOARD_DATA_FILE AR6004_HW_1_2_FW_DIR "/bdata.bin"
167+
#define AR6004_HW_1_2_DEFAULT_BOARD_DATA_FILE \
168+
AR6004_HW_1_2_FW_DIR "/bdata.bin"
161169

162170
/* Per STA data, used in AP mode */
163171
#define STA_PS_AWAKE BIT(0)
@@ -502,6 +510,8 @@ enum ath6kl_vif_state {
502510
WLAN_ENABLED,
503511
STATS_UPDATE_PEND,
504512
HOST_SLEEP_MODE_CMD_PROCESSED,
513+
NETDEV_MCAST_ALL_ON,
514+
NETDEV_MCAST_ALL_OFF,
505515
};
506516

507517
struct ath6kl_vif {
@@ -549,9 +559,11 @@ struct ath6kl_vif {
549559
u16 assoc_bss_beacon_int;
550560
u16 listen_intvl_t;
551561
u16 bmiss_time_t;
562+
u16 bg_scan_period;
552563
u8 assoc_bss_dtim_period;
553564
struct net_device_stats net_stats;
554565
struct target_stats target_stats;
566+
struct wmi_connect_cmd profile;
555567

556568
struct list_head mc_filter;
557569
};
@@ -640,6 +652,7 @@ struct ath6kl {
640652
u8 sta_list_index;
641653
struct ath6kl_req_key ap_mode_bkey;
642654
struct sk_buff_head mcastpsq;
655+
u32 want_ch_switch;
643656

644657
/*
645658
* FIXME: protects access to mcastpsq but is actually useless as
@@ -672,6 +685,7 @@ struct ath6kl {
672685
u32 refclk_hz;
673686
u32 uarttx_pin;
674687
u32 testscript_addr;
688+
enum wmi_phy_cap cap;
675689

676690
struct ath6kl_hw_fw {
677691
const char *dir;
@@ -805,7 +819,8 @@ void aggr_reset_state(struct aggr_info_conn *aggr_conn);
805819
struct ath6kl_sta *ath6kl_find_sta(struct ath6kl_vif *vif, u8 *node_addr);
806820
struct ath6kl_sta *ath6kl_find_sta_by_aid(struct ath6kl *ar, u8 aid);
807821

808-
void ath6kl_ready_event(void *devt, u8 *datap, u32 sw_ver, u32 abi_ver);
822+
void ath6kl_ready_event(void *devt, u8 *datap, u32 sw_ver, u32 abi_ver,
823+
enum wmi_phy_cap cap);
809824
int ath6kl_control_tx(void *devt, struct sk_buff *skb,
810825
enum htc_endpoint_id eid);
811826
void ath6kl_connect_event(struct ath6kl_vif *vif, u16 channel,

‎drivers/net/wireless/ath/ath6kl/debug.c‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,8 +401,10 @@ static ssize_t ath6kl_fwlog_block_read(struct file *file,
401401

402402
ret = wait_for_completion_interruptible(
403403
&ar->debug.fwlog_completion);
404-
if (ret == -ERESTARTSYS)
404+
if (ret == -ERESTARTSYS) {
405+
vfree(buf);
405406
return ret;
407+
}
406408

407409
spin_lock(&ar->debug.fwlog_queue.lock);
408410
}
@@ -1570,10 +1572,15 @@ static ssize_t ath6kl_bgscan_int_write(struct file *file,
15701572
size_t count, loff_t *ppos)
15711573
{
15721574
struct ath6kl *ar = file->private_data;
1575+
struct ath6kl_vif *vif;
15731576
u16 bgscan_int;
15741577
char buf[32];
15751578
ssize_t len;
15761579

1580+
vif = ath6kl_vif_first(ar);
1581+
if (!vif)
1582+
return -EIO;
1583+
15771584
len = min(count, sizeof(buf) - 1);
15781585
if (copy_from_user(buf, user_buf, len))
15791586
return -EFAULT;
@@ -1585,6 +1592,8 @@ static ssize_t ath6kl_bgscan_int_write(struct file *file,
15851592
if (bgscan_int == 0)
15861593
bgscan_int = 0xffff;
15871594

1595+
vif->bg_scan_period = bgscan_int;
1596+
15881597
ath6kl_wmi_scanparams_cmd(ar->wmi, 0, 0, 0, bgscan_int, 0, 0, 0, 3,
15891598
0, 0, 0);
15901599

@@ -1809,6 +1818,7 @@ int ath6kl_debug_init_fs(struct ath6kl *ar)
18091818
void ath6kl_debug_cleanup(struct ath6kl *ar)
18101819
{
18111820
skb_queue_purge(&ar->debug.fwlog_queue);
1821+
complete(&ar->debug.fwlog_completion);
18121822
kfree(ar->debug.roam_tbl);
18131823
}
18141824

‎drivers/net/wireless/ath/ath6kl/htc_mbox.c‎

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,7 @@ static void ath6kl_credit_init(struct ath6kl_htc_credit_info *cred_info,
8383
* never goes inactive EVER.
8484
*/
8585
cur_ep_dist->dist_flags |= HTC_EP_ACTIVE;
86-
} else if (cur_ep_dist->svc_id == WMI_DATA_BK_SVC)
87-
/* this is the lowest priority data endpoint */
88-
/* FIXME: this looks fishy, check */
89-
cred_info->lowestpri_ep_dist = cur_ep_dist->list;
86+
}
9087

9188
/*
9289
* Streams have to be created (explicit | implicit) for all
@@ -100,6 +97,13 @@ static void ath6kl_credit_init(struct ath6kl_htc_credit_info *cred_info,
10097
*/
10198
}
10299

100+
/*
101+
* For ath6kl_credit_seek function,
102+
* it use list_for_each_entry_reverse to walk around the whole ep list.
103+
* Therefore assign this lowestpri_ep_dist after walk around the ep_list
104+
*/
105+
cred_info->lowestpri_ep_dist = cur_ep_dist->list;
106+
103107
WARN_ON(cred_info->cur_free_credits <= 0);
104108

105109
list_for_each_entry(cur_ep_dist, ep_list, list) {
@@ -758,7 +762,7 @@ static void ath6kl_htc_tx_bundle(struct htc_endpoint *endpoint,
758762
u32 txb_mask;
759763
u8 ac = WMM_NUM_AC;
760764

761-
if ((HTC_CTRL_RSVD_SVC != endpoint->svc_id) ||
765+
if ((HTC_CTRL_RSVD_SVC != endpoint->svc_id) &&
762766
(WMI_CONTROL_SVC != endpoint->svc_id))
763767
ac = target->dev->ar->ep2ac_map[endpoint->eid];
764768

@@ -793,16 +797,17 @@ static void ath6kl_htc_tx_bundle(struct htc_endpoint *endpoint,
793797
* itself
794798
*/
795799
txb_mask = ((1 << ac) - 1);
796-
/*
797-
* when the scatter request resources drop below a
798-
* certain threshold, disable Tx bundling for all
799-
* AC's with priority lower than the current requesting
800-
* AC. Otherwise re-enable Tx bundling for them
801-
*/
802-
if (scat_req->scat_q_depth < ATH6KL_SCATTER_REQS)
803-
target->tx_bndl_mask &= ~txb_mask;
804-
else
805-
target->tx_bndl_mask |= txb_mask;
800+
801+
/*
802+
* when the scatter request resources drop below a
803+
* certain threshold, disable Tx bundling for all
804+
* AC's with priority lower than the current requesting
805+
* AC. Otherwise re-enable Tx bundling for them
806+
*/
807+
if (scat_req->scat_q_depth < ATH6KL_SCATTER_REQS)
808+
target->tx_bndl_mask &= ~txb_mask;
809+
else
810+
target->tx_bndl_mask |= txb_mask;
806811
}
807812

808813
ath6kl_dbg(ATH6KL_DBG_HTC, "htc tx pkts to scatter: %d\n",
@@ -849,6 +854,7 @@ static void ath6kl_htc_tx_from_queue(struct htc_target *target,
849854
int bundle_sent;
850855
int n_pkts_bundle;
851856
u8 ac = WMM_NUM_AC;
857+
int status;
852858

853859
spin_lock_bh(&target->tx_lock);
854860

@@ -866,7 +872,7 @@ static void ath6kl_htc_tx_from_queue(struct htc_target *target,
866872
*/
867873
INIT_LIST_HEAD(&txq);
868874

869-
if ((HTC_CTRL_RSVD_SVC != endpoint->svc_id) ||
875+
if ((HTC_CTRL_RSVD_SVC != endpoint->svc_id) &&
870876
(WMI_CONTROL_SVC != endpoint->svc_id))
871877
ac = target->dev->ar->ep2ac_map[endpoint->eid];
872878

@@ -910,7 +916,12 @@ static void ath6kl_htc_tx_from_queue(struct htc_target *target,
910916

911917
ath6kl_htc_tx_prep_pkt(packet, packet->info.tx.flags,
912918
0, packet->info.tx.seqno);
913-
ath6kl_htc_tx_issue(target, packet);
919+
status = ath6kl_htc_tx_issue(target, packet);
920+
921+
if (status) {
922+
packet->status = status;
923+
packet->completion(packet->context, packet);
924+
}
914925
}
915926

916927
spin_lock_bh(&target->tx_lock);

‎drivers/net/wireless/ath/ath6kl/htc_pipe.c‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,6 @@ static void get_htc_packet_credit_based(struct htc_target *target,
108108

109109
/* get packet at head, but don't remove it */
110110
packet = list_first_entry(&ep->txq, struct htc_packet, list);
111-
if (packet == NULL)
112-
break;
113111

114112
ath6kl_dbg(ATH6KL_DBG_HTC,
115113
"%s: got head packet:0x%p , queue depth: %d\n",
@@ -803,8 +801,6 @@ static int htc_send_packets_multiple(struct htc_target *target,
803801

804802
/* get first packet to find out which ep the packets will go into */
805803
packet = list_first_entry(pkt_queue, struct htc_packet, list);
806-
if (packet == NULL)
807-
return -EINVAL;
808804

809805
if (packet->endpoint >= ENDPOINT_MAX) {
810806
WARN_ON_ONCE(1);
@@ -1382,6 +1378,9 @@ static int ath6kl_htc_pipe_conn_service(struct htc_target *target,
13821378
/* copy all the callbacks */
13831379
ep->ep_cb = conn_req->ep_cb;
13841380

1381+
/* initialize tx_drop_packet_threshold */
1382+
ep->tx_drop_packet_threshold = MAX_HI_COOKIE_NUM;
1383+
13851384
status = ath6kl_hif_pipe_map_service(ar, ep->svc_id,
13861385
&ep->pipe.pipeid_ul,
13871386
&ep->pipe.pipeid_dl);
@@ -1636,10 +1635,6 @@ static int ath6kl_htc_pipe_add_rxbuf_multiple(struct htc_target *target,
16361635
return -EINVAL;
16371636

16381637
first = list_first_entry(pkt_queue, struct htc_packet, list);
1639-
if (first == NULL) {
1640-
WARN_ON_ONCE(1);
1641-
return -EINVAL;
1642-
}
16431638

16441639
if (first->endpoint >= ENDPOINT_MAX) {
16451640
WARN_ON_ONCE(1);

‎drivers/net/wireless/ath/ath6kl/init.c‎

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,24 @@ static const struct ath6kl_hw hw_list[] = {
119119
.fw_board = AR6004_HW_1_1_BOARD_DATA_FILE,
120120
.fw_default_board = AR6004_HW_1_1_DEFAULT_BOARD_DATA_FILE,
121121
},
122+
{
123+
.id = AR6004_HW_1_2_VERSION,
124+
.name = "ar6004 hw 1.2",
125+
.dataset_patch_addr = 0x436ecc,
126+
.app_load_addr = 0x1234,
127+
.board_ext_data_addr = 0x437000,
128+
.reserved_ram_size = 9216,
129+
.board_addr = 0x435c00,
130+
.refclk_hz = 40000000,
131+
.uarttx_pin = 11,
132+
133+
.fw = {
134+
.dir = AR6004_HW_1_2_FW_DIR,
135+
.fw = AR6004_HW_1_2_FIRMWARE_FILE,
136+
},
137+
.fw_board = AR6004_HW_1_2_BOARD_DATA_FILE,
138+
.fw_default_board = AR6004_HW_1_2_DEFAULT_BOARD_DATA_FILE,
139+
},
122140
};
123141

124142
/*
@@ -445,9 +463,9 @@ static int ath6kl_target_config_wlan_params(struct ath6kl *ar, int idx)
445463
P2P_FLAG_MACADDR_REQ |
446464
P2P_FLAG_HMODEL_REQ);
447465
if (ret) {
448-
ath6kl_dbg(ATH6KL_DBG_TRC, "failed to request P2P "
449-
"capabilities (%d) - assuming P2P not "
450-
"supported\n", ret);
466+
ath6kl_dbg(ATH6KL_DBG_TRC,
467+
"failed to request P2P capabilities (%d) - assuming P2P not supported\n",
468+
ret);
451469
ar->p2p = false;
452470
}
453471
}
@@ -456,8 +474,9 @@ static int ath6kl_target_config_wlan_params(struct ath6kl *ar, int idx)
456474
/* Enable Probe Request reporting for P2P */
457475
ret = ath6kl_wmi_probe_report_req_cmd(ar->wmi, idx, true);
458476
if (ret) {
459-
ath6kl_dbg(ATH6KL_DBG_TRC, "failed to enable Probe "
460-
"Request reporting (%d)\n", ret);
477+
ath6kl_dbg(ATH6KL_DBG_TRC,
478+
"failed to enable Probe Request reporting (%d)\n",
479+
ret);
461480
}
462481
}
463482

0 commit comments

Comments
 (0)