Commit 5cd382b2 authored by Jules Irenge's avatar Jules Irenge Committed by Greg Kroah-Hartman

staging: wfx: replace uintXX_t to uXX and intXX_t to sXX

Replace uint8_t to u8, uint16_t to u16, uint32_t to u32
int8_t to s8,int16_t to s16 and int32_t to s32
As per recommendation of checkpatch tool.
Signed-off-by: default avatarJules Irenge <jbi.octave@gmail.com>
Link: https://lore.kernel.org/r/20191111133055.214410-1-jbi.octave@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f0cb9b5d
...@@ -239,7 +239,7 @@ static int bh_work_tx(struct wfx_dev *wdev, int max_msg) ...@@ -239,7 +239,7 @@ static int bh_work_tx(struct wfx_dev *wdev, int max_msg)
*/ */
static void ack_sdio_data(struct wfx_dev *wdev) static void ack_sdio_data(struct wfx_dev *wdev)
{ {
uint32_t cfg_reg; u32 cfg_reg;
config_reg_read(wdev, &cfg_reg); config_reg_read(wdev, &cfg_reg);
if (cfg_reg & 0xFF) { if (cfg_reg & 0xFF) {
......
...@@ -107,7 +107,7 @@ static void wfx_tx_policy_build(struct wfx_vif *wvif, struct tx_policy *policy, ...@@ -107,7 +107,7 @@ static void wfx_tx_policy_build(struct wfx_vif *wvif, struct tx_policy *policy,
for (i = 0; i < IEEE80211_TX_MAX_RATES; ++i) { for (i = 0; i < IEEE80211_TX_MAX_RATES; ++i) {
int rateid; int rateid;
uint8_t count; u8 count;
if (rates[i].idx < 0) if (rates[i].idx < 0)
break; break;
...@@ -477,7 +477,7 @@ static void wfx_tx_manage_pm(struct wfx_vif *wvif, struct ieee80211_hdr *hdr, ...@@ -477,7 +477,7 @@ static void wfx_tx_manage_pm(struct wfx_vif *wvif, struct ieee80211_hdr *hdr,
ieee80211_sta_set_buffered(sta, tx_priv->tid, true); ieee80211_sta_set_buffered(sta, tx_priv->tid, true);
} }
static uint8_t wfx_tx_get_raw_link_id(struct wfx_vif *wvif, static u8 wfx_tx_get_raw_link_id(struct wfx_vif *wvif,
struct ieee80211_sta *sta, struct ieee80211_sta *sta,
struct ieee80211_hdr *hdr) struct ieee80211_hdr *hdr)
{ {
...@@ -542,11 +542,11 @@ static void wfx_tx_fixup_rates(struct ieee80211_tx_rate *rates) ...@@ -542,11 +542,11 @@ static void wfx_tx_fixup_rates(struct ieee80211_tx_rate *rates)
rates[i].flags &= ~IEEE80211_TX_RC_SHORT_GI; rates[i].flags &= ~IEEE80211_TX_RC_SHORT_GI;
} }
static uint8_t wfx_tx_get_rate_id(struct wfx_vif *wvif, static u8 wfx_tx_get_rate_id(struct wfx_vif *wvif,
struct ieee80211_tx_info *tx_info) struct ieee80211_tx_info *tx_info)
{ {
bool tx_policy_renew = false; bool tx_policy_renew = false;
uint8_t rate_id; u8 rate_id;
rate_id = wfx_tx_policy_get(wvif, rate_id = wfx_tx_policy_get(wvif,
tx_info->driver_rates, &tx_policy_renew); tx_info->driver_rates, &tx_policy_renew);
...@@ -584,7 +584,7 @@ static struct hif_ht_tx_parameters wfx_tx_get_tx_parms(struct wfx_dev *wdev, str ...@@ -584,7 +584,7 @@ static struct hif_ht_tx_parameters wfx_tx_get_tx_parms(struct wfx_dev *wdev, str
return ret; return ret;
} }
static uint8_t wfx_tx_get_tid(struct ieee80211_hdr *hdr) static u8 wfx_tx_get_tid(struct ieee80211_hdr *hdr)
{ {
// FIXME: ieee80211_get_tid(hdr) should be sufficient for all cases. // FIXME: ieee80211_get_tid(hdr) should be sufficient for all cases.
if (!ieee80211_is_data(hdr->frame_control)) if (!ieee80211_is_data(hdr->frame_control))
......
...@@ -31,17 +31,17 @@ enum wfx_link_status { ...@@ -31,17 +31,17 @@ enum wfx_link_status {
struct wfx_link_entry { struct wfx_link_entry {
unsigned long timestamp; unsigned long timestamp;
enum wfx_link_status status; enum wfx_link_status status;
uint8_t mac[ETH_ALEN]; u8 mac[ETH_ALEN];
uint8_t old_mac[ETH_ALEN]; u8 old_mac[ETH_ALEN];
uint8_t buffered[WFX_MAX_TID]; u8 buffered[WFX_MAX_TID];
struct sk_buff_head rx_queue; struct sk_buff_head rx_queue;
}; };
struct tx_policy { struct tx_policy {
struct list_head link; struct list_head link;
uint8_t rates[12]; u8 rates[12];
uint8_t usage_count; u8 usage_count;
uint8_t uploaded; u8 uploaded;
}; };
struct tx_policy_cache { struct tx_policy_cache {
...@@ -55,9 +55,9 @@ struct tx_policy_cache { ...@@ -55,9 +55,9 @@ struct tx_policy_cache {
struct wfx_tx_priv { struct wfx_tx_priv {
ktime_t xmit_timestamp; ktime_t xmit_timestamp;
struct ieee80211_key_conf *hw_key; struct ieee80211_key_conf *hw_key;
uint8_t link_id; u8 link_id;
uint8_t raw_link_id; u8 raw_link_id;
uint8_t tid; u8 tid;
} __packed; } __packed;
void wfx_tx_policy_init(struct wfx_vif *wvif); void wfx_tx_policy_init(struct wfx_vif *wvif);
......
This diff is collapsed.
...@@ -23,13 +23,13 @@ ...@@ -23,13 +23,13 @@
#define HIF_COUNTER_MAX 7 #define HIF_COUNTER_MAX 7
struct hif_msg { struct hif_msg {
uint16_t len; u16 len;
uint8_t id; u8 id;
uint8_t reserved:1; u8 reserved:1;
uint8_t interface:2; u8 interface:2;
uint8_t seqnum:3; u8 seqnum:3;
uint8_t encrypted:2; u8 encrypted:2;
uint8_t body[]; u8 body[];
} __packed; } __packed;
enum hif_general_requests_ids { enum hif_general_requests_ids {
...@@ -117,22 +117,22 @@ enum hif_fw_type { ...@@ -117,22 +117,22 @@ enum hif_fw_type {
}; };
struct hif_capabilities { struct hif_capabilities {
uint8_t link_mode:2; u8 link_mode:2;
uint8_t reserved1:6; u8 reserved1:6;
uint8_t reserved2; u8 reserved2;
uint8_t reserved3; u8 reserved3;
uint8_t reserved4; u8 reserved4;
} __packed; } __packed;
struct hif_otp_regul_sel_mode_info { struct hif_otp_regul_sel_mode_info {
uint8_t region_sel_mode:4; u8 region_sel_mode:4;
uint8_t reserved:4; u8 reserved:4;
} __packed; } __packed;
struct hif_otp_phy_info { struct hif_otp_phy_info {
uint8_t phy1_region:3; u8 phy1_region:3;
uint8_t phy0_region:3; u8 phy0_region:3;
uint8_t otp_phy_ver:2; u8 otp_phy_ver:2;
} __packed; } __packed;
#define API_OPN_SIZE 14 #define API_OPN_SIZE 14
...@@ -141,39 +141,39 @@ struct hif_otp_phy_info { ...@@ -141,39 +141,39 @@ struct hif_otp_phy_info {
#define API_FIRMWARE_LABEL_SIZE 128 #define API_FIRMWARE_LABEL_SIZE 128
struct hif_ind_startup { struct hif_ind_startup {
uint32_t status; u32 status;
uint16_t hardware_id; u16 hardware_id;
uint8_t opn[API_OPN_SIZE]; u8 opn[API_OPN_SIZE];
uint8_t uid[API_UID_SIZE]; u8 uid[API_UID_SIZE];
uint16_t num_inp_ch_bufs; u16 num_inp_ch_bufs;
uint16_t size_inp_ch_buf; u16 size_inp_ch_buf;
uint8_t num_links_ap; u8 num_links_ap;
uint8_t num_interfaces; u8 num_interfaces;
uint8_t mac_addr[2][ETH_ALEN]; u8 mac_addr[2][ETH_ALEN];
uint8_t api_version_minor; u8 api_version_minor;
uint8_t api_version_major; u8 api_version_major;
struct hif_capabilities capabilities; struct hif_capabilities capabilities;
uint8_t firmware_build; u8 firmware_build;
uint8_t firmware_minor; u8 firmware_minor;
uint8_t firmware_major; u8 firmware_major;
uint8_t firmware_type; u8 firmware_type;
uint8_t disabled_channel_list[API_DISABLED_CHANNEL_LIST_SIZE]; u8 disabled_channel_list[API_DISABLED_CHANNEL_LIST_SIZE];
struct hif_otp_regul_sel_mode_info regul_sel_mode_info; struct hif_otp_regul_sel_mode_info regul_sel_mode_info;
struct hif_otp_phy_info otp_phy_info; struct hif_otp_phy_info otp_phy_info;
uint32_t supported_rate_mask; u32 supported_rate_mask;
uint8_t firmware_label[API_FIRMWARE_LABEL_SIZE]; u8 firmware_label[API_FIRMWARE_LABEL_SIZE];
} __packed; } __packed;
struct hif_ind_wakeup { struct hif_ind_wakeup {
} __packed; } __packed;
struct hif_req_configuration { struct hif_req_configuration {
uint16_t length; u16 length;
uint8_t pds_data[]; u8 pds_data[];
} __packed; } __packed;
struct hif_cnf_configuration { struct hif_cnf_configuration {
uint32_t status; u32 status;
} __packed; } __packed;
enum hif_gpio_mode { enum hif_gpio_mode {
...@@ -187,8 +187,8 @@ enum hif_gpio_mode { ...@@ -187,8 +187,8 @@ enum hif_gpio_mode {
}; };
struct hif_req_control_gpio { struct hif_req_control_gpio {
uint8_t gpio_label; u8 gpio_label;
uint8_t gpio_mode; u8 gpio_mode;
} __packed; } __packed;
enum hif_gpio_error { enum hif_gpio_error {
...@@ -198,8 +198,8 @@ enum hif_gpio_error { ...@@ -198,8 +198,8 @@ enum hif_gpio_error {
}; };
struct hif_cnf_control_gpio { struct hif_cnf_control_gpio {
uint32_t status; u32 status;
uint32_t value; u32 value;
} __packed; } __packed;
enum hif_generic_indication_type { enum hif_generic_indication_type {
...@@ -209,28 +209,28 @@ enum hif_generic_indication_type { ...@@ -209,28 +209,28 @@ enum hif_generic_indication_type {
}; };
struct hif_rx_stats { struct hif_rx_stats {
uint32_t nb_rx_frame; u32 nb_rx_frame;
uint32_t nb_crc_frame; u32 nb_crc_frame;
uint32_t per_total; u32 per_total;
uint32_t throughput; u32 throughput;
uint32_t nb_rx_by_rate[API_RATE_NUM_ENTRIES]; u32 nb_rx_by_rate[API_RATE_NUM_ENTRIES];
uint16_t per[API_RATE_NUM_ENTRIES]; u16 per[API_RATE_NUM_ENTRIES];
int16_t snr[API_RATE_NUM_ENTRIES]; s16 snr[API_RATE_NUM_ENTRIES];
int16_t rssi[API_RATE_NUM_ENTRIES]; s16 rssi[API_RATE_NUM_ENTRIES];
int16_t cfo[API_RATE_NUM_ENTRIES]; s16 cfo[API_RATE_NUM_ENTRIES];
uint32_t date; u32 date;
uint32_t pwr_clk_freq; u32 pwr_clk_freq;
uint8_t is_ext_pwr_clk; u8 is_ext_pwr_clk;
int8_t current_temp; s8 current_temp;
} __packed; } __packed;
union hif_indication_data { union hif_indication_data {
struct hif_rx_stats rx_stats; struct hif_rx_stats rx_stats;
uint8_t raw_data[1]; u8 raw_data[1];
}; };
struct hif_ind_generic { struct hif_ind_generic {
uint32_t indication_type; u32 indication_type;
union hif_indication_data indication_data; union hif_indication_data indication_data;
} __packed; } __packed;
...@@ -238,7 +238,7 @@ struct hif_ind_generic { ...@@ -238,7 +238,7 @@ struct hif_ind_generic {
#define HIF_EXCEPTION_DATA_SIZE 124 #define HIF_EXCEPTION_DATA_SIZE 124
struct hif_ind_exception { struct hif_ind_exception {
uint8_t data[HIF_EXCEPTION_DATA_SIZE]; u8 data[HIF_EXCEPTION_DATA_SIZE];
} __packed; } __packed;
...@@ -257,8 +257,8 @@ enum hif_error { ...@@ -257,8 +257,8 @@ enum hif_error {
}; };
struct hif_ind_error { struct hif_ind_error {
uint32_t type; u32 type;
uint8_t data[]; u8 data[];
} __packed; } __packed;
enum hif_secure_link_state { enum hif_secure_link_state {
...@@ -276,20 +276,20 @@ enum hif_sl_encryption_type { ...@@ -276,20 +276,20 @@ enum hif_sl_encryption_type {
}; };
struct hif_sl_msg_hdr { struct hif_sl_msg_hdr {
uint32_t seqnum:30; u32 seqnum:30;
uint32_t encrypted:2; u32 encrypted:2;
} __packed; } __packed;
struct hif_sl_msg { struct hif_sl_msg {
struct hif_sl_msg_hdr hdr; struct hif_sl_msg_hdr hdr;
uint16_t len; u16 len;
uint8_t payload[]; u8 payload[];
} __packed; } __packed;
#define AES_CCM_TAG_SIZE 16 #define AES_CCM_TAG_SIZE 16
struct hif_sl_tag { struct hif_sl_tag {
uint8_t tag[16]; u8 tag[16];
} __packed; } __packed;
enum hif_sl_mac_key_dest { enum hif_sl_mac_key_dest {
...@@ -300,12 +300,12 @@ enum hif_sl_mac_key_dest { ...@@ -300,12 +300,12 @@ enum hif_sl_mac_key_dest {
#define API_KEY_VALUE_SIZE 32 #define API_KEY_VALUE_SIZE 32
struct hif_req_set_sl_mac_key { struct hif_req_set_sl_mac_key {
uint8_t otp_or_ram; u8 otp_or_ram;
uint8_t key_value[API_KEY_VALUE_SIZE]; u8 key_value[API_KEY_VALUE_SIZE];
} __packed; } __packed;
struct hif_cnf_set_sl_mac_key { struct hif_cnf_set_sl_mac_key {
uint32_t status; u32 status;
} __packed; } __packed;
#define API_HOST_PUB_KEY_SIZE 32 #define API_HOST_PUB_KEY_SIZE 32
...@@ -317,45 +317,45 @@ enum hif_sl_session_key_alg { ...@@ -317,45 +317,45 @@ enum hif_sl_session_key_alg {
}; };
struct hif_req_sl_exchange_pub_keys { struct hif_req_sl_exchange_pub_keys {
uint8_t algorithm:2; u8 algorithm:2;
uint8_t reserved1:6; u8 reserved1:6;
uint8_t reserved2[3]; u8 reserved2[3];
uint8_t host_pub_key[API_HOST_PUB_KEY_SIZE]; u8 host_pub_key[API_HOST_PUB_KEY_SIZE];
uint8_t host_pub_key_mac[API_HOST_PUB_KEY_MAC_SIZE]; u8 host_pub_key_mac[API_HOST_PUB_KEY_MAC_SIZE];
} __packed; } __packed;
struct hif_cnf_sl_exchange_pub_keys { struct hif_cnf_sl_exchange_pub_keys {
uint32_t status; u32 status;
} __packed; } __packed;
#define API_NCP_PUB_KEY_SIZE 32 #define API_NCP_PUB_KEY_SIZE 32
#define API_NCP_PUB_KEY_MAC_SIZE 64 #define API_NCP_PUB_KEY_MAC_SIZE 64
struct hif_ind_sl_exchange_pub_keys { struct hif_ind_sl_exchange_pub_keys {
uint32_t status; u32 status;
uint8_t ncp_pub_key[API_NCP_PUB_KEY_SIZE]; u8 ncp_pub_key[API_NCP_PUB_KEY_SIZE];
uint8_t ncp_pub_key_mac[API_NCP_PUB_KEY_MAC_SIZE]; u8 ncp_pub_key_mac[API_NCP_PUB_KEY_MAC_SIZE];
} __packed; } __packed;
#define API_ENCR_BMP_SIZE 32 #define API_ENCR_BMP_SIZE 32
struct hif_req_sl_configure { struct hif_req_sl_configure {
uint8_t encr_bmp[API_ENCR_BMP_SIZE]; u8 encr_bmp[API_ENCR_BMP_SIZE];
uint8_t disable_session_key_protection:1; u8 disable_session_key_protection:1;
uint8_t reserved1:7; u8 reserved1:7;
uint8_t reserved2[3]; u8 reserved2[3];
} __packed; } __packed;
struct hif_cnf_sl_configure { struct hif_cnf_sl_configure {
uint32_t status; u32 status;
} __packed; } __packed;
struct hif_req_prevent_rollback { struct hif_req_prevent_rollback {
uint32_t magic_word; u32 magic_word;
} __packed; } __packed;
struct hif_cnf_prevent_rollback { struct hif_cnf_prevent_rollback {
uint32_t status; u32 status;
} __packed; } __packed;
enum hif_pta_mode { enum hif_pta_mode {
...@@ -382,27 +382,27 @@ enum hif_grant_state { ...@@ -382,27 +382,27 @@ enum hif_grant_state {
}; };
struct hif_req_pta_settings { struct hif_req_pta_settings {
uint8_t pta_mode; u8 pta_mode;
uint8_t request_signal_active_level; u8 request_signal_active_level;
uint8_t priority_signal_active_level; u8 priority_signal_active_level;
uint8_t freq_signal_active_level; u8 freq_signal_active_level;
uint8_t grant_signal_active_level; u8 grant_signal_active_level;
uint8_t coex_type; u8 coex_type;
uint8_t default_grant_state; u8 default_grant_state;
uint8_t simultaneous_rx_accesses; u8 simultaneous_rx_accesses;
uint8_t priority_sampling_time; u8 priority_sampling_time;
uint8_t tx_rx_sampling_time; u8 tx_rx_sampling_time;
uint8_t freq_sampling_time; u8 freq_sampling_time;
uint8_t grant_valid_time; u8 grant_valid_time;
uint8_t fem_control_time; u8 fem_control_time;
uint8_t first_slot_time; u8 first_slot_time;
uint16_t periodic_tx_rx_sampling_time; u16 periodic_tx_rx_sampling_time;
uint16_t coex_quota; u16 coex_quota;
uint16_t wlan_quota; u16 wlan_quota;
} __packed; } __packed;
struct hif_cnf_pta_settings { struct hif_cnf_pta_settings {
uint32_t status; u32 status;
} __packed; } __packed;
enum hif_pta_priority { enum hif_pta_priority {
...@@ -414,11 +414,11 @@ enum hif_pta_priority { ...@@ -414,11 +414,11 @@ enum hif_pta_priority {
}; };
struct hif_req_pta_priority { struct hif_req_pta_priority {
uint32_t priority; u32 priority;
} __packed; } __packed;
struct hif_cnf_pta_priority { struct hif_cnf_pta_priority {
uint32_t status; u32 status;
} __packed; } __packed;
enum hif_pta_state { enum hif_pta_state {
...@@ -427,11 +427,11 @@ enum hif_pta_state { ...@@ -427,11 +427,11 @@ enum hif_pta_state {
}; };
struct hif_req_pta_state { struct hif_req_pta_state {
uint32_t pta_state; u32 pta_state;
} __packed; } __packed;
struct hif_cnf_pta_state { struct hif_cnf_pta_state {
uint32_t status; u32 status;
} __packed; } __packed;
#endif #endif
This diff is collapsed.
...@@ -452,7 +452,8 @@ int hif_sl_config(struct wfx_dev *wdev, const unsigned long *bitmap) ...@@ -452,7 +452,8 @@ int hif_sl_config(struct wfx_dev *wdev, const unsigned long *bitmap)
return ret; return ret;
} }
int hif_sl_set_mac_key(struct wfx_dev *wdev, const uint8_t *slk_key, int destination) int hif_sl_set_mac_key(struct wfx_dev *wdev, const u8 *slk_key,
int destination)
{ {
int ret; int ret;
struct hif_msg *hif; struct hif_msg *hif;
......
...@@ -18,7 +18,7 @@ struct wfx_vif; ...@@ -18,7 +18,7 @@ struct wfx_vif;
struct wfx_scan_params { struct wfx_scan_params {
struct hif_req_start_scan scan_req; struct hif_req_start_scan scan_req;
struct hif_ssid_def *ssids; struct hif_ssid_def *ssids;
uint8_t *ch; u8 *ch;
}; };
struct wfx_hif_cmd { struct wfx_hif_cmd {
...@@ -59,9 +59,10 @@ int hif_beacon_transmit(struct wfx_vif *wvif, bool enable); ...@@ -59,9 +59,10 @@ int hif_beacon_transmit(struct wfx_vif *wvif, bool enable);
int hif_map_link(struct wfx_vif *wvif, u8 *mac_addr, int flags, int sta_id); int hif_map_link(struct wfx_vif *wvif, u8 *mac_addr, int flags, int sta_id);
int hif_update_ie(struct wfx_vif *wvif, const struct hif_ie_flags *target_frame, int hif_update_ie(struct wfx_vif *wvif, const struct hif_ie_flags *target_frame,
const u8 *ies, size_t ies_len); const u8 *ies, size_t ies_len);
int hif_sl_set_mac_key(struct wfx_dev *wdev, const uint8_t *slk_key, int destination); int hif_sl_set_mac_key(struct wfx_dev *wdev, const u8 *slk_key,
int destination);
int hif_sl_config(struct wfx_dev *wdev, const unsigned long *bitmap); int hif_sl_config(struct wfx_dev *wdev, const unsigned long *bitmap);
int hif_sl_send_pub_keys(struct wfx_dev *wdev, int hif_sl_send_pub_keys(struct wfx_dev *wdev,
const uint8_t *pubkey, const uint8_t *pubkey_hmac); const u8 *pubkey, const u8 *pubkey_hmac);
#endif #endif
...@@ -145,7 +145,7 @@ static inline int hif_set_mfp(struct wfx_vif *wvif, bool capable, bool required) ...@@ -145,7 +145,7 @@ static inline int hif_set_mfp(struct wfx_vif *wvif, bool capable, bool required)
} }
if (!required) if (!required)
val.unpmf_allowed = 1; val.unpmf_allowed = 1;
cpu_to_le32s((uint32_t *) &val); cpu_to_le32s((u32 *) &val);
return hif_write_mib(wvif->wdev, wvif->id, return hif_write_mib(wvif->wdev, wvif->id,
HIF_MIB_ID_PROTECTED_MGMT_POLICY, HIF_MIB_ID_PROTECTED_MGMT_POLICY,
&val, sizeof(val)); &val, sizeof(val));
......
...@@ -31,7 +31,7 @@ static void wfx_free_key(struct wfx_dev *wdev, int idx) ...@@ -31,7 +31,7 @@ static void wfx_free_key(struct wfx_dev *wdev, int idx)
wdev->key_map &= ~BIT(idx); wdev->key_map &= ~BIT(idx);
} }
static uint8_t fill_wep_pair(struct hif_wep_pairwise_key *msg, static u8 fill_wep_pair(struct 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");
...@@ -41,7 +41,7 @@ static uint8_t fill_wep_pair(struct hif_wep_pairwise_key *msg, ...@@ -41,7 +41,7 @@ static uint8_t fill_wep_pair(struct hif_wep_pairwise_key *msg,
return HIF_KEY_TYPE_WEP_PAIRWISE; return HIF_KEY_TYPE_WEP_PAIRWISE;
} }
static uint8_t fill_wep_group(struct hif_wep_group_key *msg, static u8 fill_wep_group(struct 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");
...@@ -51,10 +51,10 @@ static uint8_t fill_wep_group(struct hif_wep_group_key *msg, ...@@ -51,10 +51,10 @@ static uint8_t fill_wep_group(struct hif_wep_group_key *msg,
return HIF_KEY_TYPE_WEP_DEFAULT; return HIF_KEY_TYPE_WEP_DEFAULT;
} }
static uint8_t fill_tkip_pair(struct hif_tkip_pairwise_key *msg, static u8 fill_tkip_pair(struct hif_tkip_pairwise_key *msg,
struct ieee80211_key_conf *key, u8 *peer_addr) struct ieee80211_key_conf *key, u8 *peer_addr)
{ {
uint8_t *keybuf = key->key; u8 *keybuf = key->key;
WARN(key->keylen != sizeof(msg->tkip_key_data) WARN(key->keylen != sizeof(msg->tkip_key_data)
+ sizeof(msg->tx_mic_key) + sizeof(msg->tx_mic_key)
...@@ -68,18 +68,20 @@ static uint8_t fill_tkip_pair(struct hif_tkip_pairwise_key *msg, ...@@ -68,18 +68,20 @@ static uint8_t fill_tkip_pair(struct hif_tkip_pairwise_key *msg,
return HIF_KEY_TYPE_TKIP_PAIRWISE; return HIF_KEY_TYPE_TKIP_PAIRWISE;
} }
static uint8_t fill_tkip_group(struct hif_tkip_group_key *msg, static u8 fill_tkip_group(struct 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)
{ {
uint8_t *keybuf = key->key; u8 *keybuf = key->key;
WARN(key->keylen != sizeof(msg->tkip_key_data) WARN(key->keylen != sizeof(msg->tkip_key_data)
+ 2 * sizeof(msg->rx_mic_key), "inconsistent data"); + 2 * sizeof(msg->rx_mic_key), "inconsistent data");
msg->key_id = key->keyidx; msg->key_id = key->keyidx;
memcpy(msg->rx_sequence_counter, &seq->tkip.iv16, sizeof(seq->tkip.iv16)); memcpy(msg->rx_sequence_counter,
memcpy(msg->rx_sequence_counter + sizeof(uint16_t), &seq->tkip.iv32, sizeof(seq->tkip.iv32)); &seq->tkip.iv16, sizeof(seq->tkip.iv16));
memcpy(msg->rx_sequence_counter + sizeof(u16),
&seq->tkip.iv32, sizeof(seq->tkip.iv32));
memcpy(msg->tkip_key_data, keybuf, sizeof(msg->tkip_key_data)); memcpy(msg->tkip_key_data, keybuf, sizeof(msg->tkip_key_data));
keybuf += sizeof(msg->tkip_key_data); keybuf += sizeof(msg->tkip_key_data);
if (iftype == NL80211_IFTYPE_AP) if (iftype == NL80211_IFTYPE_AP)
...@@ -91,7 +93,7 @@ static uint8_t fill_tkip_group(struct hif_tkip_group_key *msg, ...@@ -91,7 +93,7 @@ static uint8_t fill_tkip_group(struct hif_tkip_group_key *msg,
return HIF_KEY_TYPE_TKIP_GROUP; return HIF_KEY_TYPE_TKIP_GROUP;
} }
static uint8_t fill_ccmp_pair(struct hif_aes_pairwise_key *msg, static u8 fill_ccmp_pair(struct 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");
...@@ -100,7 +102,7 @@ static uint8_t fill_ccmp_pair(struct hif_aes_pairwise_key *msg, ...@@ -100,7 +102,7 @@ static uint8_t fill_ccmp_pair(struct hif_aes_pairwise_key *msg,
return HIF_KEY_TYPE_AES_PAIRWISE; return HIF_KEY_TYPE_AES_PAIRWISE;
} }
static uint8_t fill_ccmp_group(struct hif_aes_group_key *msg, static u8 fill_ccmp_group(struct 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)
{ {
...@@ -112,10 +114,10 @@ static uint8_t fill_ccmp_group(struct hif_aes_group_key *msg, ...@@ -112,10 +114,10 @@ static uint8_t fill_ccmp_group(struct hif_aes_group_key *msg,
return HIF_KEY_TYPE_AES_GROUP; return HIF_KEY_TYPE_AES_GROUP;
} }
static uint8_t fill_sms4_pair(struct hif_wapi_pairwise_key *msg, static u8 fill_sms4_pair(struct hif_wapi_pairwise_key *msg,
struct ieee80211_key_conf *key, u8 *peer_addr) struct ieee80211_key_conf *key, u8 *peer_addr)
{ {
uint8_t *keybuf = key->key; u8 *keybuf = key->key;
WARN(key->keylen != sizeof(msg->wapi_key_data) WARN(key->keylen != sizeof(msg->wapi_key_data)
+ sizeof(msg->mic_key_data), "inconsistent data"); + sizeof(msg->mic_key_data), "inconsistent data");
...@@ -127,10 +129,10 @@ static uint8_t fill_sms4_pair(struct hif_wapi_pairwise_key *msg, ...@@ -127,10 +129,10 @@ static uint8_t fill_sms4_pair(struct hif_wapi_pairwise_key *msg,
return HIF_KEY_TYPE_WAPI_PAIRWISE; return HIF_KEY_TYPE_WAPI_PAIRWISE;
} }
static uint8_t fill_sms4_group(struct hif_wapi_group_key *msg, static u8 fill_sms4_group(struct hif_wapi_group_key *msg,
struct ieee80211_key_conf *key) struct ieee80211_key_conf *key)
{ {
uint8_t *keybuf = key->key; u8 *keybuf = key->key;
WARN(key->keylen != sizeof(msg->wapi_key_data) WARN(key->keylen != sizeof(msg->wapi_key_data)
+ sizeof(msg->mic_key_data), "inconsistent data"); + sizeof(msg->mic_key_data), "inconsistent data");
...@@ -141,7 +143,7 @@ static uint8_t fill_sms4_group(struct hif_wapi_group_key *msg, ...@@ -141,7 +143,7 @@ static uint8_t fill_sms4_group(struct hif_wapi_group_key *msg,
return HIF_KEY_TYPE_WAPI_GROUP; return HIF_KEY_TYPE_WAPI_GROUP;
} }
static uint8_t fill_aes_cmac_group(struct hif_igtk_group_key *msg, static u8 fill_aes_cmac_group(struct 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)
{ {
......
...@@ -25,12 +25,14 @@ static inline int wfx_sl_decode(struct wfx_dev *wdev, struct hif_sl_msg *m) ...@@ -25,12 +25,14 @@ static inline int wfx_sl_decode(struct wfx_dev *wdev, struct hif_sl_msg *m)
return -EIO; return -EIO;
} }
static inline int wfx_sl_encode(struct wfx_dev *wdev, struct hif_msg *input, struct hif_sl_msg *output) static inline int wfx_sl_encode(struct wfx_dev *wdev, struct hif_msg *input,
struct hif_sl_msg *output)
{ {
return -EIO; return -EIO;
} }
static inline int wfx_sl_check_pubkey(struct wfx_dev *wdev, uint8_t *ncp_pubkey, uint8_t *ncp_pubmac) static inline int wfx_sl_check_pubkey(struct wfx_dev *wdev, u8 *ncp_pubkey,
u8 *ncp_pubmac)
{ {
return -EIO; return -EIO;
} }
......
...@@ -453,7 +453,7 @@ void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, ...@@ -453,7 +453,7 @@ void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
/* WSM callbacks */ /* WSM callbacks */
static void wfx_event_report_rssi(struct wfx_vif *wvif, uint8_t raw_rcpi_rssi) static void wfx_event_report_rssi(struct wfx_vif *wvif, u8 raw_rcpi_rssi)
{ {
/* RSSI: signed Q8.0, RCPI: unsigned Q7.1 /* RSSI: signed Q8.0, RCPI: unsigned Q7.1
* RSSI = RCPI / 2 - 110 * RSSI = RCPI / 2 - 110
...@@ -590,10 +590,10 @@ static void wfx_do_unjoin(struct wfx_vif *wvif) ...@@ -590,10 +590,10 @@ static void wfx_do_unjoin(struct wfx_vif *wvif)
static void wfx_set_mfp(struct wfx_vif *wvif, struct cfg80211_bss *bss) static void wfx_set_mfp(struct wfx_vif *wvif, struct cfg80211_bss *bss)
{ {
const int pairwise_cipher_suite_count_offset = 8 / sizeof(uint16_t); const int pairwise_cipher_suite_count_offset = 8 / sizeof(u16);
const int pairwise_cipher_suite_size = 4 / sizeof(uint16_t); const int pairwise_cipher_suite_size = 4 / sizeof(u16);
const int akm_suite_size = 4 / sizeof(uint16_t); const int akm_suite_size = 4 / sizeof(u16);
const uint16_t *ptr = NULL; const u16 *ptr = NULL;
bool mfpc = false; bool mfpc = false;
bool mfpr = false; bool mfpr = false;
...@@ -603,7 +603,8 @@ static void wfx_set_mfp(struct wfx_vif *wvif, struct cfg80211_bss *bss) ...@@ -603,7 +603,8 @@ static void wfx_set_mfp(struct wfx_vif *wvif, struct cfg80211_bss *bss)
rcu_read_lock(); rcu_read_lock();
if (bss) if (bss)
ptr = (const uint16_t *) ieee80211_bss_get_ie(bss, WLAN_EID_RSN); ptr = (const u16 *) ieee80211_bss_get_ie(bss,
WLAN_EID_RSN);
if (ptr) { if (ptr) {
ptr += pairwise_cipher_suite_count_offset; ptr += pairwise_cipher_suite_count_offset;
......
...@@ -26,7 +26,7 @@ enum wfx_state { ...@@ -26,7 +26,7 @@ enum wfx_state {
struct wfx_ht_info { struct wfx_ht_info {
struct ieee80211_sta_ht_cap ht_cap; struct ieee80211_sta_ht_cap ht_cap;
enum nl80211_channel_type channel_type; enum nl80211_channel_type channel_type;
uint16_t operation_mode; u16 operation_mode;
}; };
struct wfx_hif_event { struct wfx_hif_event {
......
...@@ -179,11 +179,11 @@ static inline int wvif_count(struct wfx_dev *wdev) ...@@ -179,11 +179,11 @@ static inline int wvif_count(struct wfx_dev *wdev)
return ret; return ret;
} }
static inline void memreverse(uint8_t *src, uint8_t length) static inline void memreverse(u8 *src, u8 length)
{ {
uint8_t *lo = src; u8 *lo = src;
uint8_t *hi = src + length - 1; u8 *hi = src + length - 1;
uint8_t swap; u8 swap;
while (lo < hi) { while (lo < hi) {
swap = *lo; swap = *lo;
...@@ -194,7 +194,7 @@ static inline void memreverse(uint8_t *src, uint8_t length) ...@@ -194,7 +194,7 @@ static inline void memreverse(uint8_t *src, uint8_t length)
static inline int memzcmp(void *src, unsigned int size) static inline int memzcmp(void *src, unsigned int size)
{ {
uint8_t *buf = src; u8 *buf = src;
if (!size) if (!size)
return 0; return 0;
......
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