Commit 9d3586fe authored by Jérôme Pouiller's avatar Jérôme Pouiller Committed by Greg Kroah-Hartman

staging: wfx: prefix structs hif_* with wfx_

All the types related to a driver should use the same prefix.
Signed-off-by: default avatarJérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20220113085524.1110708-19-Jerome.Pouiller@silabs.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 822d2499
...@@ -67,7 +67,7 @@ static void device_release(struct wfx_dev *wdev) ...@@ -67,7 +67,7 @@ static void device_release(struct wfx_dev *wdev)
static int rx_helper(struct wfx_dev *wdev, size_t read_len, int *is_cnf) static int rx_helper(struct wfx_dev *wdev, size_t read_len, int *is_cnf)
{ {
struct sk_buff *skb; struct sk_buff *skb;
struct hif_msg *hif; struct wfx_hif_msg *hif;
size_t alloc_len; size_t alloc_len;
size_t computed_len; size_t computed_len;
int release_count; int release_count;
...@@ -88,9 +88,9 @@ static int rx_helper(struct wfx_dev *wdev, size_t read_len, int *is_cnf) ...@@ -88,9 +88,9 @@ static int rx_helper(struct wfx_dev *wdev, size_t read_len, int *is_cnf)
piggyback = le16_to_cpup((__le16 *)(skb->data + alloc_len - 2)); piggyback = le16_to_cpup((__le16 *)(skb->data + alloc_len - 2));
_trace_piggyback(piggyback, false); _trace_piggyback(piggyback, false);
hif = (struct hif_msg *)skb->data; hif = (struct wfx_hif_msg *)skb->data;
WARN(hif->encrypted & 0x3, "encryption is unsupported"); WARN(hif->encrypted & 0x3, "encryption is unsupported");
if (WARN(read_len < sizeof(struct hif_msg), "corrupted read")) if (WARN(read_len < sizeof(struct wfx_hif_msg), "corrupted read"))
goto err; goto err;
computed_len = le16_to_cpu(hif->len); computed_len = le16_to_cpu(hif->len);
computed_len = round_up(computed_len, 2); computed_len = round_up(computed_len, 2);
...@@ -105,7 +105,7 @@ static int rx_helper(struct wfx_dev *wdev, size_t read_len, int *is_cnf) ...@@ -105,7 +105,7 @@ static int rx_helper(struct wfx_dev *wdev, size_t read_len, int *is_cnf)
if (!(hif->id & HIF_ID_IS_INDICATION)) { if (!(hif->id & HIF_ID_IS_INDICATION)) {
(*is_cnf)++; (*is_cnf)++;
if (hif->id == HIF_CNF_ID_MULTI_TRANSMIT) if (hif->id == HIF_CNF_ID_MULTI_TRANSMIT)
release_count = ((struct hif_cnf_multi_transmit *)hif->body)->num_tx_confs; release_count = ((struct wfx_hif_cnf_multi_transmit *)hif->body)->num_tx_confs;
else else
release_count = 1; release_count = 1;
WARN(wdev->hif.tx_buffers_used < release_count, "corrupted buffer counter"); WARN(wdev->hif.tx_buffers_used < release_count, "corrupted buffer counter");
...@@ -169,7 +169,7 @@ static int bh_work_rx(struct wfx_dev *wdev, int max_msg, int *num_cnf) ...@@ -169,7 +169,7 @@ static int bh_work_rx(struct wfx_dev *wdev, int max_msg, int *num_cnf)
return i; return i;
} }
static void tx_helper(struct wfx_dev *wdev, struct hif_msg *hif) static void tx_helper(struct wfx_dev *wdev, struct wfx_hif_msg *hif)
{ {
int ret; int ret;
void *data; void *data;
...@@ -199,7 +199,7 @@ static void tx_helper(struct wfx_dev *wdev, struct hif_msg *hif) ...@@ -199,7 +199,7 @@ static void tx_helper(struct wfx_dev *wdev, struct hif_msg *hif)
static int bh_work_tx(struct wfx_dev *wdev, int max_msg) static int bh_work_tx(struct wfx_dev *wdev, int max_msg)
{ {
struct hif_msg *hif; struct wfx_hif_msg *hif;
int i; int i;
for (i = 0; i < max_msg; i++) { for (i = 0; i < max_msg; i++) {
......
...@@ -35,7 +35,7 @@ static void wfx_rx_handle_ba(struct wfx_vif *wvif, struct ieee80211_mgmt *mgmt) ...@@ -35,7 +35,7 @@ static void wfx_rx_handle_ba(struct wfx_vif *wvif, struct ieee80211_mgmt *mgmt)
} }
void wfx_rx_cb(struct wfx_vif *wvif, void wfx_rx_cb(struct wfx_vif *wvif,
const struct hif_ind_rx *arg, struct sk_buff *skb) const struct wfx_hif_ind_rx *arg, struct sk_buff *skb)
{ {
struct ieee80211_rx_status *hdr = IEEE80211_SKB_RXCB(skb); struct ieee80211_rx_status *hdr = IEEE80211_SKB_RXCB(skb);
struct ieee80211_hdr *frame = (struct ieee80211_hdr *)skb->data; struct ieee80211_hdr *frame = (struct ieee80211_hdr *)skb->data;
......
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
struct wfx_vif; struct wfx_vif;
struct sk_buff; struct sk_buff;
struct hif_ind_rx; struct wfx_hif_ind_rx;
void wfx_rx_cb(struct wfx_vif *wvif, void wfx_rx_cb(struct wfx_vif *wvif,
const struct hif_ind_rx *arg, struct sk_buff *skb); const struct wfx_hif_ind_rx *arg, struct sk_buff *skb);
#endif #endif
...@@ -329,16 +329,16 @@ static int wfx_tx_get_icv_len(struct ieee80211_key_conf *hw_key) ...@@ -329,16 +329,16 @@ static int wfx_tx_get_icv_len(struct ieee80211_key_conf *hw_key)
static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta, static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta,
struct sk_buff *skb) struct sk_buff *skb)
{ {
struct hif_msg *hif_msg; struct wfx_hif_msg *hif_msg;
struct hif_req_tx *req; struct wfx_hif_req_tx *req;
struct wfx_tx_priv *tx_priv; struct wfx_tx_priv *tx_priv;
struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
struct ieee80211_key_conf *hw_key = tx_info->control.hw_key; struct ieee80211_key_conf *hw_key = tx_info->control.hw_key;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
int queue_id = skb_get_queue_mapping(skb); int queue_id = skb_get_queue_mapping(skb);
size_t offset = (size_t)skb->data & 3; size_t offset = (size_t)skb->data & 3;
int wmsg_len = sizeof(struct hif_msg) + int wmsg_len = sizeof(struct wfx_hif_msg) +
sizeof(struct hif_req_tx) + offset; sizeof(struct wfx_hif_req_tx) + offset;
WARN(queue_id >= IEEE80211_NUM_ACS, "unsupported queue_id"); WARN(queue_id >= IEEE80211_NUM_ACS, "unsupported queue_id");
wfx_tx_fixup_rates(tx_info->driver_rates); wfx_tx_fixup_rates(tx_info->driver_rates);
...@@ -355,7 +355,7 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta, ...@@ -355,7 +355,7 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta,
skb_put(skb, tx_priv->icv_size); skb_put(skb, tx_priv->icv_size);
skb_push(skb, wmsg_len); skb_push(skb, wmsg_len);
memset(skb->data, 0, wmsg_len); memset(skb->data, 0, wmsg_len);
hif_msg = (struct hif_msg *)skb->data; hif_msg = (struct wfx_hif_msg *)skb->data;
hif_msg->len = cpu_to_le16(skb->len); hif_msg->len = cpu_to_le16(skb->len);
hif_msg->id = HIF_REQ_ID_TX; hif_msg->id = HIF_REQ_ID_TX;
hif_msg->interface = wvif->id; hif_msg->interface = wvif->id;
...@@ -368,7 +368,7 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta, ...@@ -368,7 +368,7 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta,
} }
/* Fill tx request */ /* Fill tx request */
req = (struct hif_req_tx *)hif_msg->body; req = (struct wfx_hif_req_tx *)hif_msg->body;
/* packet_id just need to be unique on device. 32bits are more than /* packet_id just need to be unique on device. 32bits are more than
* necessary for that task, so we tae advantage of it to add some extra * necessary for that task, so we tae advantage of it to add some extra
* data for debug. * data for debug.
...@@ -435,10 +435,10 @@ void wfx_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control, ...@@ -435,10 +435,10 @@ void wfx_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control,
static void wfx_skb_dtor(struct wfx_vif *wvif, struct sk_buff *skb) static void wfx_skb_dtor(struct wfx_vif *wvif, struct sk_buff *skb)
{ {
struct hif_msg *hif = (struct hif_msg *)skb->data; struct wfx_hif_msg *hif = (struct hif_msg *)skb->data;
struct hif_req_tx *req = (struct hif_req_tx *)hif->body; struct wfx_hif_req_tx *req = (struct hif_req_tx *)hif->body;
unsigned int offset = sizeof(struct hif_msg) + unsigned int offset = sizeof(struct wfx_hif_msg) +
sizeof(struct hif_req_tx) + sizeof(struct wfx_hif_req_tx) +
req->fc_offset; req->fc_offset;
if (!wvif) { if (!wvif) {
...@@ -452,7 +452,7 @@ static void wfx_skb_dtor(struct wfx_vif *wvif, struct sk_buff *skb) ...@@ -452,7 +452,7 @@ static void wfx_skb_dtor(struct wfx_vif *wvif, struct sk_buff *skb)
static void wfx_tx_fill_rates(struct wfx_dev *wdev, static void wfx_tx_fill_rates(struct wfx_dev *wdev,
struct ieee80211_tx_info *tx_info, struct ieee80211_tx_info *tx_info,
const struct hif_cnf_tx *arg) const struct wfx_hif_cnf_tx *arg)
{ {
struct ieee80211_tx_rate *rate; struct ieee80211_tx_rate *rate;
int tx_count; int tx_count;
...@@ -488,7 +488,7 @@ static void wfx_tx_fill_rates(struct wfx_dev *wdev, ...@@ -488,7 +488,7 @@ static void wfx_tx_fill_rates(struct wfx_dev *wdev,
dev_dbg(wdev->dev, "%d more retries than expected\n", tx_count); dev_dbg(wdev->dev, "%d more retries than expected\n", tx_count);
} }
void wfx_tx_confirm_cb(struct wfx_dev *wdev, const struct hif_cnf_tx *arg) void wfx_tx_confirm_cb(struct wfx_dev *wdev, const struct wfx_hif_cnf_tx *arg)
{ {
const struct wfx_tx_priv *tx_priv; const struct wfx_tx_priv *tx_priv;
struct ieee80211_tx_info *tx_info; struct ieee80211_tx_info *tx_info;
...@@ -503,7 +503,7 @@ void wfx_tx_confirm_cb(struct wfx_dev *wdev, const struct hif_cnf_tx *arg) ...@@ -503,7 +503,7 @@ void wfx_tx_confirm_cb(struct wfx_dev *wdev, const struct hif_cnf_tx *arg)
} }
tx_info = IEEE80211_SKB_CB(skb); tx_info = IEEE80211_SKB_CB(skb);
tx_priv = wfx_skb_tx_priv(skb); tx_priv = wfx_skb_tx_priv(skb);
wvif = wdev_to_wvif(wdev, ((struct hif_msg *)skb->data)->interface); wvif = wdev_to_wvif(wdev, ((struct wfx_hif_msg *)skb->data)->interface);
WARN_ON(!wvif); WARN_ON(!wvif);
if (!wvif) if (!wvif)
return; return;
...@@ -572,7 +572,7 @@ void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, ...@@ -572,7 +572,7 @@ void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
struct wfx_dev *wdev = hw->priv; struct wfx_dev *wdev = hw->priv;
struct sk_buff_head dropped; struct sk_buff_head dropped;
struct wfx_vif *wvif; struct wfx_vif *wvif;
struct hif_msg *hif; struct wfx_hif_msg *hif;
struct sk_buff *skb; struct sk_buff *skb;
skb_queue_head_init(&dropped); skb_queue_head_init(&dropped);
...@@ -588,7 +588,7 @@ void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, ...@@ -588,7 +588,7 @@ void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
if (wdev->chip_frozen) if (wdev->chip_frozen)
wfx_pending_drop(wdev, &dropped); wfx_pending_drop(wdev, &dropped);
while ((skb = skb_dequeue(&dropped)) != NULL) { while ((skb = skb_dequeue(&dropped)) != NULL) {
hif = (struct hif_msg *)skb->data; hif = (struct wfx_hif_msg *)skb->data;
wvif = wdev_to_wvif(wdev, hif->interface); wvif = wdev_to_wvif(wdev, hif->interface);
ieee80211_tx_info_clear_status(IEEE80211_SKB_CB(skb)); ieee80211_tx_info_clear_status(IEEE80211_SKB_CB(skb));
wfx_skb_dtor(wvif, skb); wfx_skb_dtor(wvif, skb);
......
...@@ -43,7 +43,7 @@ void wfx_tx_policy_upload_work(struct work_struct *work); ...@@ -43,7 +43,7 @@ void wfx_tx_policy_upload_work(struct work_struct *work);
void wfx_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control, void wfx_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control,
struct sk_buff *skb); struct sk_buff *skb);
void wfx_tx_confirm_cb(struct wfx_dev *wdev, const struct hif_cnf_tx *arg); void wfx_tx_confirm_cb(struct wfx_dev *wdev, const struct wfx_hif_cnf_tx *arg);
void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
u32 queues, bool drop); u32 queues, bool drop);
...@@ -57,10 +57,10 @@ static inline struct wfx_tx_priv *wfx_skb_tx_priv(struct sk_buff *skb) ...@@ -57,10 +57,10 @@ static inline struct wfx_tx_priv *wfx_skb_tx_priv(struct sk_buff *skb)
return (struct wfx_tx_priv *)tx_info->rate_driver_data; return (struct wfx_tx_priv *)tx_info->rate_driver_data;
} }
static inline struct hif_req_tx *wfx_skb_txreq(struct sk_buff *skb) static inline struct wfx_hif_req_tx *wfx_skb_txreq(struct sk_buff *skb)
{ {
struct hif_msg *hif = (struct hif_msg *)skb->data; struct wfx_hif_msg *hif = (struct hif_msg *)skb->data;
struct hif_req_tx *req = (struct hif_req_tx *)hif->body; struct wfx_hif_req_tx *req = (struct hif_req_tx *)hif->body;
return req; return req;
} }
......
...@@ -63,7 +63,7 @@ static int wfx_counters_show(struct seq_file *seq, void *v) ...@@ -63,7 +63,7 @@ static int wfx_counters_show(struct seq_file *seq, void *v)
{ {
int ret, i; int ret, i;
struct wfx_dev *wdev = seq->private; struct wfx_dev *wdev = seq->private;
struct hif_mib_extended_count_table counters[3]; struct wfx_hif_mib_extended_count_table counters[3];
for (i = 0; i < ARRAY_SIZE(counters); i++) { for (i = 0; i < ARRAY_SIZE(counters); i++) {
ret = wfx_hif_get_counters_table(wdev, i, counters + i); ret = wfx_hif_get_counters_table(wdev, i, counters + i);
...@@ -153,7 +153,7 @@ static const char * const channel_names[] = { ...@@ -153,7 +153,7 @@ static const char * const channel_names[] = {
static int wfx_rx_stats_show(struct seq_file *seq, void *v) static int wfx_rx_stats_show(struct seq_file *seq, void *v)
{ {
struct wfx_dev *wdev = seq->private; struct wfx_dev *wdev = seq->private;
struct hif_rx_stats *st = &wdev->rx_stats; struct wfx_hif_rx_stats *st = &wdev->rx_stats;
int i; int i;
mutex_lock(&wdev->rx_stats_lock); mutex_lock(&wdev->rx_stats_lock);
...@@ -185,7 +185,7 @@ DEFINE_SHOW_ATTRIBUTE(wfx_rx_stats); ...@@ -185,7 +185,7 @@ DEFINE_SHOW_ATTRIBUTE(wfx_rx_stats);
static int wfx_tx_power_loop_show(struct seq_file *seq, void *v) static int wfx_tx_power_loop_show(struct seq_file *seq, void *v)
{ {
struct wfx_dev *wdev = seq->private; struct wfx_dev *wdev = seq->private;
struct hif_tx_power_loop_info *st = &wdev->tx_power_loop_info; struct wfx_hif_tx_power_loop_info *st = &wdev->tx_power_loop_info;
int tmp; int tmp;
mutex_lock(&wdev->tx_power_loop_info_lock); mutex_lock(&wdev->tx_power_loop_info_lock);
...@@ -247,13 +247,13 @@ static ssize_t wfx_send_hif_msg_write(struct file *file, ...@@ -247,13 +247,13 @@ static ssize_t wfx_send_hif_msg_write(struct file *file,
{ {
struct dbgfs_hif_msg *context = file->private_data; struct dbgfs_hif_msg *context = file->private_data;
struct wfx_dev *wdev = context->wdev; struct wfx_dev *wdev = context->wdev;
struct hif_msg *request; struct wfx_hif_msg *request;
if (completion_done(&context->complete)) { if (completion_done(&context->complete)) {
dev_dbg(wdev->dev, "read previous result before start a new one\n"); dev_dbg(wdev->dev, "read previous result before start a new one\n");
return -EBUSY; return -EBUSY;
} }
if (count < sizeof(struct hif_msg)) if (count < sizeof(struct wfx_hif_msg))
return -EINVAL; return -EINVAL;
/* wfx_cmd_send() checks that reply buffer is wide enough, but does not /* wfx_cmd_send() checks that reply buffer is wide enough, but does not
......
This diff is collapsed.
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#define HIF_ID_IS_INDICATION 0x80 #define HIF_ID_IS_INDICATION 0x80
#define HIF_COUNTER_MAX 7 #define HIF_COUNTER_MAX 7
struct hif_msg { struct wfx_hif_msg {
__le16 len; __le16 len;
u8 id; u8 id;
u8 reserved:1; u8 reserved:1;
...@@ -24,7 +24,7 @@ struct hif_msg { ...@@ -24,7 +24,7 @@ struct hif_msg {
u8 body[]; u8 body[];
} __packed; } __packed;
enum hif_general_requests_ids { enum wfx_hif_general_requests_ids {
HIF_REQ_ID_CONFIGURATION = 0x09, HIF_REQ_ID_CONFIGURATION = 0x09,
HIF_REQ_ID_CONTROL_GPIO = 0x26, HIF_REQ_ID_CONTROL_GPIO = 0x26,
HIF_REQ_ID_SET_SL_MAC_KEY = 0x27, HIF_REQ_ID_SET_SL_MAC_KEY = 0x27,
...@@ -37,7 +37,7 @@ enum hif_general_requests_ids { ...@@ -37,7 +37,7 @@ enum hif_general_requests_ids {
HIF_REQ_ID_SHUT_DOWN = 0x32, HIF_REQ_ID_SHUT_DOWN = 0x32,
}; };
enum hif_general_confirmations_ids { enum wfx_hif_general_confirmations_ids {
HIF_CNF_ID_CONFIGURATION = 0x09, HIF_CNF_ID_CONFIGURATION = 0x09,
HIF_CNF_ID_CONTROL_GPIO = 0x26, HIF_CNF_ID_CONTROL_GPIO = 0x26,
HIF_CNF_ID_SET_SL_MAC_KEY = 0x27, HIF_CNF_ID_SET_SL_MAC_KEY = 0x27,
...@@ -50,7 +50,7 @@ enum hif_general_confirmations_ids { ...@@ -50,7 +50,7 @@ enum hif_general_confirmations_ids {
HIF_CNF_ID_SHUT_DOWN = 0x32, HIF_CNF_ID_SHUT_DOWN = 0x32,
}; };
enum hif_general_indications_ids { enum wfx_hif_general_indications_ids {
HIF_IND_ID_EXCEPTION = 0xe0, HIF_IND_ID_EXCEPTION = 0xe0,
HIF_IND_ID_STARTUP = 0xe1, HIF_IND_ID_STARTUP = 0xe1,
HIF_IND_ID_WAKEUP = 0xe2, HIF_IND_ID_WAKEUP = 0xe2,
...@@ -81,7 +81,7 @@ enum hif_general_indications_ids { ...@@ -81,7 +81,7 @@ enum hif_general_indications_ids {
#define HIF_STATUS_ROLLBACK_SUCCESS (cpu_to_le32(0x1234)) #define HIF_STATUS_ROLLBACK_SUCCESS (cpu_to_le32(0x1234))
#define HIF_STATUS_ROLLBACK_FAIL (cpu_to_le32(0x1256)) #define HIF_STATUS_ROLLBACK_FAIL (cpu_to_le32(0x1256))
enum hif_api_rate_index { enum wfx_hif_api_rate_index {
API_RATE_INDEX_B_1MBPS = 0, API_RATE_INDEX_B_1MBPS = 0,
API_RATE_INDEX_B_2MBPS = 1, API_RATE_INDEX_B_2MBPS = 1,
API_RATE_INDEX_B_5P5MBPS = 2, API_RATE_INDEX_B_5P5MBPS = 2,
...@@ -107,7 +107,7 @@ enum hif_api_rate_index { ...@@ -107,7 +107,7 @@ enum hif_api_rate_index {
API_RATE_NUM_ENTRIES = 22 API_RATE_NUM_ENTRIES = 22
}; };
struct hif_ind_startup { struct wfx_hif_ind_startup {
__le32 status; __le32 status;
__le16 hardware_id; __le16 hardware_id;
u8 opn[14]; u8 opn[14];
...@@ -138,19 +138,19 @@ struct hif_ind_startup { ...@@ -138,19 +138,19 @@ struct hif_ind_startup {
u8 firmware_label[128]; u8 firmware_label[128];
} __packed; } __packed;
struct hif_ind_wakeup { struct wfx_hif_ind_wakeup {
} __packed; } __packed;
struct hif_req_configuration { struct wfx_hif_req_configuration {
__le16 length; __le16 length;
u8 pds_data[]; u8 pds_data[];
} __packed; } __packed;
struct hif_cnf_configuration { struct wfx_hif_cnf_configuration {
__le32 status; __le32 status;
} __packed; } __packed;
enum hif_gpio_mode { enum wfx_hif_gpio_mode {
HIF_GPIO_MODE_D0 = 0x0, HIF_GPIO_MODE_D0 = 0x0,
HIF_GPIO_MODE_D1 = 0x1, HIF_GPIO_MODE_D1 = 0x1,
HIF_GPIO_MODE_OD0 = 0x2, HIF_GPIO_MODE_OD0 = 0x2,
...@@ -160,24 +160,24 @@ enum hif_gpio_mode { ...@@ -160,24 +160,24 @@ enum hif_gpio_mode {
HIF_GPIO_MODE_READ = 0x6 HIF_GPIO_MODE_READ = 0x6
}; };
struct hif_req_control_gpio { struct wfx_hif_req_control_gpio {
u8 gpio_label; u8 gpio_label;
u8 gpio_mode; u8 gpio_mode;
} __packed; } __packed;
struct hif_cnf_control_gpio { struct wfx_hif_cnf_control_gpio {
__le32 status; __le32 status;
__le32 value; __le32 value;
} __packed; } __packed;
enum hif_generic_indication_type { enum wfx_hif_generic_indication_type {
HIF_GENERIC_INDICATION_TYPE_RAW = 0x0, HIF_GENERIC_INDICATION_TYPE_RAW = 0x0,
HIF_GENERIC_INDICATION_TYPE_STRING = 0x1, HIF_GENERIC_INDICATION_TYPE_STRING = 0x1,
HIF_GENERIC_INDICATION_TYPE_RX_STATS = 0x2, HIF_GENERIC_INDICATION_TYPE_RX_STATS = 0x2,
HIF_GENERIC_INDICATION_TYPE_TX_POWER_LOOP_INFO = 0x3, HIF_GENERIC_INDICATION_TYPE_TX_POWER_LOOP_INFO = 0x3,
}; };
struct hif_rx_stats { struct wfx_hif_rx_stats {
__le32 nb_rx_frame; __le32 nb_rx_frame;
__le32 nb_crc_frame; __le32 nb_crc_frame;
__le32 per_total; __le32 per_total;
...@@ -193,7 +193,7 @@ struct hif_rx_stats { ...@@ -193,7 +193,7 @@ struct hif_rx_stats {
s8 current_temp; s8 current_temp;
} __packed; } __packed;
struct hif_tx_power_loop_info { struct wfx_hif_tx_power_loop_info {
__le16 tx_gain_dig; __le16 tx_gain_dig;
__le16 tx_gain_pa; __le16 tx_gain_pa;
__le16 target_pout; /* signed value */ __le16 target_pout; /* signed value */
...@@ -203,15 +203,15 @@ struct hif_tx_power_loop_info { ...@@ -203,15 +203,15 @@ struct hif_tx_power_loop_info {
u8 reserved; u8 reserved;
} __packed; } __packed;
struct hif_ind_generic { struct wfx_hif_ind_generic {
__le32 type; __le32 type;
union { union {
struct hif_rx_stats rx_stats; struct wfx_hif_rx_stats rx_stats;
struct hif_tx_power_loop_info tx_power_loop_info; struct wfx_hif_tx_power_loop_info tx_power_loop_info;
} data; } data;
} __packed; } __packed;
enum hif_error { enum wfx_hif_error {
HIF_ERROR_FIRMWARE_ROLLBACK = 0x00, HIF_ERROR_FIRMWARE_ROLLBACK = 0x00,
HIF_ERROR_FIRMWARE_DEBUG_ENABLED = 0x01, HIF_ERROR_FIRMWARE_DEBUG_ENABLED = 0x01,
HIF_ERROR_SLK_OUTDATED_SESSION_KEY = 0x02, HIF_ERROR_SLK_OUTDATED_SESSION_KEY = 0x02,
...@@ -232,17 +232,17 @@ enum hif_error { ...@@ -232,17 +232,17 @@ enum hif_error {
HIF_ERROR_SLK_UNCONFIGURED = 0x11, HIF_ERROR_SLK_UNCONFIGURED = 0x11,
}; };
struct hif_ind_error { struct wfx_hif_ind_error {
__le32 type; __le32 type;
u8 data[]; u8 data[];
} __packed; } __packed;
struct hif_ind_exception { struct wfx_hif_ind_exception {
__le32 type; __le32 type;
u8 data[]; u8 data[];
} __packed; } __packed;
enum hif_secure_link_state { enum wfx_hif_secure_link_state {
SEC_LINK_UNAVAILABLE = 0x0, SEC_LINK_UNAVAILABLE = 0x0,
SEC_LINK_RESERVED = 0x1, SEC_LINK_RESERVED = 0x1,
SEC_LINK_EVAL = 0x2, SEC_LINK_EVAL = 0x2,
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#define HIF_API_IPV4_ADDRESS_SIZE 4 #define HIF_API_IPV4_ADDRESS_SIZE 4
#define HIF_API_IPV6_ADDRESS_SIZE 16 #define HIF_API_IPV6_ADDRESS_SIZE 16
enum hif_mib_ids { enum wfx_hif_mib_ids {
HIF_MIB_ID_GL_OPERATIONAL_POWER_MODE = 0x2000, HIF_MIB_ID_GL_OPERATIONAL_POWER_MODE = 0x2000,
HIF_MIB_ID_GL_BLOCK_ACK_INFO = 0x2001, HIF_MIB_ID_GL_BLOCK_ACK_INFO = 0x2001,
HIF_MIB_ID_GL_SET_MULTI_MSG = 0x2002, HIF_MIB_ID_GL_SET_MULTI_MSG = 0x2002,
...@@ -63,39 +63,39 @@ enum hif_mib_ids { ...@@ -63,39 +63,39 @@ enum hif_mib_ids {
HIF_MIB_ID_BEACON_STATS = 0x2056, HIF_MIB_ID_BEACON_STATS = 0x2056,
}; };
enum hif_op_power_mode { enum wfx_hif_op_power_mode {
HIF_OP_POWER_MODE_ACTIVE = 0x0, HIF_OP_POWER_MODE_ACTIVE = 0x0,
HIF_OP_POWER_MODE_DOZE = 0x1, HIF_OP_POWER_MODE_DOZE = 0x1,
HIF_OP_POWER_MODE_QUIESCENT = 0x2 HIF_OP_POWER_MODE_QUIESCENT = 0x2
}; };
struct hif_mib_gl_operational_power_mode { struct wfx_hif_mib_gl_operational_power_mode {
u8 power_mode:4; u8 power_mode:4;
u8 reserved1:3; u8 reserved1:3;
u8 wup_ind_activation:1; u8 wup_ind_activation:1;
u8 reserved2[3]; u8 reserved2[3];
} __packed; } __packed;
struct hif_mib_gl_set_multi_msg { struct wfx_hif_mib_gl_set_multi_msg {
u8 enable_multi_tx_conf:1; u8 enable_multi_tx_conf:1;
u8 reserved1:7; u8 reserved1:7;
u8 reserved2[3]; u8 reserved2[3];
} __packed; } __packed;
enum hif_arp_ns_frame_treatment { enum wfx_hif_arp_ns_frame_treatment {
HIF_ARP_NS_FILTERING_DISABLE = 0x0, HIF_ARP_NS_FILTERING_DISABLE = 0x0,
HIF_ARP_NS_FILTERING_ENABLE = 0x1, HIF_ARP_NS_FILTERING_ENABLE = 0x1,
HIF_ARP_NS_REPLY_ENABLE = 0x2 HIF_ARP_NS_REPLY_ENABLE = 0x2
}; };
struct hif_mib_arp_ip_addr_table { struct wfx_hif_mib_arp_ip_addr_table {
u8 condition_idx; u8 condition_idx;
u8 arp_enable; u8 arp_enable;
u8 reserved[2]; u8 reserved[2];
u8 ipv4_address[HIF_API_IPV4_ADDRESS_SIZE]; u8 ipv4_address[HIF_API_IPV4_ADDRESS_SIZE];
} __packed; } __packed;
struct hif_mib_rx_filter { struct wfx_hif_mib_rx_filter {
u8 reserved1:1; u8 reserved1:1;
u8 bssid_filter:1; u8 bssid_filter:1;
u8 reserved2:1; u8 reserved2:1;
...@@ -105,7 +105,7 @@ struct hif_mib_rx_filter { ...@@ -105,7 +105,7 @@ struct hif_mib_rx_filter {
u8 reserved4[3]; u8 reserved4[3];
} __packed; } __packed;
struct hif_ie_table_entry { struct wfx_hif_ie_table_entry {
u8 ie_id; u8 ie_id;
u8 has_changed:1; u8 has_changed:1;
u8 no_longer:1; u8 no_longer:1;
...@@ -116,23 +116,23 @@ struct hif_ie_table_entry { ...@@ -116,23 +116,23 @@ struct hif_ie_table_entry {
u8 match_data[3]; u8 match_data[3];
} __packed; } __packed;
struct hif_mib_bcn_filter_table { struct wfx_hif_mib_bcn_filter_table {
__le32 num_of_info_elmts; __le32 num_of_info_elmts;
struct hif_ie_table_entry ie_table[]; struct wfx_hif_ie_table_entry ie_table[];
} __packed; } __packed;
enum hif_beacon_filter { enum wfx_hif_beacon_filter {
HIF_BEACON_FILTER_DISABLE = 0x0, HIF_BEACON_FILTER_DISABLE = 0x0,
HIF_BEACON_FILTER_ENABLE = 0x1, HIF_BEACON_FILTER_ENABLE = 0x1,
HIF_BEACON_FILTER_AUTO_ERP = 0x2 HIF_BEACON_FILTER_AUTO_ERP = 0x2
}; };
struct hif_mib_bcn_filter_enable { struct wfx_hif_mib_bcn_filter_enable {
__le32 enable; __le32 enable;
__le32 bcn_count; __le32 bcn_count;
} __packed; } __packed;
struct hif_mib_extended_count_table { struct wfx_hif_mib_extended_count_table {
__le32 count_drop_plcp; __le32 count_drop_plcp;
__le32 count_drop_fcs; __le32 count_drop_fcs;
__le32 count_tx_frames; __le32 count_tx_frames;
...@@ -164,7 +164,7 @@ struct hif_mib_extended_count_table { ...@@ -164,7 +164,7 @@ struct hif_mib_extended_count_table {
__le32 reserved[12]; __le32 reserved[12];
} __packed; } __packed;
struct hif_mib_count_table { struct wfx_hif_mib_count_table {
__le32 count_drop_plcp; __le32 count_drop_plcp;
__le32 count_drop_fcs; __le32 count_drop_fcs;
__le32 count_tx_frames; __le32 count_tx_frames;
...@@ -190,35 +190,35 @@ struct hif_mib_count_table { ...@@ -190,35 +190,35 @@ struct hif_mib_count_table {
__le32 count_drop_bip_mic; __le32 count_drop_bip_mic;
} __packed; } __packed;
struct hif_mib_mac_address { struct wfx_hif_mib_mac_address {
u8 mac_addr[ETH_ALEN]; u8 mac_addr[ETH_ALEN];
__le16 reserved; __le16 reserved;
} __packed; } __packed;
struct hif_mib_wep_default_key_id { struct wfx_hif_mib_wep_default_key_id {
u8 wep_default_key_id; u8 wep_default_key_id;
u8 reserved[3]; u8 reserved[3];
} __packed; } __packed;
struct hif_mib_dot11_rts_threshold { struct wfx_hif_mib_dot11_rts_threshold {
__le32 threshold; __le32 threshold;
} __packed; } __packed;
struct hif_mib_slot_time { struct wfx_hif_mib_slot_time {
__le32 slot_time; __le32 slot_time;
} __packed; } __packed;
struct hif_mib_current_tx_power_level { struct wfx_hif_mib_current_tx_power_level {
__le32 power_level; /* signed value */ __le32 power_level; /* signed value */
} __packed; } __packed;
struct hif_mib_non_erp_protection { struct wfx_hif_mib_non_erp_protection {
u8 use_cts_to_self:1; u8 use_cts_to_self:1;
u8 reserved1:7; u8 reserved1:7;
u8 reserved2[3]; u8 reserved2[3];
} __packed; } __packed;
enum hif_tmplt { enum wfx_hif_tmplt {
HIF_TMPLT_PRBREQ = 0x0, HIF_TMPLT_PRBREQ = 0x0,
HIF_TMPLT_BCN = 0x1, HIF_TMPLT_BCN = 0x1,
HIF_TMPLT_NULL = 0x2, HIF_TMPLT_NULL = 0x2,
...@@ -231,7 +231,7 @@ enum hif_tmplt { ...@@ -231,7 +231,7 @@ enum hif_tmplt {
#define HIF_API_MAX_TEMPLATE_FRAME_SIZE 700 #define HIF_API_MAX_TEMPLATE_FRAME_SIZE 700
struct hif_mib_template_frame { struct wfx_hif_mib_template_frame {
u8 frame_type; u8 frame_type;
u8 init_rate:7; u8 init_rate:7;
u8 mode:1; u8 mode:1;
...@@ -239,7 +239,7 @@ struct hif_mib_template_frame { ...@@ -239,7 +239,7 @@ struct hif_mib_template_frame {
u8 frame[]; u8 frame[];
} __packed; } __packed;
struct hif_mib_beacon_wake_up_period { struct wfx_hif_mib_beacon_wake_up_period {
u8 wakeup_period_min; u8 wakeup_period_min;
u8 receive_dtim:1; u8 receive_dtim:1;
u8 reserved1:7; u8 reserved1:7;
...@@ -247,7 +247,7 @@ struct hif_mib_beacon_wake_up_period { ...@@ -247,7 +247,7 @@ struct hif_mib_beacon_wake_up_period {
u8 reserved2; u8 reserved2;
} __packed; } __packed;
struct hif_mib_rcpi_rssi_threshold { struct wfx_hif_mib_rcpi_rssi_threshold {
u8 detection:1; u8 detection:1;
u8 rcpi_rssi:1; u8 rcpi_rssi:1;
u8 upperthresh:1; u8 upperthresh:1;
...@@ -260,14 +260,14 @@ struct hif_mib_rcpi_rssi_threshold { ...@@ -260,14 +260,14 @@ struct hif_mib_rcpi_rssi_threshold {
#define DEFAULT_BA_MAX_RX_BUFFER_SIZE 16 #define DEFAULT_BA_MAX_RX_BUFFER_SIZE 16
struct hif_mib_block_ack_policy { struct wfx_hif_mib_block_ack_policy {
u8 block_ack_tx_tid_policy; u8 block_ack_tx_tid_policy;
u8 reserved1; u8 reserved1;
u8 block_ack_rx_tid_policy; u8 block_ack_rx_tid_policy;
u8 block_ack_rx_max_buffer_size; u8 block_ack_rx_max_buffer_size;
} __packed; } __packed;
enum hif_mpdu_start_spacing { enum wfx_hif_mpdu_start_spacing {
HIF_MPDU_START_SPACING_NO_RESTRIC = 0x0, HIF_MPDU_START_SPACING_NO_RESTRIC = 0x0,
HIF_MPDU_START_SPACING_QUARTER = 0x1, HIF_MPDU_START_SPACING_QUARTER = 0x1,
HIF_MPDU_START_SPACING_HALF = 0x2, HIF_MPDU_START_SPACING_HALF = 0x2,
...@@ -278,7 +278,7 @@ enum hif_mpdu_start_spacing { ...@@ -278,7 +278,7 @@ enum hif_mpdu_start_spacing {
HIF_MPDU_START_SPACING_SIXTEEN = 0x7 HIF_MPDU_START_SPACING_SIXTEEN = 0x7
}; };
struct hif_mib_set_association_mode { struct wfx_hif_mib_set_association_mode {
u8 preambtype_use:1; u8 preambtype_use:1;
u8 mode:1; u8 mode:1;
u8 rateset:1; u8 rateset:1;
...@@ -292,7 +292,7 @@ struct hif_mib_set_association_mode { ...@@ -292,7 +292,7 @@ struct hif_mib_set_association_mode {
__le32 basic_rate_set; __le32 basic_rate_set;
} __packed; } __packed;
struct hif_mib_set_uapsd_information { struct wfx_hif_mib_set_uapsd_information {
u8 trig_bckgrnd:1; u8 trig_bckgrnd:1;
u8 trig_be:1; u8 trig_be:1;
u8 trig_video:1; u8 trig_video:1;
...@@ -308,7 +308,7 @@ struct hif_mib_set_uapsd_information { ...@@ -308,7 +308,7 @@ struct hif_mib_set_uapsd_information {
__le16 auto_trigger_step; __le16 auto_trigger_step;
} __packed; } __packed;
struct hif_tx_rate_retry_policy { struct wfx_hif_tx_rate_retry_policy {
u8 policy_index; u8 policy_index;
u8 short_retry_count; u8 short_retry_count;
u8 long_retry_count; u8 long_retry_count;
...@@ -324,13 +324,13 @@ struct hif_tx_rate_retry_policy { ...@@ -324,13 +324,13 @@ struct hif_tx_rate_retry_policy {
#define HIF_TX_RETRY_POLICY_MAX 15 #define HIF_TX_RETRY_POLICY_MAX 15
#define HIF_TX_RETRY_POLICY_INVALID HIF_TX_RETRY_POLICY_MAX #define HIF_TX_RETRY_POLICY_INVALID HIF_TX_RETRY_POLICY_MAX
struct hif_mib_set_tx_rate_retry_policy { struct wfx_hif_mib_set_tx_rate_retry_policy {
u8 num_tx_rate_policies; u8 num_tx_rate_policies;
u8 reserved[3]; u8 reserved[3];
struct hif_tx_rate_retry_policy tx_rate_retry_policy[]; struct wfx_hif_tx_rate_retry_policy tx_rate_retry_policy[];
} __packed; } __packed;
struct hif_mib_protected_mgmt_policy { struct wfx_hif_mib_protected_mgmt_policy {
u8 pmf_enable:1; u8 pmf_enable:1;
u8 unpmf_allowed:1; u8 unpmf_allowed:1;
u8 host_enc_auth_frames:1; u8 host_enc_auth_frames:1;
...@@ -338,7 +338,7 @@ struct hif_mib_protected_mgmt_policy { ...@@ -338,7 +338,7 @@ struct hif_mib_protected_mgmt_policy {
u8 reserved2[3]; u8 reserved2[3];
} __packed; } __packed;
struct hif_mib_keep_alive_period { struct wfx_hif_mib_keep_alive_period {
__le16 keep_alive_period; __le16 keep_alive_period;
u8 reserved[2]; u8 reserved[2];
} __packed; } __packed;
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include "hif_api_cmd.h" #include "hif_api_cmd.h"
static int wfx_hif_generic_confirm(struct wfx_dev *wdev, static int wfx_hif_generic_confirm(struct wfx_dev *wdev,
const struct hif_msg *hif, const void *buf) const struct wfx_hif_msg *hif, const void *buf)
{ {
/* All confirm messages start with status */ /* All confirm messages start with status */
int status = le32_to_cpup((__le32 *)buf); int status = le32_to_cpup((__le32 *)buf);
...@@ -51,18 +51,18 @@ static int wfx_hif_generic_confirm(struct wfx_dev *wdev, ...@@ -51,18 +51,18 @@ static int wfx_hif_generic_confirm(struct wfx_dev *wdev,
} }
static int wfx_hif_tx_confirm(struct wfx_dev *wdev, static int wfx_hif_tx_confirm(struct wfx_dev *wdev,
const struct hif_msg *hif, const void *buf) const struct wfx_hif_msg *hif, const void *buf)
{ {
const struct hif_cnf_tx *body = buf; const struct wfx_hif_cnf_tx *body = buf;
wfx_tx_confirm_cb(wdev, body); wfx_tx_confirm_cb(wdev, body);
return 0; return 0;
} }
static int wfx_hif_multi_tx_confirm(struct wfx_dev *wdev, static int wfx_hif_multi_tx_confirm(struct wfx_dev *wdev,
const struct hif_msg *hif, const void *buf) const struct wfx_hif_msg *hif, const void *buf)
{ {
const struct hif_cnf_multi_transmit *body = buf; const struct wfx_hif_cnf_multi_transmit *body = buf;
int i; int i;
WARN(body->num_tx_confs <= 0, "corrupted message"); WARN(body->num_tx_confs <= 0, "corrupted message");
...@@ -72,22 +72,23 @@ static int wfx_hif_multi_tx_confirm(struct wfx_dev *wdev, ...@@ -72,22 +72,23 @@ static int wfx_hif_multi_tx_confirm(struct wfx_dev *wdev,
} }
static int wfx_hif_startup_indication(struct wfx_dev *wdev, static int wfx_hif_startup_indication(struct wfx_dev *wdev,
const struct hif_msg *hif, const struct wfx_hif_msg *hif,
const void *buf) const void *buf)
{ {
const struct hif_ind_startup *body = buf; const struct wfx_hif_ind_startup *body = buf;
if (body->status || body->firmware_type > 4) { if (body->status || body->firmware_type > 4) {
dev_err(wdev->dev, "received invalid startup indication"); dev_err(wdev->dev, "received invalid startup indication");
return -EINVAL; return -EINVAL;
} }
memcpy(&wdev->hw_caps, body, sizeof(struct hif_ind_startup)); memcpy(&wdev->hw_caps, body, sizeof(struct wfx_hif_ind_startup));
complete(&wdev->firmware_ready); complete(&wdev->firmware_ready);
return 0; return 0;
} }
static int wfx_hif_wakeup_indication(struct wfx_dev *wdev, static int wfx_hif_wakeup_indication(struct wfx_dev *wdev,
const struct hif_msg *hif, const void *buf) const struct wfx_hif_msg *hif,
const void *buf)
{ {
if (!wdev->pdata.gpio_wakeup || if (!wdev->pdata.gpio_wakeup ||
gpiod_get_value(wdev->pdata.gpio_wakeup) == 0) { gpiod_get_value(wdev->pdata.gpio_wakeup) == 0) {
...@@ -98,28 +99,28 @@ static int wfx_hif_wakeup_indication(struct wfx_dev *wdev, ...@@ -98,28 +99,28 @@ static int wfx_hif_wakeup_indication(struct wfx_dev *wdev,
} }
static int wfx_hif_receive_indication(struct wfx_dev *wdev, static int wfx_hif_receive_indication(struct wfx_dev *wdev,
const struct hif_msg *hif, const struct wfx_hif_msg *hif,
const void *buf, struct sk_buff *skb) const void *buf, struct sk_buff *skb)
{ {
struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface);
const struct hif_ind_rx *body = buf; const struct wfx_hif_ind_rx *body = buf;
if (!wvif) { if (!wvif) {
dev_warn(wdev->dev, "%s: ignore rx data for non-existent vif %d\n", dev_warn(wdev->dev, "%s: ignore rx data for non-existent vif %d\n",
__func__, hif->interface); __func__, hif->interface);
return -EIO; return -EIO;
} }
skb_pull(skb, sizeof(struct hif_msg) + sizeof(struct hif_ind_rx)); skb_pull(skb, sizeof(struct wfx_hif_msg) + sizeof(struct hif_ind_rx));
wfx_rx_cb(wvif, body, skb); wfx_rx_cb(wvif, body, skb);
return 0; return 0;
} }
static int wfx_hif_event_indication(struct wfx_dev *wdev, static int wfx_hif_event_indication(struct wfx_dev *wdev,
const struct hif_msg *hif, const void *buf) const struct wfx_hif_msg *hif, const void *buf)
{ {
struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface);
const struct hif_ind_event *body = buf; const struct wfx_hif_ind_event *body = buf;
int type = le32_to_cpu(body->event_id); int type = le32_to_cpu(body->event_id);
if (!wvif) { if (!wvif) {
...@@ -151,7 +152,7 @@ static int wfx_hif_event_indication(struct wfx_dev *wdev, ...@@ -151,7 +152,7 @@ static int wfx_hif_event_indication(struct wfx_dev *wdev,
} }
static int wfx_hif_pm_mode_complete_indication(struct wfx_dev *wdev, static int wfx_hif_pm_mode_complete_indication(struct wfx_dev *wdev,
const struct hif_msg *hif, const struct wfx_hif_msg *hif,
const void *buf) const void *buf)
{ {
struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface);
...@@ -166,11 +167,11 @@ static int wfx_hif_pm_mode_complete_indication(struct wfx_dev *wdev, ...@@ -166,11 +167,11 @@ static int wfx_hif_pm_mode_complete_indication(struct wfx_dev *wdev,
} }
static int wfx_hif_scan_complete_indication(struct wfx_dev *wdev, static int wfx_hif_scan_complete_indication(struct wfx_dev *wdev,
const struct hif_msg *hif, const struct wfx_hif_msg *hif,
const void *buf) const void *buf)
{ {
struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface);
const struct hif_ind_scan_cmpl *body = buf; const struct wfx_hif_ind_scan_cmpl *body = buf;
if (!wvif) { if (!wvif) {
dev_warn(wdev->dev, "%s: received event for non-existent vif\n", __func__); dev_warn(wdev->dev, "%s: received event for non-existent vif\n", __func__);
...@@ -183,7 +184,7 @@ static int wfx_hif_scan_complete_indication(struct wfx_dev *wdev, ...@@ -183,7 +184,7 @@ static int wfx_hif_scan_complete_indication(struct wfx_dev *wdev,
} }
static int wfx_hif_join_complete_indication(struct wfx_dev *wdev, static int wfx_hif_join_complete_indication(struct wfx_dev *wdev,
const struct hif_msg *hif, const struct wfx_hif_msg *hif,
const void *buf) const void *buf)
{ {
struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface);
...@@ -198,10 +199,10 @@ static int wfx_hif_join_complete_indication(struct wfx_dev *wdev, ...@@ -198,10 +199,10 @@ static int wfx_hif_join_complete_indication(struct wfx_dev *wdev,
} }
static int wfx_hif_suspend_resume_indication(struct wfx_dev *wdev, static int wfx_hif_suspend_resume_indication(struct wfx_dev *wdev,
const struct hif_msg *hif, const struct wfx_hif_msg *hif,
const void *buf) const void *buf)
{ {
const struct hif_ind_suspend_resume_tx *body = buf; const struct wfx_hif_ind_suspend_resume_tx *body = buf;
struct wfx_vif *wvif; struct wfx_vif *wvif;
if (body->bc_mc_only) { if (body->bc_mc_only) {
...@@ -227,10 +228,10 @@ static int wfx_hif_suspend_resume_indication(struct wfx_dev *wdev, ...@@ -227,10 +228,10 @@ static int wfx_hif_suspend_resume_indication(struct wfx_dev *wdev,
} }
static int wfx_hif_generic_indication(struct wfx_dev *wdev, static int wfx_hif_generic_indication(struct wfx_dev *wdev,
const struct hif_msg *hif, const struct wfx_hif_msg *hif,
const void *buf) const void *buf)
{ {
const struct hif_ind_generic *body = buf; const struct wfx_hif_ind_generic *body = buf;
int type = le32_to_cpu(body->type); int type = le32_to_cpu(body->type);
switch (type) { switch (type) {
...@@ -308,9 +309,9 @@ static const struct { ...@@ -308,9 +309,9 @@ static const struct {
}; };
static int wfx_hif_error_indication(struct wfx_dev *wdev, static int wfx_hif_error_indication(struct wfx_dev *wdev,
const struct hif_msg *hif, const void *buf) const struct wfx_hif_msg *hif, const void *buf)
{ {
const struct hif_ind_error *body = buf; const struct wfx_hif_ind_error *body = buf;
int type = le32_to_cpu(body->type); int type = le32_to_cpu(body->type);
int param = (s8)body->data[0]; int param = (s8)body->data[0];
int i; int i;
...@@ -335,10 +336,10 @@ static int wfx_hif_error_indication(struct wfx_dev *wdev, ...@@ -335,10 +336,10 @@ static int wfx_hif_error_indication(struct wfx_dev *wdev,
}; };
static int wfx_hif_exception_indication(struct wfx_dev *wdev, static int wfx_hif_exception_indication(struct wfx_dev *wdev,
const struct hif_msg *hif, const struct wfx_hif_msg *hif,
const void *buf) const void *buf)
{ {
const struct hif_ind_exception *body = buf; const struct wfx_hif_ind_exception *body = buf;
int type = le32_to_cpu(body->type); int type = le32_to_cpu(body->type);
if (type == 4) if (type == 4)
...@@ -356,7 +357,7 @@ static int wfx_hif_exception_indication(struct wfx_dev *wdev, ...@@ -356,7 +357,7 @@ static int wfx_hif_exception_indication(struct wfx_dev *wdev,
static const struct { static const struct {
int msg_id; int msg_id;
int (*handler)(struct wfx_dev *wdev, int (*handler)(struct wfx_dev *wdev,
const struct hif_msg *hif, const void *buf); const struct wfx_hif_msg *hif, const void *buf);
} hif_handlers[] = { } hif_handlers[] = {
/* Confirmations */ /* Confirmations */
{ HIF_CNF_ID_TX, wfx_hif_tx_confirm }, { HIF_CNF_ID_TX, wfx_hif_tx_confirm },
...@@ -379,7 +380,7 @@ static const struct { ...@@ -379,7 +380,7 @@ static const struct {
void wfx_handle_rx(struct wfx_dev *wdev, struct sk_buff *skb) void wfx_handle_rx(struct wfx_dev *wdev, struct sk_buff *skb)
{ {
int i; int i;
const struct hif_msg *hif = (const struct hif_msg *)skb->data; const struct wfx_hif_msg *hif = (const struct hif_msg *)skb->data;
int hif_id = hif->id; int hif_id = hif->id;
if (hif_id == HIF_IND_ID_RX) { if (hif_id == HIF_IND_ID_RX) {
......
...@@ -22,7 +22,7 @@ void wfx_init_hif_cmd(struct wfx_hif_cmd *hif_cmd) ...@@ -22,7 +22,7 @@ void wfx_init_hif_cmd(struct wfx_hif_cmd *hif_cmd)
mutex_init(&hif_cmd->lock); mutex_init(&hif_cmd->lock);
} }
static void wfx_fill_header(struct hif_msg *hif, int if_id, static void wfx_fill_header(struct wfx_hif_msg *hif, int if_id,
unsigned int cmd, size_t size) unsigned int cmd, size_t size)
{ {
if (if_id == -1) if (if_id == -1)
...@@ -37,16 +37,16 @@ static void wfx_fill_header(struct hif_msg *hif, int if_id, ...@@ -37,16 +37,16 @@ static void wfx_fill_header(struct hif_msg *hif, int if_id,
hif->interface = if_id; hif->interface = if_id;
} }
static void *wfx_alloc_hif(size_t body_len, struct hif_msg **hif) static void *wfx_alloc_hif(size_t body_len, struct wfx_hif_msg **hif)
{ {
*hif = kzalloc(sizeof(struct hif_msg) + body_len, GFP_KERNEL); *hif = kzalloc(sizeof(struct wfx_hif_msg) + body_len, GFP_KERNEL);
if (*hif) if (*hif)
return (*hif)->body; return (*hif)->body;
else else
return NULL; return NULL;
} }
int wfx_cmd_send(struct wfx_dev *wdev, struct hif_msg *request, int wfx_cmd_send(struct wfx_dev *wdev, struct wfx_hif_msg *request,
void *reply, size_t reply_len, bool no_reply) void *reply, size_t reply_len, bool no_reply)
{ {
const char *mib_name = ""; const char *mib_name = "";
...@@ -125,7 +125,7 @@ int wfx_cmd_send(struct wfx_dev *wdev, struct hif_msg *request, ...@@ -125,7 +125,7 @@ int wfx_cmd_send(struct wfx_dev *wdev, struct hif_msg *request,
int wfx_hif_shutdown(struct wfx_dev *wdev) int wfx_hif_shutdown(struct wfx_dev *wdev)
{ {
int ret; int ret;
struct hif_msg *hif; struct wfx_hif_msg *hif;
wfx_alloc_hif(0, &hif); wfx_alloc_hif(0, &hif);
if (!hif) if (!hif)
...@@ -143,9 +143,9 @@ int wfx_hif_shutdown(struct wfx_dev *wdev) ...@@ -143,9 +143,9 @@ int wfx_hif_shutdown(struct wfx_dev *wdev)
int wfx_hif_configuration(struct wfx_dev *wdev, const u8 *conf, size_t len) int wfx_hif_configuration(struct wfx_dev *wdev, const u8 *conf, size_t len)
{ {
int ret; int ret;
size_t buf_len = sizeof(struct hif_req_configuration) + len; size_t buf_len = sizeof(struct wfx_hif_req_configuration) + len;
struct hif_msg *hif; struct wfx_hif_msg *hif;
struct hif_req_configuration *body = wfx_alloc_hif(buf_len, &hif); struct wfx_hif_req_configuration *body = wfx_alloc_hif(buf_len, &hif);
if (!hif) if (!hif)
return -ENOMEM; return -ENOMEM;
...@@ -160,8 +160,8 @@ int wfx_hif_configuration(struct wfx_dev *wdev, const u8 *conf, size_t len) ...@@ -160,8 +160,8 @@ int wfx_hif_configuration(struct wfx_dev *wdev, const u8 *conf, size_t len)
int wfx_hif_reset(struct wfx_vif *wvif, bool reset_stat) int wfx_hif_reset(struct wfx_vif *wvif, bool reset_stat)
{ {
int ret; int ret;
struct hif_msg *hif; struct wfx_hif_msg *hif;
struct hif_req_reset *body = wfx_alloc_hif(sizeof(*body), &hif); struct wfx_hif_req_reset *body = wfx_alloc_hif(sizeof(*body), &hif);
if (!hif) if (!hif)
return -ENOMEM; return -ENOMEM;
...@@ -176,10 +176,10 @@ int wfx_hif_read_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id, ...@@ -176,10 +176,10 @@ int wfx_hif_read_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id,
void *val, size_t val_len) void *val, size_t val_len)
{ {
int ret; int ret;
struct hif_msg *hif; struct wfx_hif_msg *hif;
int buf_len = sizeof(struct hif_cnf_read_mib) + val_len; int buf_len = sizeof(struct wfx_hif_cnf_read_mib) + val_len;
struct hif_req_read_mib *body = wfx_alloc_hif(sizeof(*body), &hif); struct wfx_hif_req_read_mib *body = wfx_alloc_hif(sizeof(*body), &hif);
struct hif_cnf_read_mib *reply = kmalloc(buf_len, GFP_KERNEL); struct wfx_hif_cnf_read_mib *reply = kmalloc(buf_len, GFP_KERNEL);
if (!body || !reply) { if (!body || !reply) {
ret = -ENOMEM; ret = -ENOMEM;
...@@ -212,9 +212,9 @@ int wfx_hif_write_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id, ...@@ -212,9 +212,9 @@ int wfx_hif_write_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id,
void *val, size_t val_len) void *val, size_t val_len)
{ {
int ret; int ret;
struct hif_msg *hif; struct wfx_hif_msg *hif;
int buf_len = sizeof(struct hif_req_write_mib) + val_len; int buf_len = sizeof(struct wfx_hif_req_write_mib) + val_len;
struct hif_req_write_mib *body = wfx_alloc_hif(buf_len, &hif); struct wfx_hif_req_write_mib *body = wfx_alloc_hif(buf_len, &hif);
if (!hif) if (!hif)
return -ENOMEM; return -ENOMEM;
...@@ -231,10 +231,10 @@ int wfx_hif_scan(struct wfx_vif *wvif, struct cfg80211_scan_request *req, ...@@ -231,10 +231,10 @@ int wfx_hif_scan(struct wfx_vif *wvif, struct cfg80211_scan_request *req,
int chan_start_idx, int chan_num) int chan_start_idx, int chan_num)
{ {
int ret, i; int ret, i;
struct hif_msg *hif; struct wfx_hif_msg *hif;
size_t buf_len = size_t buf_len = sizeof(struct wfx_hif_req_start_scan_alt) +
sizeof(struct hif_req_start_scan_alt) + chan_num * sizeof(u8); chan_num * sizeof(u8);
struct hif_req_start_scan_alt *body = wfx_alloc_hif(buf_len, &hif); struct wfx_hif_req_start_scan_alt *body = wfx_alloc_hif(buf_len, &hif);
WARN(chan_num > HIF_API_MAX_NB_CHANNELS, "invalid params"); WARN(chan_num > HIF_API_MAX_NB_CHANNELS, "invalid params");
WARN(req->n_ssids > HIF_API_MAX_NB_SSIDS, "invalid params"); WARN(req->n_ssids > HIF_API_MAX_NB_SSIDS, "invalid params");
...@@ -279,7 +279,7 @@ int wfx_hif_scan(struct wfx_vif *wvif, struct cfg80211_scan_request *req, ...@@ -279,7 +279,7 @@ int wfx_hif_scan(struct wfx_vif *wvif, struct cfg80211_scan_request *req,
int wfx_hif_stop_scan(struct wfx_vif *wvif) int wfx_hif_stop_scan(struct wfx_vif *wvif)
{ {
int ret; int ret;
struct hif_msg *hif; struct wfx_hif_msg *hif;
/* body associated to HIF_REQ_ID_STOP_SCAN is empty */ /* body associated to HIF_REQ_ID_STOP_SCAN is empty */
wfx_alloc_hif(0, &hif); wfx_alloc_hif(0, &hif);
...@@ -295,8 +295,8 @@ int wfx_hif_join(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf, ...@@ -295,8 +295,8 @@ int wfx_hif_join(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf,
struct ieee80211_channel *channel, const u8 *ssid, int ssidlen) struct ieee80211_channel *channel, const u8 *ssid, int ssidlen)
{ {
int ret; int ret;
struct hif_msg *hif; struct wfx_hif_msg *hif;
struct hif_req_join *body = wfx_alloc_hif(sizeof(*body), &hif); struct wfx_hif_req_join *body = wfx_alloc_hif(sizeof(*body), &hif);
WARN_ON(!conf->beacon_int); WARN_ON(!conf->beacon_int);
WARN_ON(!conf->basic_rates); WARN_ON(!conf->basic_rates);
...@@ -325,9 +325,9 @@ int wfx_hif_join(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf, ...@@ -325,9 +325,9 @@ int wfx_hif_join(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf,
int wfx_hif_set_bss_params(struct wfx_vif *wvif, int aid, int beacon_lost_count) int wfx_hif_set_bss_params(struct wfx_vif *wvif, int aid, int beacon_lost_count)
{ {
int ret; int ret;
struct hif_msg *hif; struct wfx_hif_msg *hif;
struct hif_req_set_bss_params *body = struct wfx_hif_req_set_bss_params *body = wfx_alloc_hif(sizeof(*body),
wfx_alloc_hif(sizeof(*body), &hif); &hif);
if (!hif) if (!hif)
return -ENOMEM; return -ENOMEM;
...@@ -340,12 +340,12 @@ int wfx_hif_set_bss_params(struct wfx_vif *wvif, int aid, int beacon_lost_count) ...@@ -340,12 +340,12 @@ int wfx_hif_set_bss_params(struct wfx_vif *wvif, int aid, int beacon_lost_count)
return ret; return ret;
} }
int wfx_hif_add_key(struct wfx_dev *wdev, const struct hif_req_add_key *arg) int wfx_hif_add_key(struct wfx_dev *wdev, const struct wfx_hif_req_add_key *arg)
{ {
int ret; int ret;
struct hif_msg *hif; struct wfx_hif_msg *hif;
/* FIXME: only send necessary bits */ /* FIXME: only send necessary bits */
struct hif_req_add_key *body = wfx_alloc_hif(sizeof(*body), &hif); struct wfx_hif_req_add_key *body = wfx_alloc_hif(sizeof(*body), &hif);
if (!hif) if (!hif)
return -ENOMEM; return -ENOMEM;
...@@ -367,8 +367,8 @@ int wfx_hif_add_key(struct wfx_dev *wdev, const struct hif_req_add_key *arg) ...@@ -367,8 +367,8 @@ int wfx_hif_add_key(struct wfx_dev *wdev, const struct hif_req_add_key *arg)
int wfx_hif_remove_key(struct wfx_dev *wdev, int idx) int wfx_hif_remove_key(struct wfx_dev *wdev, int idx)
{ {
int ret; int ret;
struct hif_msg *hif; struct wfx_hif_msg *hif;
struct hif_req_remove_key *body = wfx_alloc_hif(sizeof(*body), &hif); struct wfx_hif_req_remove_key *body = wfx_alloc_hif(sizeof(*body), &hif);
if (!hif) if (!hif)
return -ENOMEM; return -ENOMEM;
...@@ -383,9 +383,9 @@ int wfx_hif_set_edca_queue_params(struct wfx_vif *wvif, u16 queue, ...@@ -383,9 +383,9 @@ int wfx_hif_set_edca_queue_params(struct wfx_vif *wvif, u16 queue,
const struct ieee80211_tx_queue_params *arg) const struct ieee80211_tx_queue_params *arg)
{ {
int ret; int ret;
struct hif_msg *hif; struct wfx_hif_msg *hif;
struct hif_req_edca_queue_params *body = wfx_alloc_hif(sizeof(*body), struct wfx_hif_req_edca_queue_params *body = wfx_alloc_hif(sizeof(*body),
&hif); &hif);
if (!body) if (!body)
return -ENOMEM; return -ENOMEM;
...@@ -413,8 +413,9 @@ int wfx_hif_set_edca_queue_params(struct wfx_vif *wvif, u16 queue, ...@@ -413,8 +413,9 @@ int wfx_hif_set_edca_queue_params(struct wfx_vif *wvif, u16 queue,
int wfx_hif_set_pm(struct wfx_vif *wvif, bool ps, int dynamic_ps_timeout) int wfx_hif_set_pm(struct wfx_vif *wvif, bool ps, int dynamic_ps_timeout)
{ {
int ret; int ret;
struct hif_msg *hif; struct wfx_hif_msg *hif;
struct hif_req_set_pm_mode *body = wfx_alloc_hif(sizeof(*body), &hif); struct wfx_hif_req_set_pm_mode *body = wfx_alloc_hif(sizeof(*body),
&hif);
if (!body) if (!body)
return -ENOMEM; return -ENOMEM;
...@@ -438,8 +439,8 @@ int wfx_hif_start(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf, ...@@ -438,8 +439,8 @@ int wfx_hif_start(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf,
const struct ieee80211_channel *channel) const struct ieee80211_channel *channel)
{ {
int ret; int ret;
struct hif_msg *hif; struct wfx_hif_msg *hif;
struct hif_req_start *body = wfx_alloc_hif(sizeof(*body), &hif); struct wfx_hif_req_start *body = wfx_alloc_hif(sizeof(*body), &hif);
WARN_ON(!conf->beacon_int); WARN_ON(!conf->beacon_int);
if (!hif) if (!hif)
...@@ -461,9 +462,9 @@ int wfx_hif_start(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf, ...@@ -461,9 +462,9 @@ int wfx_hif_start(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf,
int wfx_hif_beacon_transmit(struct wfx_vif *wvif, bool enable) int wfx_hif_beacon_transmit(struct wfx_vif *wvif, bool enable)
{ {
int ret; int ret;
struct hif_msg *hif; struct wfx_hif_msg *hif;
struct hif_req_beacon_transmit *body = wfx_alloc_hif(sizeof(*body), struct wfx_hif_req_beacon_transmit *body = wfx_alloc_hif(sizeof(*body),
&hif); &hif);
if (!hif) if (!hif)
return -ENOMEM; return -ENOMEM;
...@@ -479,8 +480,8 @@ int wfx_hif_map_link(struct wfx_vif *wvif, bool unmap, u8 *mac_addr, int sta_id, ...@@ -479,8 +480,8 @@ int wfx_hif_map_link(struct wfx_vif *wvif, bool unmap, u8 *mac_addr, int sta_id,
bool mfp) bool mfp)
{ {
int ret; int ret;
struct hif_msg *hif; struct wfx_hif_msg *hif;
struct hif_req_map_link *body = wfx_alloc_hif(sizeof(*body), &hif); struct wfx_hif_req_map_link *body = wfx_alloc_hif(sizeof(*body), &hif);
if (!hif) if (!hif)
return -ENOMEM; return -ENOMEM;
...@@ -499,9 +500,9 @@ int wfx_hif_update_ie_beacon(struct wfx_vif *wvif, ...@@ -499,9 +500,9 @@ int wfx_hif_update_ie_beacon(struct wfx_vif *wvif,
const u8 *ies, size_t ies_len) const u8 *ies, size_t ies_len)
{ {
int ret; int ret;
struct hif_msg *hif; struct wfx_hif_msg *hif;
int buf_len = sizeof(struct hif_req_update_ie) + ies_len; int buf_len = sizeof(struct wfx_hif_req_update_ie) + ies_len;
struct hif_req_update_ie *body = wfx_alloc_hif(buf_len, &hif); struct wfx_hif_req_update_ie *body = wfx_alloc_hif(buf_len, &hif);
if (!hif) if (!hif)
return -ENOMEM; return -ENOMEM;
......
...@@ -18,22 +18,22 @@ struct ieee80211_channel; ...@@ -18,22 +18,22 @@ struct ieee80211_channel;
struct ieee80211_bss_conf; struct ieee80211_bss_conf;
struct ieee80211_tx_queue_params; struct ieee80211_tx_queue_params;
struct cfg80211_scan_request; struct cfg80211_scan_request;
struct hif_req_add_key; struct wfx_hif_req_add_key;
struct wfx_dev; struct wfx_dev;
struct wfx_vif; struct wfx_vif;
struct wfx_hif_cmd { struct wfx_hif_cmd {
struct mutex lock; struct mutex lock;
struct completion ready; struct completion ready;
struct completion done; struct completion done;
struct hif_msg *buf_send; struct wfx_hif_msg *buf_send;
void *buf_recv; void *buf_recv;
size_t len_recv; size_t len_recv;
int ret; int ret;
}; };
void wfx_init_hif_cmd(struct wfx_hif_cmd *wfx_hif_cmd); void wfx_init_hif_cmd(struct wfx_hif_cmd *wfx_hif_cmd);
int wfx_cmd_send(struct wfx_dev *wdev, struct hif_msg *request, int wfx_cmd_send(struct wfx_dev *wdev, struct wfx_hif_msg *request,
void *reply, size_t reply_len, bool async); void *reply, size_t reply_len, bool async);
int wfx_hif_read_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id, int wfx_hif_read_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id,
...@@ -47,7 +47,7 @@ int wfx_hif_join(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf, ...@@ -47,7 +47,7 @@ int wfx_hif_join(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf,
struct ieee80211_channel *channel, const u8 *ssid, int ssidlen); struct ieee80211_channel *channel, const u8 *ssid, int ssidlen);
int wfx_hif_map_link(struct wfx_vif *wvif, int wfx_hif_map_link(struct wfx_vif *wvif,
bool unmap, u8 *mac_addr, int sta_id, bool mfp); bool unmap, u8 *mac_addr, int sta_id, bool mfp);
int wfx_hif_add_key(struct wfx_dev *wdev, const struct hif_req_add_key *arg); int wfx_hif_add_key(struct wfx_dev *wdev, const struct wfx_hif_req_add_key *arg);
int wfx_hif_remove_key(struct wfx_dev *wdev, int idx); int wfx_hif_remove_key(struct wfx_dev *wdev, int idx);
int wfx_hif_set_pm(struct wfx_vif *wvif, bool ps, int dynamic_ps_timeout); int wfx_hif_set_pm(struct wfx_vif *wvif, bool ps, int dynamic_ps_timeout);
int wfx_hif_set_bss_params(struct wfx_vif *wvif, int aid, int beacon_lost_count); int wfx_hif_set_bss_params(struct wfx_vif *wvif, int aid, int beacon_lost_count);
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
int wfx_hif_set_output_power(struct wfx_vif *wvif, int val) int wfx_hif_set_output_power(struct wfx_vif *wvif, int val)
{ {
struct hif_mib_current_tx_power_level arg = { struct wfx_hif_mib_current_tx_power_level arg = {
.power_level = cpu_to_le32(val * 10), .power_level = cpu_to_le32(val * 10),
}; };
...@@ -29,7 +29,7 @@ int wfx_hif_set_beacon_wakeup_period(struct wfx_vif *wvif, ...@@ -29,7 +29,7 @@ int wfx_hif_set_beacon_wakeup_period(struct wfx_vif *wvif,
unsigned int dtim_interval, unsigned int dtim_interval,
unsigned int listen_interval) unsigned int listen_interval)
{ {
struct hif_mib_beacon_wake_up_period arg = { struct wfx_hif_mib_beacon_wake_up_period arg = {
.wakeup_period_min = dtim_interval, .wakeup_period_min = dtim_interval,
.receive_dtim = 0, .receive_dtim = 0,
.wakeup_period_max = listen_interval, .wakeup_period_max = listen_interval,
...@@ -45,7 +45,7 @@ int wfx_hif_set_beacon_wakeup_period(struct wfx_vif *wvif, ...@@ -45,7 +45,7 @@ int wfx_hif_set_beacon_wakeup_period(struct wfx_vif *wvif,
int wfx_hif_set_rcpi_rssi_threshold(struct wfx_vif *wvif, int wfx_hif_set_rcpi_rssi_threshold(struct wfx_vif *wvif,
int rssi_thold, int rssi_hyst) int rssi_thold, int rssi_hyst)
{ {
struct hif_mib_rcpi_rssi_threshold arg = { struct wfx_hif_mib_rcpi_rssi_threshold arg = {
.rolling_average_count = 8, .rolling_average_count = 8,
.detection = 1, .detection = 1,
}; };
...@@ -66,23 +66,23 @@ int wfx_hif_set_rcpi_rssi_threshold(struct wfx_vif *wvif, ...@@ -66,23 +66,23 @@ int wfx_hif_set_rcpi_rssi_threshold(struct wfx_vif *wvif,
} }
int wfx_hif_get_counters_table(struct wfx_dev *wdev, int vif_id, int wfx_hif_get_counters_table(struct wfx_dev *wdev, int vif_id,
struct hif_mib_extended_count_table *arg) struct wfx_hif_mib_extended_count_table *arg)
{ {
if (wfx_api_older_than(wdev, 1, 3)) { if (wfx_api_older_than(wdev, 1, 3)) {
/* extended_count_table is wider than count_table */ /* extended_count_table is wider than count_table */
memset(arg, 0xFF, sizeof(*arg)); memset(arg, 0xFF, sizeof(*arg));
return wfx_hif_read_mib(wdev, vif_id, HIF_MIB_ID_COUNTERS_TABLE, return wfx_hif_read_mib(wdev, vif_id, HIF_MIB_ID_COUNTERS_TABLE,
arg, sizeof(struct hif_mib_count_table)); arg, sizeof(struct wfx_hif_mib_count_table));
} else { } else {
return wfx_hif_read_mib(wdev, vif_id, return wfx_hif_read_mib(wdev, vif_id,
HIF_MIB_ID_EXTENDED_COUNTERS_TABLE, arg, HIF_MIB_ID_EXTENDED_COUNTERS_TABLE, arg,
sizeof(struct hif_mib_extended_count_table)); sizeof(struct wfx_hif_mib_extended_count_table));
} }
} }
int wfx_hif_set_macaddr(struct wfx_vif *wvif, u8 *mac) int wfx_hif_set_macaddr(struct wfx_vif *wvif, u8 *mac)
{ {
struct hif_mib_mac_address arg = { }; struct wfx_hif_mib_mac_address arg = { };
if (mac) if (mac)
ether_addr_copy(arg.mac_addr, mac); ether_addr_copy(arg.mac_addr, mac);
...@@ -94,7 +94,7 @@ int wfx_hif_set_macaddr(struct wfx_vif *wvif, u8 *mac) ...@@ -94,7 +94,7 @@ int wfx_hif_set_macaddr(struct wfx_vif *wvif, u8 *mac)
int wfx_hif_set_rx_filter(struct wfx_vif *wvif, int wfx_hif_set_rx_filter(struct wfx_vif *wvif,
bool filter_bssid, bool filter_prbreq) bool filter_bssid, bool filter_prbreq)
{ {
struct hif_mib_rx_filter arg = { }; struct wfx_hif_mib_rx_filter arg = { };
if (filter_bssid) if (filter_bssid)
arg.bssid_filter = 1; arg.bssid_filter = 1;
...@@ -105,10 +105,10 @@ int wfx_hif_set_rx_filter(struct wfx_vif *wvif, ...@@ -105,10 +105,10 @@ int wfx_hif_set_rx_filter(struct wfx_vif *wvif,
} }
int wfx_hif_set_beacon_filter_table(struct wfx_vif *wvif, int tbl_len, int wfx_hif_set_beacon_filter_table(struct wfx_vif *wvif, int tbl_len,
const struct hif_ie_table_entry *tbl) const struct wfx_hif_ie_table_entry *tbl)
{ {
int ret; int ret;
struct hif_mib_bcn_filter_table *arg; struct wfx_hif_mib_bcn_filter_table *arg;
int buf_len = struct_size(arg, ie_table, tbl_len); int buf_len = struct_size(arg, ie_table, tbl_len);
arg = kzalloc(buf_len, GFP_KERNEL); arg = kzalloc(buf_len, GFP_KERNEL);
...@@ -125,7 +125,7 @@ int wfx_hif_set_beacon_filter_table(struct wfx_vif *wvif, int tbl_len, ...@@ -125,7 +125,7 @@ int wfx_hif_set_beacon_filter_table(struct wfx_vif *wvif, int tbl_len,
int wfx_hif_beacon_filter_control(struct wfx_vif *wvif, int wfx_hif_beacon_filter_control(struct wfx_vif *wvif,
int enable, int beacon_count) int enable, int beacon_count)
{ {
struct hif_mib_bcn_filter_enable arg = { struct wfx_hif_mib_bcn_filter_enable arg = {
.enable = cpu_to_le32(enable), .enable = cpu_to_le32(enable),
.bcn_count = cpu_to_le32(beacon_count), .bcn_count = cpu_to_le32(beacon_count),
}; };
...@@ -135,9 +135,9 @@ int wfx_hif_beacon_filter_control(struct wfx_vif *wvif, ...@@ -135,9 +135,9 @@ int wfx_hif_beacon_filter_control(struct wfx_vif *wvif,
} }
int wfx_hif_set_operational_mode(struct wfx_dev *wdev, int wfx_hif_set_operational_mode(struct wfx_dev *wdev,
enum hif_op_power_mode mode) enum wfx_hif_op_power_mode mode)
{ {
struct hif_mib_gl_operational_power_mode arg = { struct wfx_hif_mib_gl_operational_power_mode arg = {
.power_mode = mode, .power_mode = mode,
.wup_ind_activation = 1, .wup_ind_activation = 1,
}; };
...@@ -149,11 +149,11 @@ int wfx_hif_set_operational_mode(struct wfx_dev *wdev, ...@@ -149,11 +149,11 @@ int wfx_hif_set_operational_mode(struct wfx_dev *wdev,
int wfx_hif_set_template_frame(struct wfx_vif *wvif, struct sk_buff *skb, int wfx_hif_set_template_frame(struct wfx_vif *wvif, struct sk_buff *skb,
u8 frame_type, int init_rate) u8 frame_type, int init_rate)
{ {
struct hif_mib_template_frame *arg; struct wfx_hif_mib_template_frame *arg;
WARN(skb->len > HIF_API_MAX_TEMPLATE_FRAME_SIZE, "frame is too big"); WARN(skb->len > HIF_API_MAX_TEMPLATE_FRAME_SIZE, "frame is too big");
skb_push(skb, 4); skb_push(skb, 4);
arg = (struct hif_mib_template_frame *)skb->data; arg = (struct wfx_hif_mib_template_frame *)skb->data;
skb_pull(skb, 4); skb_pull(skb, 4);
arg->init_rate = init_rate; arg->init_rate = init_rate;
arg->frame_type = frame_type; arg->frame_type = frame_type;
...@@ -164,7 +164,7 @@ int wfx_hif_set_template_frame(struct wfx_vif *wvif, struct sk_buff *skb, ...@@ -164,7 +164,7 @@ int wfx_hif_set_template_frame(struct wfx_vif *wvif, struct sk_buff *skb,
int wfx_hif_set_mfp(struct wfx_vif *wvif, bool capable, bool required) int wfx_hif_set_mfp(struct wfx_vif *wvif, bool capable, bool required)
{ {
struct hif_mib_protected_mgmt_policy arg = { }; struct wfx_hif_mib_protected_mgmt_policy arg = { };
WARN(required && !capable, "incoherent arguments"); WARN(required && !capable, "incoherent arguments");
if (capable) { if (capable) {
...@@ -181,7 +181,7 @@ int wfx_hif_set_mfp(struct wfx_vif *wvif, bool capable, bool required) ...@@ -181,7 +181,7 @@ int wfx_hif_set_mfp(struct wfx_vif *wvif, bool capable, bool required)
int wfx_hif_set_block_ack_policy(struct wfx_vif *wvif, int wfx_hif_set_block_ack_policy(struct wfx_vif *wvif,
u8 tx_tid_policy, u8 rx_tid_policy) u8 tx_tid_policy, u8 rx_tid_policy)
{ {
struct hif_mib_block_ack_policy arg = { struct wfx_hif_mib_block_ack_policy arg = {
.block_ack_tx_tid_policy = tx_tid_policy, .block_ack_tx_tid_policy = tx_tid_policy,
.block_ack_rx_tid_policy = rx_tid_policy, .block_ack_rx_tid_policy = rx_tid_policy,
}; };
...@@ -194,7 +194,7 @@ int wfx_hif_set_block_ack_policy(struct wfx_vif *wvif, ...@@ -194,7 +194,7 @@ int wfx_hif_set_block_ack_policy(struct wfx_vif *wvif,
int wfx_hif_set_association_mode(struct wfx_vif *wvif, int ampdu_density, int wfx_hif_set_association_mode(struct wfx_vif *wvif, int ampdu_density,
bool greenfield, bool short_preamble) bool greenfield, bool short_preamble)
{ {
struct hif_mib_set_association_mode arg = { struct wfx_hif_mib_set_association_mode arg = {
.preambtype_use = 1, .preambtype_use = 1,
.mode = 1, .mode = 1,
.spacing = 1, .spacing = 1,
...@@ -211,7 +211,7 @@ int wfx_hif_set_association_mode(struct wfx_vif *wvif, int ampdu_density, ...@@ -211,7 +211,7 @@ int wfx_hif_set_association_mode(struct wfx_vif *wvif, int ampdu_density,
int wfx_hif_set_tx_rate_retry_policy(struct wfx_vif *wvif, int wfx_hif_set_tx_rate_retry_policy(struct wfx_vif *wvif,
int policy_index, u8 *rates) int policy_index, u8 *rates)
{ {
struct hif_mib_set_tx_rate_retry_policy *arg; struct wfx_hif_mib_set_tx_rate_retry_policy *arg;
size_t size = struct_size(arg, tx_rate_retry_policy, 1); size_t size = struct_size(arg, tx_rate_retry_policy, 1);
int ret; int ret;
...@@ -236,7 +236,7 @@ int wfx_hif_set_tx_rate_retry_policy(struct wfx_vif *wvif, ...@@ -236,7 +236,7 @@ int wfx_hif_set_tx_rate_retry_policy(struct wfx_vif *wvif,
int wfx_hif_keep_alive_period(struct wfx_vif *wvif, int period) int wfx_hif_keep_alive_period(struct wfx_vif *wvif, int period)
{ {
struct hif_mib_keep_alive_period arg = { struct wfx_hif_mib_keep_alive_period arg = {
.keep_alive_period = cpu_to_le16(period), .keep_alive_period = cpu_to_le16(period),
}; };
...@@ -247,7 +247,7 @@ int wfx_hif_keep_alive_period(struct wfx_vif *wvif, int period) ...@@ -247,7 +247,7 @@ int wfx_hif_keep_alive_period(struct wfx_vif *wvif, int period)
int wfx_hif_set_arp_ipv4_filter(struct wfx_vif *wvif, int idx, __be32 *addr) int wfx_hif_set_arp_ipv4_filter(struct wfx_vif *wvif, int idx, __be32 *addr)
{ {
struct hif_mib_arp_ip_addr_table arg = { struct wfx_hif_mib_arp_ip_addr_table arg = {
.condition_idx = idx, .condition_idx = idx,
.arp_enable = HIF_ARP_NS_FILTERING_DISABLE, .arp_enable = HIF_ARP_NS_FILTERING_DISABLE,
}; };
...@@ -264,7 +264,7 @@ int wfx_hif_set_arp_ipv4_filter(struct wfx_vif *wvif, int idx, __be32 *addr) ...@@ -264,7 +264,7 @@ int wfx_hif_set_arp_ipv4_filter(struct wfx_vif *wvif, int idx, __be32 *addr)
int wfx_hif_use_multi_tx_conf(struct wfx_dev *wdev, bool enable) int wfx_hif_use_multi_tx_conf(struct wfx_dev *wdev, bool enable)
{ {
struct hif_mib_gl_set_multi_msg arg = { struct wfx_hif_mib_gl_set_multi_msg arg = {
.enable_multi_tx_conf = enable, .enable_multi_tx_conf = enable,
}; };
...@@ -274,7 +274,7 @@ int wfx_hif_use_multi_tx_conf(struct wfx_dev *wdev, bool enable) ...@@ -274,7 +274,7 @@ int wfx_hif_use_multi_tx_conf(struct wfx_dev *wdev, bool enable)
int wfx_hif_set_uapsd_info(struct wfx_vif *wvif, unsigned long val) int wfx_hif_set_uapsd_info(struct wfx_vif *wvif, unsigned long val)
{ {
struct hif_mib_set_uapsd_information arg = { }; struct wfx_hif_mib_set_uapsd_information arg = { };
if (val & BIT(IEEE80211_AC_VO)) if (val & BIT(IEEE80211_AC_VO))
arg.trig_voice = 1; arg.trig_voice = 1;
...@@ -291,7 +291,7 @@ int wfx_hif_set_uapsd_info(struct wfx_vif *wvif, unsigned long val) ...@@ -291,7 +291,7 @@ int wfx_hif_set_uapsd_info(struct wfx_vif *wvif, unsigned long val)
int wfx_hif_erp_use_protection(struct wfx_vif *wvif, bool enable) int wfx_hif_erp_use_protection(struct wfx_vif *wvif, bool enable)
{ {
struct hif_mib_non_erp_protection arg = { struct wfx_hif_mib_non_erp_protection arg = {
.use_cts_to_self = enable, .use_cts_to_self = enable,
}; };
...@@ -302,7 +302,7 @@ int wfx_hif_erp_use_protection(struct wfx_vif *wvif, bool enable) ...@@ -302,7 +302,7 @@ int wfx_hif_erp_use_protection(struct wfx_vif *wvif, bool enable)
int wfx_hif_slot_time(struct wfx_vif *wvif, int val) int wfx_hif_slot_time(struct wfx_vif *wvif, int val)
{ {
struct hif_mib_slot_time arg = { struct wfx_hif_mib_slot_time arg = {
.slot_time = cpu_to_le32(val), .slot_time = cpu_to_le32(val),
}; };
...@@ -312,7 +312,7 @@ int wfx_hif_slot_time(struct wfx_vif *wvif, int val) ...@@ -312,7 +312,7 @@ int wfx_hif_slot_time(struct wfx_vif *wvif, int val)
int wfx_hif_wep_default_key_id(struct wfx_vif *wvif, int val) int wfx_hif_wep_default_key_id(struct wfx_vif *wvif, int val)
{ {
struct hif_mib_wep_default_key_id arg = { struct wfx_hif_mib_wep_default_key_id arg = {
.wep_default_key_id = val, .wep_default_key_id = val,
}; };
...@@ -323,7 +323,7 @@ int wfx_hif_wep_default_key_id(struct wfx_vif *wvif, int val) ...@@ -323,7 +323,7 @@ int wfx_hif_wep_default_key_id(struct wfx_vif *wvif, int val)
int wfx_hif_rts_threshold(struct wfx_vif *wvif, int val) int wfx_hif_rts_threshold(struct wfx_vif *wvif, int val)
{ {
struct hif_mib_dot11_rts_threshold arg = { struct wfx_hif_mib_dot11_rts_threshold arg = {
.threshold = cpu_to_le32(val >= 0 ? val : 0xFFFF), .threshold = cpu_to_le32(val >= 0 ? val : 0xFFFF),
}; };
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
struct sk_buff; struct sk_buff;
struct wfx_vif; struct wfx_vif;
struct wfx_dev; struct wfx_dev;
struct hif_ie_table_entry; struct wfx_hif_ie_table_entry;
struct hif_mib_extended_count_table; struct wfx_hif_mib_extended_count_table;
int wfx_hif_set_output_power(struct wfx_vif *wvif, int val); int wfx_hif_set_output_power(struct wfx_vif *wvif, int val);
int wfx_hif_set_beacon_wakeup_period(struct wfx_vif *wvif, int wfx_hif_set_beacon_wakeup_period(struct wfx_vif *wvif,
...@@ -24,16 +24,16 @@ int wfx_hif_set_beacon_wakeup_period(struct wfx_vif *wvif, ...@@ -24,16 +24,16 @@ int wfx_hif_set_beacon_wakeup_period(struct wfx_vif *wvif,
int wfx_hif_set_rcpi_rssi_threshold(struct wfx_vif *wvif, int wfx_hif_set_rcpi_rssi_threshold(struct wfx_vif *wvif,
int rssi_thold, int rssi_hyst); int rssi_thold, int rssi_hyst);
int wfx_hif_get_counters_table(struct wfx_dev *wdev, int vif_id, int wfx_hif_get_counters_table(struct wfx_dev *wdev, int vif_id,
struct hif_mib_extended_count_table *arg); struct wfx_hif_mib_extended_count_table *arg);
int wfx_hif_set_macaddr(struct wfx_vif *wvif, u8 *mac); int wfx_hif_set_macaddr(struct wfx_vif *wvif, u8 *mac);
int wfx_hif_set_rx_filter(struct wfx_vif *wvif, int wfx_hif_set_rx_filter(struct wfx_vif *wvif,
bool filter_bssid, bool fwd_probe_req); bool filter_bssid, bool fwd_probe_req);
int wfx_hif_set_beacon_filter_table(struct wfx_vif *wvif, int tbl_len, int wfx_hif_set_beacon_filter_table(struct wfx_vif *wvif, int tbl_len,
const struct hif_ie_table_entry *tbl); const struct wfx_hif_ie_table_entry *tbl);
int wfx_hif_beacon_filter_control(struct wfx_vif *wvif, int wfx_hif_beacon_filter_control(struct wfx_vif *wvif,
int enable, int beacon_count); int enable, int beacon_count);
int wfx_hif_set_operational_mode(struct wfx_dev *wdev, int wfx_hif_set_operational_mode(struct wfx_dev *wdev,
enum hif_op_power_mode mode); enum wfx_hif_op_power_mode mode);
int wfx_hif_set_template_frame(struct wfx_vif *wvif, struct sk_buff *skb, int wfx_hif_set_template_frame(struct wfx_vif *wvif, struct sk_buff *skb,
u8 frame_type, int init_rate); u8 frame_type, int init_rate);
int wfx_hif_set_mfp(struct wfx_vif *wvif, bool capable, bool required); int wfx_hif_set_mfp(struct wfx_vif *wvif, bool capable, bool required);
......
...@@ -30,7 +30,7 @@ static void wfx_free_key(struct wfx_dev *wdev, int idx) ...@@ -30,7 +30,7 @@ static void wfx_free_key(struct wfx_dev *wdev, int idx)
wdev->key_map &= ~BIT(idx); wdev->key_map &= ~BIT(idx);
} }
static u8 fill_wep_pair(struct hif_wep_pairwise_key *msg, static u8 fill_wep_pair(struct wfx_hif_wep_pairwise_key *msg,
struct ieee80211_key_conf *key, u8 *peer_addr) struct ieee80211_key_conf *key, u8 *peer_addr)
{ {
WARN(key->keylen > sizeof(msg->key_data), "inconsistent data"); WARN(key->keylen > sizeof(msg->key_data), "inconsistent data");
...@@ -40,7 +40,7 @@ static u8 fill_wep_pair(struct hif_wep_pairwise_key *msg, ...@@ -40,7 +40,7 @@ static u8 fill_wep_pair(struct hif_wep_pairwise_key *msg,
return HIF_KEY_TYPE_WEP_PAIRWISE; return HIF_KEY_TYPE_WEP_PAIRWISE;
} }
static u8 fill_wep_group(struct hif_wep_group_key *msg, static u8 fill_wep_group(struct wfx_hif_wep_group_key *msg,
struct ieee80211_key_conf *key) struct ieee80211_key_conf *key)
{ {
WARN(key->keylen > sizeof(msg->key_data), "inconsistent data"); WARN(key->keylen > sizeof(msg->key_data), "inconsistent data");
...@@ -50,7 +50,7 @@ static u8 fill_wep_group(struct hif_wep_group_key *msg, ...@@ -50,7 +50,7 @@ static u8 fill_wep_group(struct hif_wep_group_key *msg,
return HIF_KEY_TYPE_WEP_DEFAULT; return HIF_KEY_TYPE_WEP_DEFAULT;
} }
static u8 fill_tkip_pair(struct hif_tkip_pairwise_key *msg, static u8 fill_tkip_pair(struct wfx_hif_tkip_pairwise_key *msg,
struct ieee80211_key_conf *key, u8 *peer_addr) struct ieee80211_key_conf *key, u8 *peer_addr)
{ {
u8 *keybuf = key->key; u8 *keybuf = key->key;
...@@ -67,7 +67,7 @@ static u8 fill_tkip_pair(struct hif_tkip_pairwise_key *msg, ...@@ -67,7 +67,7 @@ static u8 fill_tkip_pair(struct hif_tkip_pairwise_key *msg,
return HIF_KEY_TYPE_TKIP_PAIRWISE; return HIF_KEY_TYPE_TKIP_PAIRWISE;
} }
static u8 fill_tkip_group(struct hif_tkip_group_key *msg, static u8 fill_tkip_group(struct wfx_hif_tkip_group_key *msg,
struct ieee80211_key_conf *key, struct ieee80211_key_conf *key,
struct ieee80211_key_seq *seq, struct ieee80211_key_seq *seq,
enum nl80211_iftype iftype) enum nl80211_iftype iftype)
...@@ -92,7 +92,7 @@ static u8 fill_tkip_group(struct hif_tkip_group_key *msg, ...@@ -92,7 +92,7 @@ static u8 fill_tkip_group(struct hif_tkip_group_key *msg,
return HIF_KEY_TYPE_TKIP_GROUP; return HIF_KEY_TYPE_TKIP_GROUP;
} }
static u8 fill_ccmp_pair(struct hif_aes_pairwise_key *msg, static u8 fill_ccmp_pair(struct wfx_hif_aes_pairwise_key *msg,
struct ieee80211_key_conf *key, u8 *peer_addr) struct ieee80211_key_conf *key, u8 *peer_addr)
{ {
WARN(key->keylen != sizeof(msg->aes_key_data), "inconsistent data"); WARN(key->keylen != sizeof(msg->aes_key_data), "inconsistent data");
...@@ -101,7 +101,7 @@ static u8 fill_ccmp_pair(struct hif_aes_pairwise_key *msg, ...@@ -101,7 +101,7 @@ static u8 fill_ccmp_pair(struct hif_aes_pairwise_key *msg,
return HIF_KEY_TYPE_AES_PAIRWISE; return HIF_KEY_TYPE_AES_PAIRWISE;
} }
static u8 fill_ccmp_group(struct hif_aes_group_key *msg, static u8 fill_ccmp_group(struct wfx_hif_aes_group_key *msg,
struct ieee80211_key_conf *key, struct ieee80211_key_conf *key,
struct ieee80211_key_seq *seq) struct ieee80211_key_seq *seq)
{ {
...@@ -113,7 +113,7 @@ static u8 fill_ccmp_group(struct hif_aes_group_key *msg, ...@@ -113,7 +113,7 @@ static u8 fill_ccmp_group(struct hif_aes_group_key *msg,
return HIF_KEY_TYPE_AES_GROUP; return HIF_KEY_TYPE_AES_GROUP;
} }
static u8 fill_sms4_pair(struct hif_wapi_pairwise_key *msg, static u8 fill_sms4_pair(struct wfx_hif_wapi_pairwise_key *msg,
struct ieee80211_key_conf *key, u8 *peer_addr) struct ieee80211_key_conf *key, u8 *peer_addr)
{ {
u8 *keybuf = key->key; u8 *keybuf = key->key;
...@@ -128,7 +128,7 @@ static u8 fill_sms4_pair(struct hif_wapi_pairwise_key *msg, ...@@ -128,7 +128,7 @@ static u8 fill_sms4_pair(struct hif_wapi_pairwise_key *msg,
return HIF_KEY_TYPE_WAPI_PAIRWISE; return HIF_KEY_TYPE_WAPI_PAIRWISE;
} }
static u8 fill_sms4_group(struct hif_wapi_group_key *msg, static u8 fill_sms4_group(struct wfx_hif_wapi_group_key *msg,
struct ieee80211_key_conf *key) struct ieee80211_key_conf *key)
{ {
u8 *keybuf = key->key; u8 *keybuf = key->key;
...@@ -142,7 +142,7 @@ static u8 fill_sms4_group(struct hif_wapi_group_key *msg, ...@@ -142,7 +142,7 @@ static u8 fill_sms4_group(struct hif_wapi_group_key *msg,
return HIF_KEY_TYPE_WAPI_GROUP; return HIF_KEY_TYPE_WAPI_GROUP;
} }
static u8 fill_aes_cmac_group(struct hif_igtk_group_key *msg, static u8 fill_aes_cmac_group(struct wfx_hif_igtk_group_key *msg,
struct ieee80211_key_conf *key, struct ieee80211_key_conf *key,
struct ieee80211_key_seq *seq) struct ieee80211_key_seq *seq)
{ {
...@@ -158,7 +158,7 @@ static int wfx_add_key(struct wfx_vif *wvif, struct ieee80211_sta *sta, ...@@ -158,7 +158,7 @@ static int wfx_add_key(struct wfx_vif *wvif, struct ieee80211_sta *sta,
struct ieee80211_key_conf *key) struct ieee80211_key_conf *key)
{ {
int ret; int ret;
struct hif_req_add_key k = { }; struct wfx_hif_req_add_key k = { };
struct ieee80211_key_seq seq; struct ieee80211_key_seq seq;
struct wfx_dev *wdev = wvif->wdev; struct wfx_dev *wdev = wvif->wdev;
int idx = wfx_alloc_key(wvif->wdev); int idx = wfx_alloc_key(wvif->wdev);
......
...@@ -288,8 +288,8 @@ struct wfx_dev *wfx_init_common(struct device *dev, ...@@ -288,8 +288,8 @@ struct wfx_dev *wfx_init_common(struct device *dev,
hw->queues = 4; hw->queues = 4;
hw->max_rates = 8; hw->max_rates = 8;
hw->max_rate_tries = 8; hw->max_rate_tries = 8;
hw->extra_tx_headroom = sizeof(struct hif_msg) hw->extra_tx_headroom = sizeof(struct wfx_hif_msg)
+ sizeof(struct hif_req_tx) + sizeof(struct wfx_hif_req_tx)
+ 4 /* alignment */ + 8 /* TKIP IV */; + 4 /* alignment */ + 8 /* TKIP IV */;
hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
BIT(NL80211_IFTYPE_ADHOC) | BIT(NL80211_IFTYPE_ADHOC) |
......
...@@ -127,13 +127,13 @@ void wfx_pending_drop(struct wfx_dev *wdev, struct sk_buff_head *dropped) ...@@ -127,13 +127,13 @@ void wfx_pending_drop(struct wfx_dev *wdev, struct sk_buff_head *dropped)
{ {
struct wfx_queue *queue; struct wfx_queue *queue;
struct wfx_vif *wvif; struct wfx_vif *wvif;
struct hif_msg *hif; struct wfx_hif_msg *hif;
struct sk_buff *skb; struct sk_buff *skb;
WARN(!wdev->chip_frozen, "%s should only be used to recover a frozen device", WARN(!wdev->chip_frozen, "%s should only be used to recover a frozen device",
__func__); __func__);
while ((skb = skb_dequeue(&wdev->tx_pending)) != NULL) { while ((skb = skb_dequeue(&wdev->tx_pending)) != NULL) {
hif = (struct hif_msg *)skb->data; hif = (struct wfx_hif_msg *)skb->data;
wvif = wdev_to_wvif(wdev, hif->interface); wvif = wdev_to_wvif(wdev, hif->interface);
if (wvif) { if (wvif) {
queue = &wvif->tx_queue[skb_get_queue_mapping(skb)]; queue = &wvif->tx_queue[skb_get_queue_mapping(skb)];
...@@ -148,15 +148,15 @@ void wfx_pending_drop(struct wfx_dev *wdev, struct sk_buff_head *dropped) ...@@ -148,15 +148,15 @@ void wfx_pending_drop(struct wfx_dev *wdev, struct sk_buff_head *dropped)
struct sk_buff *wfx_pending_get(struct wfx_dev *wdev, u32 packet_id) struct sk_buff *wfx_pending_get(struct wfx_dev *wdev, u32 packet_id)
{ {
struct wfx_queue *queue; struct wfx_queue *queue;
struct hif_req_tx *req; struct wfx_hif_req_tx *req;
struct wfx_vif *wvif; struct wfx_vif *wvif;
struct hif_msg *hif; struct wfx_hif_msg *hif;
struct sk_buff *skb; struct sk_buff *skb;
spin_lock_bh(&wdev->tx_pending.lock); spin_lock_bh(&wdev->tx_pending.lock);
skb_queue_walk(&wdev->tx_pending, skb) { skb_queue_walk(&wdev->tx_pending, skb) {
hif = (struct hif_msg *)skb->data; hif = (struct wfx_hif_msg *)skb->data;
req = (struct hif_req_tx *)hif->body; req = (struct wfx_hif_req_tx *)hif->body;
if (req->packet_id != packet_id) if (req->packet_id != packet_id)
continue; continue;
spin_unlock_bh(&wdev->tx_pending.lock); spin_unlock_bh(&wdev->tx_pending.lock);
...@@ -179,7 +179,7 @@ void wfx_pending_dump_old_frames(struct wfx_dev *wdev, unsigned int limit_ms) ...@@ -179,7 +179,7 @@ void wfx_pending_dump_old_frames(struct wfx_dev *wdev, unsigned int limit_ms)
{ {
ktime_t now = ktime_get(); ktime_t now = ktime_get();
struct wfx_tx_priv *tx_priv; struct wfx_tx_priv *tx_priv;
struct hif_req_tx *req; struct wfx_hif_req_tx *req;
struct sk_buff *skb; struct sk_buff *skb;
bool first = true; bool first = true;
...@@ -236,7 +236,7 @@ static struct sk_buff *wfx_tx_queues_get_skb(struct wfx_dev *wdev) ...@@ -236,7 +236,7 @@ static struct sk_buff *wfx_tx_queues_get_skb(struct wfx_dev *wdev)
struct wfx_queue *queues[IEEE80211_NUM_ACS * ARRAY_SIZE(wdev->vif)]; struct wfx_queue *queues[IEEE80211_NUM_ACS * ARRAY_SIZE(wdev->vif)];
int i, j, num_queues = 0; int i, j, num_queues = 0;
struct wfx_vif *wvif; struct wfx_vif *wvif;
struct hif_msg *hif; struct wfx_hif_msg *hif;
struct sk_buff *skb; struct sk_buff *skb;
/* sort the queues */ /* sort the queues */
...@@ -265,7 +265,7 @@ static struct sk_buff *wfx_tx_queues_get_skb(struct wfx_dev *wdev) ...@@ -265,7 +265,7 @@ static struct sk_buff *wfx_tx_queues_get_skb(struct wfx_dev *wdev)
* and only one vif can be AP, all queued frames has * and only one vif can be AP, all queued frames has
* same interface id * same interface id
*/ */
hif = (struct hif_msg *)skb->data; hif = (struct wfx_hif_msg *)skb->data;
WARN_ON(hif->interface != wvif->id); WARN_ON(hif->interface != wvif->id);
WARN_ON(queues[i] != WARN_ON(queues[i] !=
&wvif->tx_queue[skb_get_queue_mapping(skb)]); &wvif->tx_queue[skb_get_queue_mapping(skb)]);
...@@ -289,7 +289,7 @@ static struct sk_buff *wfx_tx_queues_get_skb(struct wfx_dev *wdev) ...@@ -289,7 +289,7 @@ static struct sk_buff *wfx_tx_queues_get_skb(struct wfx_dev *wdev)
return NULL; return NULL;
} }
struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) struct wfx_hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev)
{ {
struct wfx_tx_priv *tx_priv; struct wfx_tx_priv *tx_priv;
struct sk_buff *skb; struct sk_buff *skb;
...@@ -303,5 +303,5 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) ...@@ -303,5 +303,5 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev)
wake_up(&wdev->tx_dequeue); wake_up(&wdev->tx_dequeue);
tx_priv = wfx_skb_tx_priv(skb); tx_priv = wfx_skb_tx_priv(skb);
tx_priv->xmit_timestamp = ktime_get(); tx_priv->xmit_timestamp = ktime_get();
return (struct hif_msg *)skb->data; return (struct wfx_hif_msg *)skb->data;
} }
...@@ -30,7 +30,7 @@ void wfx_tx_queues_init(struct wfx_vif *wvif); ...@@ -30,7 +30,7 @@ void wfx_tx_queues_init(struct wfx_vif *wvif);
void wfx_tx_queues_check_empty(struct wfx_vif *wvif); void wfx_tx_queues_check_empty(struct wfx_vif *wvif);
bool wfx_tx_queues_has_cab(struct wfx_vif *wvif); bool wfx_tx_queues_has_cab(struct wfx_vif *wvif);
void wfx_tx_queues_put(struct wfx_vif *wvif, struct sk_buff *skb); void wfx_tx_queues_put(struct wfx_vif *wvif, struct sk_buff *skb);
struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev); struct wfx_hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev);
bool wfx_tx_queue_empty(struct wfx_vif *wvif, struct wfx_queue *queue); bool wfx_tx_queue_empty(struct wfx_vif *wvif, struct wfx_queue *queue);
void wfx_tx_queue_drop(struct wfx_vif *wvif, struct wfx_queue *queue, void wfx_tx_queue_drop(struct wfx_vif *wvif, struct wfx_queue *queue,
......
...@@ -63,7 +63,7 @@ void wfx_suspend_hot_dev(struct wfx_dev *wdev, enum sta_notify_cmd cmd) ...@@ -63,7 +63,7 @@ void wfx_suspend_hot_dev(struct wfx_dev *wdev, enum sta_notify_cmd cmd)
static void wfx_filter_beacon(struct wfx_vif *wvif, bool filter_beacon) static void wfx_filter_beacon(struct wfx_vif *wvif, bool filter_beacon)
{ {
static const struct hif_ie_table_entry filter_ies[] = { static const struct wfx_hif_ie_table_entry filter_ies[] = {
{ {
.ie_id = WLAN_EID_VENDOR_SPECIFIC, .ie_id = WLAN_EID_VENDOR_SPECIFIC,
.has_changed = 1, .has_changed = 1,
......
...@@ -158,7 +158,7 @@ hif_mib_list_enum ...@@ -158,7 +158,7 @@ hif_mib_list_enum
#define hif_mib_list hif_mib_list_enum { -1, NULL } #define hif_mib_list hif_mib_list_enum { -1, NULL }
DECLARE_EVENT_CLASS(hif_data, DECLARE_EVENT_CLASS(hif_data,
TP_PROTO(const struct hif_msg *hif, int tx_fill_level, bool is_recv), TP_PROTO(const struct wfx_hif_msg *hif, int tx_fill_level, bool is_recv),
TP_ARGS(hif, tx_fill_level, is_recv), TP_ARGS(hif, tx_fill_level, is_recv),
TP_STRUCT__entry( TP_STRUCT__entry(
__field(int, tx_fill_level) __field(int, tx_fill_level)
...@@ -192,7 +192,7 @@ DECLARE_EVENT_CLASS(hif_data, ...@@ -192,7 +192,7 @@ DECLARE_EVENT_CLASS(hif_data,
} }
__entry->buf_len = min_t(int, __entry->msg_len, __entry->buf_len = min_t(int, __entry->msg_len,
sizeof(__entry->buf)) sizeof(__entry->buf))
- sizeof(struct hif_msg) - header_len; - sizeof(struct wfx_hif_msg) - header_len;
memcpy(__entry->buf, hif->body + header_len, __entry->buf_len); memcpy(__entry->buf, hif->body + header_len, __entry->buf_len);
), ),
TP_printk("%d:%d:%s_%s%s%s: %s%s (%d bytes)", TP_printk("%d:%d:%s_%s%s%s: %s%s (%d bytes)",
...@@ -208,12 +208,12 @@ DECLARE_EVENT_CLASS(hif_data, ...@@ -208,12 +208,12 @@ DECLARE_EVENT_CLASS(hif_data,
) )
); );
DEFINE_EVENT(hif_data, hif_send, DEFINE_EVENT(hif_data, hif_send,
TP_PROTO(const struct hif_msg *hif, int tx_fill_level, bool is_recv), TP_PROTO(const struct wfx_hif_msg *hif, int tx_fill_level, bool is_recv),
TP_ARGS(hif, tx_fill_level, is_recv)); TP_ARGS(hif, tx_fill_level, is_recv));
#define _trace_hif_send(hif, tx_fill_level)\ #define _trace_hif_send(hif, tx_fill_level)\
trace_hif_send(hif, tx_fill_level, false) trace_hif_send(hif, tx_fill_level, false)
DEFINE_EVENT(hif_data, hif_recv, DEFINE_EVENT(hif_data, hif_recv,
TP_PROTO(const struct hif_msg *hif, int tx_fill_level, bool is_recv), TP_PROTO(const struct wfx_hif_msg *hif, int tx_fill_level, bool is_recv),
TP_ARGS(hif, tx_fill_level, is_recv)); TP_ARGS(hif, tx_fill_level, is_recv));
#define _trace_hif_recv(hif, tx_fill_level)\ #define _trace_hif_recv(hif, tx_fill_level)\
trace_hif_recv(hif, tx_fill_level, true) trace_hif_recv(hif, tx_fill_level, true)
...@@ -364,7 +364,7 @@ TRACE_EVENT(bh_stats, ...@@ -364,7 +364,7 @@ TRACE_EVENT(bh_stats,
trace_bh_stats(ind, req, cnf, busy, release) trace_bh_stats(ind, req, cnf, busy, release)
TRACE_EVENT(tx_stats, TRACE_EVENT(tx_stats,
TP_PROTO(const struct hif_cnf_tx *tx_cnf, const struct sk_buff *skb, TP_PROTO(const struct wfx_hif_cnf_tx *tx_cnf, const struct sk_buff *skb,
int delay), int delay),
TP_ARGS(tx_cnf, skb, delay), TP_ARGS(tx_cnf, skb, delay),
TP_STRUCT__entry( TP_STRUCT__entry(
......
...@@ -38,7 +38,7 @@ struct wfx_dev { ...@@ -38,7 +38,7 @@ struct wfx_dev {
u8 keyset; u8 keyset;
struct completion firmware_ready; struct completion firmware_ready;
struct hif_ind_startup hw_caps; struct wfx_hif_ind_startup hw_caps;
struct wfx_hif hif; struct wfx_hif hif;
struct delayed_work cooling_timeout_work; struct delayed_work cooling_timeout_work;
bool poll_irq; bool poll_irq;
...@@ -53,9 +53,9 @@ struct wfx_dev { ...@@ -53,9 +53,9 @@ struct wfx_dev {
atomic_t packet_id; atomic_t packet_id;
u32 key_map; u32 key_map;
struct hif_rx_stats rx_stats; struct wfx_hif_rx_stats rx_stats;
struct mutex rx_stats_lock; struct mutex rx_stats_lock;
struct hif_tx_power_loop_info tx_power_loop_info; struct wfx_hif_tx_power_loop_info tx_power_loop_info;
struct mutex tx_power_loop_info_lock; struct mutex tx_power_loop_info_lock;
int force_ps_timeout; int force_ps_timeout;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment