* [PATCH v2 1/3] staging: wfx: replace uintXX_t to uXX and intXX_t to sXX @ 2019-11-11 13:30 Jules Irenge 2019-11-11 13:30 ` [PATCH v2 2/3] staging: wfx: wrap characters Jules Irenge ` (2 more replies) 0 siblings, 3 replies; 9+ messages in thread From: Jules Irenge @ 2019-11-11 13:30 UTC (permalink / raw) To: gregkh; +Cc: jerome.pouiller, devel, linux-kernel, Jules Irenge 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: Jules Irenge <jbi.octave@gmail.com> --- Changes v1 had a spacing error v2 fixes the error and includes all the changes related to this patch in the driver. drivers/staging/wfx/bh.c | 2 +- drivers/staging/wfx/data_tx.c | 10 +- drivers/staging/wfx/data_tx.h | 18 +- drivers/staging/wfx/hif_api_cmd.h | 498 +++++++++++++------------- drivers/staging/wfx/hif_api_general.h | 212 +++++------ drivers/staging/wfx/hif_api_mib.h | 477 ++++++++++++------------ drivers/staging/wfx/hif_tx.c | 3 +- drivers/staging/wfx/hif_tx.h | 7 +- drivers/staging/wfx/hif_tx_mib.h | 2 +- drivers/staging/wfx/key.c | 32 +- drivers/staging/wfx/secure_link.h | 6 +- drivers/staging/wfx/sta.c | 13 +- drivers/staging/wfx/sta.h | 2 +- drivers/staging/wfx/wfx.h | 10 +- 14 files changed, 649 insertions(+), 643 deletions(-) diff --git a/drivers/staging/wfx/bh.c b/drivers/staging/wfx/bh.c index 955ed3a1dd73..2432ba95c2f5 100644 --- a/drivers/staging/wfx/bh.c +++ b/drivers/staging/wfx/bh.c @@ -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) { - uint32_t cfg_reg; + u32 cfg_reg; config_reg_read(wdev, &cfg_reg); if (cfg_reg & 0xFF) { diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index ea4205ac2149..b722e9773232 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -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) { int rateid; - uint8_t count; + u8 count; if (rates[i].idx < 0) break; @@ -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); } -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_hdr *hdr) { @@ -542,11 +542,11 @@ static void wfx_tx_fixup_rates(struct ieee80211_tx_rate *rates) 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) { bool tx_policy_renew = false; - uint8_t rate_id; + u8 rate_id; rate_id = wfx_tx_policy_get(wvif, 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 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. if (!ieee80211_is_data(hdr->frame_control)) diff --git a/drivers/staging/wfx/data_tx.h b/drivers/staging/wfx/data_tx.h index f74d1988925d..29faa5640516 100644 --- a/drivers/staging/wfx/data_tx.h +++ b/drivers/staging/wfx/data_tx.h @@ -31,17 +31,17 @@ enum wfx_link_status { struct wfx_link_entry { unsigned long timestamp; enum wfx_link_status status; - uint8_t mac[ETH_ALEN]; - uint8_t old_mac[ETH_ALEN]; - uint8_t buffered[WFX_MAX_TID]; + u8 mac[ETH_ALEN]; + u8 old_mac[ETH_ALEN]; + u8 buffered[WFX_MAX_TID]; struct sk_buff_head rx_queue; }; struct tx_policy { struct list_head link; - uint8_t rates[12]; - uint8_t usage_count; - uint8_t uploaded; + u8 rates[12]; + u8 usage_count; + u8 uploaded; }; struct tx_policy_cache { @@ -55,9 +55,9 @@ struct tx_policy_cache { struct wfx_tx_priv { ktime_t xmit_timestamp; struct ieee80211_key_conf *hw_key; - uint8_t link_id; - uint8_t raw_link_id; - uint8_t tid; + u8 link_id; + u8 raw_link_id; + u8 tid; } __packed; void wfx_tx_policy_init(struct wfx_vif *wvif); diff --git a/drivers/staging/wfx/hif_api_cmd.h b/drivers/staging/wfx/hif_api_cmd.h index 7c5d1ea6098d..c15831de4ff4 100644 --- a/drivers/staging/wfx/hif_api_cmd.h +++ b/drivers/staging/wfx/hif_api_cmd.h @@ -85,10 +85,10 @@ enum hif_status { }; struct hif_reset_flags { - uint8_t reset_stat:1; - uint8_t reset_all_int:1; - uint8_t reserved1:6; - uint8_t reserved2[3]; + u8 reset_stat:1; + u8 reset_all_int:1; + u8 reserved1:6; + u8 reserved2[3]; } __packed; struct hif_req_reset { @@ -96,121 +96,121 @@ struct hif_req_reset { } __packed; struct hif_cnf_reset { - uint32_t status; + u32 status; } __packed; struct hif_req_read_mib { - uint16_t mib_id; - uint16_t reserved; + u16 mib_id; + u16 reserved; } __packed; struct hif_cnf_read_mib { - uint32_t status; - uint16_t mib_id; - uint16_t length; - uint8_t mib_data[]; + u32 status; + u16 mib_id; + u16 length; + u8 mib_data[]; } __packed; struct hif_req_write_mib { - uint16_t mib_id; - uint16_t length; - uint8_t mib_data[]; + u16 mib_id; + u16 length; + u8 mib_data[]; } __packed; struct hif_cnf_write_mib { - uint32_t status; + u32 status; } __packed; struct hif_ie_flags { - uint8_t beacon:1; - uint8_t probe_resp:1; - uint8_t probe_req:1; - uint8_t reserved1:5; - uint8_t reserved2; + u8 beacon:1; + u8 probe_resp:1; + u8 probe_req:1; + u8 reserved1:5; + u8 reserved2; } __packed; struct hif_ie_tlv { - uint8_t type; - uint8_t length; - uint8_t data[]; + u8 type; + u8 length; + u8 data[]; } __packed; struct hif_req_update_ie { struct hif_ie_flags ie_flags; - uint16_t num_i_es; + u16 num_i_es; struct hif_ie_tlv ie[]; } __packed; struct hif_cnf_update_ie { - uint32_t status; + u32 status; } __packed; struct hif_scan_type { - uint8_t type:1; - uint8_t mode:1; - uint8_t reserved:6; + u8 type:1; + u8 mode:1; + u8 reserved:6; } __packed; struct hif_scan_flags { - uint8_t fbg:1; - uint8_t reserved1:1; - uint8_t pre:1; - uint8_t reserved2:5; + u8 fbg:1; + u8 reserved1:1; + u8 pre:1; + u8 reserved2:5; } __packed; struct hif_auto_scan_param { - uint16_t interval; - uint8_t reserved; - int8_t rssi_thr; + u16 interval; + u8 reserved; + s8 rssi_thr; } __packed; struct hif_ssid_def { - uint32_t ssid_length; - uint8_t ssid[HIF_API_SSID_SIZE]; + u32 ssid_length; + u8 ssid[HIF_API_SSID_SIZE]; } __packed; #define HIF_API_MAX_NB_SSIDS 2 #define HIF_API_MAX_NB_CHANNELS 14 struct hif_req_start_scan { - uint8_t band; + u8 band; struct hif_scan_type scan_type; struct hif_scan_flags scan_flags; - uint8_t max_transmit_rate; + u8 max_transmit_rate; struct hif_auto_scan_param auto_scan_param; - uint8_t num_of_probe_requests; - uint8_t probe_delay; - uint8_t num_of_ssi_ds; - uint8_t num_of_channels; - uint32_t min_channel_time; - uint32_t max_channel_time; - int32_t tx_power_level; - uint8_t ssid_and_channel_lists[]; + u8 num_of_probe_requests; + u8 probe_delay; + u8 num_of_ssi_ds; + u8 num_of_channels; + u32 min_channel_time; + u32 max_channel_time; + s32 tx_power_level; + u8 ssid_and_channel_lists[]; } __packed; struct hif_start_scan_req_cstnbssid_body { - uint8_t band; + u8 band; struct hif_scan_type scan_type; struct hif_scan_flags scan_flags; - uint8_t max_transmit_rate; + u8 max_transmit_rate; struct hif_auto_scan_param auto_scan_param; - uint8_t num_of_probe_requests; - uint8_t probe_delay; - uint8_t num_of_ssi_ds; - uint8_t num_of_channels; - uint32_t min_channel_time; - uint32_t max_channel_time; - int32_t tx_power_level; + u8 num_of_probe_requests; + u8 probe_delay; + u8 num_of_ssi_ds; + u8 num_of_channels; + u32 min_channel_time; + u32 max_channel_time; + s32 tx_power_level; struct hif_ssid_def ssid_def[HIF_API_MAX_NB_SSIDS]; - uint8_t channel_list[]; + u8 channel_list[]; } __packed; struct hif_cnf_start_scan { - uint32_t status; + u32 status; } __packed; struct hif_cnf_stop_scan { - uint32_t status; + u32 status; } __packed; enum hif_pm_mode_status { @@ -220,10 +220,10 @@ enum hif_pm_mode_status { }; struct hif_ind_scan_cmpl { - uint32_t status; - uint8_t pm_mode; - uint8_t num_channels_completed; - uint16_t reserved; + u32 status; + u8 pm_mode; + u8 num_channels_completed; + u16 reserved; } __packed; enum hif_queue_id { @@ -245,45 +245,45 @@ enum hif_stbc { }; struct hif_queue { - uint8_t queue_id:2; - uint8_t peer_sta_id:4; - uint8_t reserved:2; + u8 queue_id:2; + u8 peer_sta_id:4; + u8 reserved:2; } __packed; struct hif_data_flags { - uint8_t more:1; - uint8_t fc_offset:3; - uint8_t reserved:4; + u8 more:1; + u8 fc_offset:3; + u8 reserved:4; } __packed; struct hif_tx_flags { - uint8_t start_exp:1; - uint8_t reserved:3; - uint8_t retry_policy_index:4; + u8 start_exp:1; + u8 reserved:3; + u8 retry_policy_index:4; } __packed; struct hif_ht_tx_parameters { - uint8_t frame_format:4; - uint8_t fec_coding:1; - uint8_t short_gi:1; - uint8_t reserved1:1; - uint8_t stbc:1; - uint8_t reserved2; - uint8_t aggregation:1; - uint8_t reserved3:7; - uint8_t reserved4; + u8 frame_format:4; + u8 fec_coding:1; + u8 short_gi:1; + u8 reserved1:1; + u8 stbc:1; + u8 reserved2; + u8 aggregation:1; + u8 reserved3:7; + u8 reserved4; } __packed; struct hif_req_tx { - uint32_t packet_id; - uint8_t max_tx_rate; + u32 packet_id; + u8 max_tx_rate; struct hif_queue queue_id; struct hif_data_flags data_flags; struct hif_tx_flags tx_flags; - uint32_t reserved; - uint32_t expire_time; + u32 reserved; + u32 expire_time; struct hif_ht_tx_parameters ht_tx_parameters; - uint8_t frame[]; + u8 frame[]; } __packed; enum hif_qos_ackplcy { @@ -294,26 +294,26 @@ enum hif_qos_ackplcy { }; struct hif_tx_result_flags { - uint8_t aggr:1; - uint8_t requeue:1; - uint8_t ack_policy:2; - uint8_t txop_limit:1; - uint8_t reserved1:3; - uint8_t reserved2; + u8 aggr:1; + u8 requeue:1; + u8 ack_policy:2; + u8 txop_limit:1; + u8 reserved1:3; + u8 reserved2; } __packed; struct hif_cnf_tx { - uint32_t status; - uint32_t packet_id; - uint8_t txed_rate; - uint8_t ack_failures; + u32 status; + u32 packet_id; + u8 txed_rate; + u8 ack_failures; struct hif_tx_result_flags tx_result_flags; - uint32_t media_delay; - uint32_t tx_queue_delay; + u32 media_delay; + u32 tx_queue_delay; } __packed; struct hif_cnf_multi_transmit { - uint32_t num_tx_confs; + u32 num_tx_confs; struct hif_cnf_tx tx_conf_payload[]; } __packed; @@ -326,55 +326,55 @@ enum hif_ri_flags_encrypt { }; struct hif_rx_flags { - uint8_t encryp:3; - uint8_t in_aggr:1; - uint8_t first_aggr:1; - uint8_t last_aggr:1; - uint8_t defrag:1; - uint8_t beacon:1; - uint8_t tim:1; - uint8_t bitmap:1; - uint8_t match_ssid:1; - uint8_t match_bssid:1; - uint8_t more:1; - uint8_t reserved1:1; - uint8_t ht:1; - uint8_t stbc:1; - uint8_t match_uc_addr:1; - uint8_t match_mc_addr:1; - uint8_t match_bc_addr:1; - uint8_t key_type:1; - uint8_t key_index:4; - uint8_t reserved2:1; - uint8_t peer_sta_id:4; - uint8_t reserved3:2; - uint8_t reserved4:1; + u8 encryp:3; + u8 in_aggr:1; + u8 first_aggr:1; + u8 last_aggr:1; + u8 defrag:1; + u8 beacon:1; + u8 tim:1; + u8 bitmap:1; + u8 match_ssid:1; + u8 match_bssid:1; + u8 more:1; + u8 reserved1:1; + u8 ht:1; + u8 stbc:1; + u8 match_uc_addr:1; + u8 match_mc_addr:1; + u8 match_bc_addr:1; + u8 key_type:1; + u8 key_index:4; + u8 reserved2:1; + u8 peer_sta_id:4; + u8 reserved3:2; + u8 reserved4:1; } __packed; struct hif_ind_rx { - uint32_t status; - uint16_t channel_number; - uint8_t rxed_rate; - uint8_t rcpi_rssi; + u32 status; + u16 channel_number; + u8 rxed_rate; + u8 rcpi_rssi; struct hif_rx_flags rx_flags; - uint8_t frame[]; + u8 frame[]; } __packed; struct hif_req_edca_queue_params { - uint8_t queue_id; - uint8_t reserved1; - uint8_t aifsn; - uint8_t reserved2; - uint16_t cw_min; - uint16_t cw_max; - uint16_t tx_op_limit; - uint16_t allowed_medium_time; - uint32_t reserved3; + u8 queue_id; + u8 reserved1; + u8 aifsn; + u8 reserved2; + u16 cw_min; + u16 cw_max; + u16 tx_op_limit; + u16 allowed_medium_time; + u32 reserved3; } __packed; struct hif_cnf_edca_queue_params { - uint32_t status; + u32 status; } __packed; enum hif_ap_mode { @@ -389,92 +389,92 @@ enum hif_preamble { }; struct hif_join_flags { - uint8_t reserved1:2; - uint8_t force_no_beacon:1; - uint8_t force_with_ind:1; - uint8_t reserved2:4; + u8 reserved1:2; + u8 force_no_beacon:1; + u8 force_with_ind:1; + u8 reserved2:4; } __packed; struct hif_req_join { - uint8_t mode; - uint8_t band; - uint16_t channel_number; - uint8_t bssid[ETH_ALEN]; - uint16_t atim_window; - uint8_t preamble_type; - uint8_t probe_for_join; - uint8_t reserved; + u8 mode; + u8 band; + u16 channel_number; + u8 bssid[ETH_ALEN]; + u16 atim_window; + u8 preamble_type; + u8 probe_for_join; + u8 reserved; struct hif_join_flags join_flags; - uint32_t ssid_length; - uint8_t ssid[HIF_API_SSID_SIZE]; - uint32_t beacon_interval; - uint32_t basic_rate_set; + u32 ssid_length; + u8 ssid[HIF_API_SSID_SIZE]; + u32 beacon_interval; + u32 basic_rate_set; } __packed; struct hif_cnf_join { - uint32_t status; + u32 status; } __packed; struct hif_ind_join_complete { - uint32_t status; + u32 status; } __packed; struct hif_bss_flags { - uint8_t lost_count_only:1; - uint8_t reserved:7; + u8 lost_count_only:1; + u8 reserved:7; } __packed; struct hif_req_set_bss_params { struct hif_bss_flags bss_flags; - uint8_t beacon_lost_count; - uint16_t aid; - uint32_t operational_rate_set; + u8 beacon_lost_count; + u16 aid; + u32 operational_rate_set; } __packed; struct hif_cnf_set_bss_params { - uint32_t status; + u32 status; } __packed; struct hif_pm_mode { - uint8_t enter_psm:1; - uint8_t reserved:6; - uint8_t fast_psm:1; + u8 enter_psm:1; + u8 reserved:6; + u8 fast_psm:1; } __packed; struct hif_req_set_pm_mode { struct hif_pm_mode pm_mode; - uint8_t fast_psm_idle_period; - uint8_t ap_psm_change_period; - uint8_t min_auto_ps_poll_period; + u8 fast_psm_idle_period; + u8 ap_psm_change_period; + u8 min_auto_ps_poll_period; } __packed; struct hif_cnf_set_pm_mode { - uint32_t status; + u32 status; } __packed; struct hif_ind_set_pm_mode_cmpl { - uint32_t status; - uint8_t pm_mode; - uint8_t reserved[3]; + u32 status; + u8 pm_mode; + u8 reserved[3]; } __packed; struct hif_req_start { - uint8_t mode; - uint8_t band; - uint16_t channel_number; - uint32_t reserved1; - uint32_t beacon_interval; - uint8_t dtim_period; - uint8_t preamble_type; - uint8_t reserved2; - uint8_t ssid_length; - uint8_t ssid[HIF_API_SSID_SIZE]; - uint32_t basic_rate_set; + u8 mode; + u8 band; + u16 channel_number; + u32 reserved1; + u32 beacon_interval; + u8 dtim_period; + u8 preamble_type; + u8 reserved2; + u8 ssid_length; + u8 ssid[HIF_API_SSID_SIZE]; + u32 basic_rate_set; } __packed; struct hif_cnf_start { - uint32_t status; + u32 status; } __packed; enum hif_beacon { @@ -483,12 +483,12 @@ enum hif_beacon { }; struct hif_req_beacon_transmit { - uint8_t enable_beaconing; - uint8_t reserved[3]; + u8 enable_beaconing; + u8 reserved[3]; } __packed; struct hif_cnf_beacon_transmit { - uint32_t status; + u32 status; } __packed; enum hif_sta_map_direction { @@ -497,32 +497,32 @@ enum hif_sta_map_direction { }; struct hif_map_link_flags { - uint8_t map_direction:1; - uint8_t mfpc:1; - uint8_t reserved:6; + u8 map_direction:1; + u8 mfpc:1; + u8 reserved:6; } __packed; struct hif_req_map_link { - uint8_t mac_addr[ETH_ALEN]; + u8 mac_addr[ETH_ALEN]; struct hif_map_link_flags map_link_flags; - uint8_t peer_sta_id; + u8 peer_sta_id; } __packed; struct hif_cnf_map_link { - uint32_t status; + u32 status; } __packed; struct hif_suspend_resume_flags { - uint8_t resume:1; - uint8_t reserved1:2; - uint8_t bc_mc_only:1; - uint8_t reserved2:4; - uint8_t reserved3; + u8 resume:1; + u8 reserved1:2; + u8 bc_mc_only:1; + u8 reserved2:4; + u8 reserved3; } __packed; struct hif_ind_suspend_resume_tx { struct hif_suspend_resume_flags suspend_resume_flags; - uint16_t peer_sta_set; + u16 peer_sta_set; } __packed; @@ -552,68 +552,68 @@ enum hif_key_type { }; struct hif_wep_pairwise_key { - uint8_t peer_address[ETH_ALEN]; - uint8_t reserved; - uint8_t key_length; - uint8_t key_data[HIF_API_WEP_KEY_DATA_SIZE]; + u8 peer_address[ETH_ALEN]; + u8 reserved; + u8 key_length; + u8 key_data[HIF_API_WEP_KEY_DATA_SIZE]; } __packed; struct hif_wep_group_key { - uint8_t key_id; - uint8_t key_length; - uint8_t reserved[2]; - uint8_t key_data[HIF_API_WEP_KEY_DATA_SIZE]; + u8 key_id; + u8 key_length; + u8 reserved[2]; + u8 key_data[HIF_API_WEP_KEY_DATA_SIZE]; } __packed; struct hif_tkip_pairwise_key { - uint8_t peer_address[ETH_ALEN]; - uint8_t reserved[2]; - uint8_t tkip_key_data[HIF_API_TKIP_KEY_DATA_SIZE]; - uint8_t rx_mic_key[HIF_API_RX_MIC_KEY_SIZE]; - uint8_t tx_mic_key[HIF_API_TX_MIC_KEY_SIZE]; + u8 peer_address[ETH_ALEN]; + u8 reserved[2]; + u8 tkip_key_data[HIF_API_TKIP_KEY_DATA_SIZE]; + u8 rx_mic_key[HIF_API_RX_MIC_KEY_SIZE]; + u8 tx_mic_key[HIF_API_TX_MIC_KEY_SIZE]; } __packed; struct hif_tkip_group_key { - uint8_t tkip_key_data[HIF_API_TKIP_KEY_DATA_SIZE]; - uint8_t rx_mic_key[HIF_API_RX_MIC_KEY_SIZE]; - uint8_t key_id; - uint8_t reserved[3]; - uint8_t rx_sequence_counter[HIF_API_RX_SEQUENCE_COUNTER_SIZE]; + u8 tkip_key_data[HIF_API_TKIP_KEY_DATA_SIZE]; + u8 rx_mic_key[HIF_API_RX_MIC_KEY_SIZE]; + u8 key_id; + u8 reserved[3]; + u8 rx_sequence_counter[HIF_API_RX_SEQUENCE_COUNTER_SIZE]; } __packed; struct hif_aes_pairwise_key { - uint8_t peer_address[ETH_ALEN]; - uint8_t reserved[2]; - uint8_t aes_key_data[HIF_API_AES_KEY_DATA_SIZE]; + u8 peer_address[ETH_ALEN]; + u8 reserved[2]; + u8 aes_key_data[HIF_API_AES_KEY_DATA_SIZE]; } __packed; struct hif_aes_group_key { - uint8_t aes_key_data[HIF_API_AES_KEY_DATA_SIZE]; - uint8_t key_id; - uint8_t reserved[3]; - uint8_t rx_sequence_counter[HIF_API_RX_SEQUENCE_COUNTER_SIZE]; + u8 aes_key_data[HIF_API_AES_KEY_DATA_SIZE]; + u8 key_id; + u8 reserved[3]; + u8 rx_sequence_counter[HIF_API_RX_SEQUENCE_COUNTER_SIZE]; } __packed; struct hif_wapi_pairwise_key { - uint8_t peer_address[ETH_ALEN]; - uint8_t key_id; - uint8_t reserved; - uint8_t wapi_key_data[HIF_API_WAPI_KEY_DATA_SIZE]; - uint8_t mic_key_data[HIF_API_MIC_KEY_DATA_SIZE]; + u8 peer_address[ETH_ALEN]; + u8 key_id; + u8 reserved; + u8 wapi_key_data[HIF_API_WAPI_KEY_DATA_SIZE]; + u8 mic_key_data[HIF_API_MIC_KEY_DATA_SIZE]; } __packed; struct hif_wapi_group_key { - uint8_t wapi_key_data[HIF_API_WAPI_KEY_DATA_SIZE]; - uint8_t mic_key_data[HIF_API_MIC_KEY_DATA_SIZE]; - uint8_t key_id; - uint8_t reserved[3]; + u8 wapi_key_data[HIF_API_WAPI_KEY_DATA_SIZE]; + u8 mic_key_data[HIF_API_MIC_KEY_DATA_SIZE]; + u8 key_id; + u8 reserved[3]; } __packed; struct hif_igtk_group_key { - uint8_t igtk_key_data[HIF_API_IGTK_KEY_DATA_SIZE]; - uint8_t key_id; - uint8_t reserved[3]; - uint8_t ipn[HIF_API_IPN_SIZE]; + u8 igtk_key_data[HIF_API_IGTK_KEY_DATA_SIZE]; + u8 key_id; + u8 reserved[3]; + u8 ipn[HIF_API_IPN_SIZE]; } __packed; union hif_privacy_key_data { @@ -629,25 +629,25 @@ union hif_privacy_key_data { }; struct hif_req_add_key { - uint8_t type; - uint8_t entry_index; - uint8_t int_id:2; - uint8_t reserved1:6; - uint8_t reserved2; + u8 type; + u8 entry_index; + u8 int_id:2; + u8 reserved1:6; + u8 reserved2; union hif_privacy_key_data key; } __packed; struct hif_cnf_add_key { - uint32_t status; + u32 status; } __packed; struct hif_req_remove_key { - uint8_t entry_index; - uint8_t reserved[3]; + u8 entry_index; + u8 reserved[3]; } __packed; struct hif_cnf_remove_key { - uint32_t status; + u32 status; } __packed; enum hif_event_ind { @@ -667,13 +667,13 @@ enum hif_ps_mode_error { }; union hif_event_data { - uint8_t rcpi_rssi; - uint32_t ps_mode_error; - uint32_t peer_sta_set; + u8 rcpi_rssi; + u32 ps_mode_error; + u32 peer_sta_set; }; struct hif_ind_event { - uint32_t event_id; + u32 event_id; union hif_event_data event_data; } __packed; diff --git a/drivers/staging/wfx/hif_api_general.h b/drivers/staging/wfx/hif_api_general.h index d885b55d2882..a069c3a21b4d 100644 --- a/drivers/staging/wfx/hif_api_general.h +++ b/drivers/staging/wfx/hif_api_general.h @@ -23,13 +23,13 @@ #define HIF_COUNTER_MAX 7 struct hif_msg { - uint16_t len; - uint8_t id; - uint8_t reserved:1; - uint8_t interface:2; - uint8_t seqnum:3; - uint8_t encrypted:2; - uint8_t body[]; + u16 len; + u8 id; + u8 reserved:1; + u8 interface:2; + u8 seqnum:3; + u8 encrypted:2; + u8 body[]; } __packed; enum hif_general_requests_ids { @@ -117,22 +117,22 @@ enum hif_fw_type { }; struct hif_capabilities { - uint8_t link_mode:2; - uint8_t reserved1:6; - uint8_t reserved2; - uint8_t reserved3; - uint8_t reserved4; + u8 link_mode:2; + u8 reserved1:6; + u8 reserved2; + u8 reserved3; + u8 reserved4; } __packed; struct hif_otp_regul_sel_mode_info { - uint8_t region_sel_mode:4; - uint8_t reserved:4; + u8 region_sel_mode:4; + u8 reserved:4; } __packed; struct hif_otp_phy_info { - uint8_t phy1_region:3; - uint8_t phy0_region:3; - uint8_t otp_phy_ver:2; + u8 phy1_region:3; + u8 phy0_region:3; + u8 otp_phy_ver:2; } __packed; #define API_OPN_SIZE 14 @@ -141,39 +141,39 @@ struct hif_otp_phy_info { #define API_FIRMWARE_LABEL_SIZE 128 struct hif_ind_startup { - uint32_t status; - uint16_t hardware_id; - uint8_t opn[API_OPN_SIZE]; - uint8_t uid[API_UID_SIZE]; - uint16_t num_inp_ch_bufs; - uint16_t size_inp_ch_buf; - uint8_t num_links_ap; - uint8_t num_interfaces; - uint8_t mac_addr[2][ETH_ALEN]; - uint8_t api_version_minor; - uint8_t api_version_major; + u32 status; + u16 hardware_id; + u8 opn[API_OPN_SIZE]; + u8 uid[API_UID_SIZE]; + u16 num_inp_ch_bufs; + u16 size_inp_ch_buf; + u8 num_links_ap; + u8 num_interfaces; + u8 mac_addr[2][ETH_ALEN]; + u8 api_version_minor; + u8 api_version_major; struct hif_capabilities capabilities; - uint8_t firmware_build; - uint8_t firmware_minor; - uint8_t firmware_major; - uint8_t firmware_type; - uint8_t disabled_channel_list[API_DISABLED_CHANNEL_LIST_SIZE]; + u8 firmware_build; + u8 firmware_minor; + u8 firmware_major; + u8 firmware_type; + u8 disabled_channel_list[API_DISABLED_CHANNEL_LIST_SIZE]; struct hif_otp_regul_sel_mode_info regul_sel_mode_info; struct hif_otp_phy_info otp_phy_info; - uint32_t supported_rate_mask; - uint8_t firmware_label[API_FIRMWARE_LABEL_SIZE]; + u32 supported_rate_mask; + u8 firmware_label[API_FIRMWARE_LABEL_SIZE]; } __packed; struct hif_ind_wakeup { } __packed; struct hif_req_configuration { - uint16_t length; - uint8_t pds_data[]; + u16 length; + u8 pds_data[]; } __packed; struct hif_cnf_configuration { - uint32_t status; + u32 status; } __packed; enum hif_gpio_mode { @@ -187,8 +187,8 @@ enum hif_gpio_mode { }; struct hif_req_control_gpio { - uint8_t gpio_label; - uint8_t gpio_mode; + u8 gpio_label; + u8 gpio_mode; } __packed; enum hif_gpio_error { @@ -198,8 +198,8 @@ enum hif_gpio_error { }; struct hif_cnf_control_gpio { - uint32_t status; - uint32_t value; + u32 status; + u32 value; } __packed; enum hif_generic_indication_type { @@ -209,28 +209,28 @@ enum hif_generic_indication_type { }; struct hif_rx_stats { - uint32_t nb_rx_frame; - uint32_t nb_crc_frame; - uint32_t per_total; - uint32_t throughput; - uint32_t nb_rx_by_rate[API_RATE_NUM_ENTRIES]; - uint16_t per[API_RATE_NUM_ENTRIES]; - int16_t snr[API_RATE_NUM_ENTRIES]; - int16_t rssi[API_RATE_NUM_ENTRIES]; - int16_t cfo[API_RATE_NUM_ENTRIES]; - uint32_t date; - uint32_t pwr_clk_freq; - uint8_t is_ext_pwr_clk; - int8_t current_temp; + u32 nb_rx_frame; + u32 nb_crc_frame; + u32 per_total; + u32 throughput; + u32 nb_rx_by_rate[API_RATE_NUM_ENTRIES]; + u16 per[API_RATE_NUM_ENTRIES]; + s16 snr[API_RATE_NUM_ENTRIES]; + s16 rssi[API_RATE_NUM_ENTRIES]; + s16 cfo[API_RATE_NUM_ENTRIES]; + u32 date; + u32 pwr_clk_freq; + u8 is_ext_pwr_clk; + s8 current_temp; } __packed; union hif_indication_data { struct hif_rx_stats rx_stats; - uint8_t raw_data[1]; + u8 raw_data[1]; }; struct hif_ind_generic { - uint32_t indication_type; + u32 indication_type; union hif_indication_data indication_data; } __packed; @@ -238,7 +238,7 @@ struct hif_ind_generic { #define HIF_EXCEPTION_DATA_SIZE 124 struct hif_ind_exception { - uint8_t data[HIF_EXCEPTION_DATA_SIZE]; + u8 data[HIF_EXCEPTION_DATA_SIZE]; } __packed; @@ -257,8 +257,8 @@ enum hif_error { }; struct hif_ind_error { - uint32_t type; - uint8_t data[]; + u32 type; + u8 data[]; } __packed; enum hif_secure_link_state { @@ -276,20 +276,20 @@ enum hif_sl_encryption_type { }; struct hif_sl_msg_hdr { - uint32_t seqnum:30; - uint32_t encrypted:2; + u32 seqnum:30; + u32 encrypted:2; } __packed; struct hif_sl_msg { struct hif_sl_msg_hdr hdr; - uint16_t len; - uint8_t payload[]; + u16 len; + u8 payload[]; } __packed; #define AES_CCM_TAG_SIZE 16 struct hif_sl_tag { - uint8_t tag[16]; + u8 tag[16]; } __packed; enum hif_sl_mac_key_dest { @@ -300,12 +300,12 @@ enum hif_sl_mac_key_dest { #define API_KEY_VALUE_SIZE 32 struct hif_req_set_sl_mac_key { - uint8_t otp_or_ram; - uint8_t key_value[API_KEY_VALUE_SIZE]; + u8 otp_or_ram; + u8 key_value[API_KEY_VALUE_SIZE]; } __packed; struct hif_cnf_set_sl_mac_key { - uint32_t status; + u32 status; } __packed; #define API_HOST_PUB_KEY_SIZE 32 @@ -317,45 +317,45 @@ enum hif_sl_session_key_alg { }; struct hif_req_sl_exchange_pub_keys { - uint8_t algorithm:2; - uint8_t reserved1:6; - uint8_t reserved2[3]; - uint8_t host_pub_key[API_HOST_PUB_KEY_SIZE]; - uint8_t host_pub_key_mac[API_HOST_PUB_KEY_MAC_SIZE]; + u8 algorithm:2; + u8 reserved1:6; + u8 reserved2[3]; + u8 host_pub_key[API_HOST_PUB_KEY_SIZE]; + u8 host_pub_key_mac[API_HOST_PUB_KEY_MAC_SIZE]; } __packed; struct hif_cnf_sl_exchange_pub_keys { - uint32_t status; + u32 status; } __packed; #define API_NCP_PUB_KEY_SIZE 32 #define API_NCP_PUB_KEY_MAC_SIZE 64 struct hif_ind_sl_exchange_pub_keys { - uint32_t status; - uint8_t ncp_pub_key[API_NCP_PUB_KEY_SIZE]; - uint8_t ncp_pub_key_mac[API_NCP_PUB_KEY_MAC_SIZE]; + u32 status; + u8 ncp_pub_key[API_NCP_PUB_KEY_SIZE]; + u8 ncp_pub_key_mac[API_NCP_PUB_KEY_MAC_SIZE]; } __packed; #define API_ENCR_BMP_SIZE 32 struct hif_req_sl_configure { - uint8_t encr_bmp[API_ENCR_BMP_SIZE]; - uint8_t disable_session_key_protection:1; - uint8_t reserved1:7; - uint8_t reserved2[3]; + u8 encr_bmp[API_ENCR_BMP_SIZE]; + u8 disable_session_key_protection:1; + u8 reserved1:7; + u8 reserved2[3]; } __packed; struct hif_cnf_sl_configure { - uint32_t status; + u32 status; } __packed; struct hif_req_prevent_rollback { - uint32_t magic_word; + u32 magic_word; } __packed; struct hif_cnf_prevent_rollback { - uint32_t status; + u32 status; } __packed; enum hif_pta_mode { @@ -382,27 +382,27 @@ enum hif_grant_state { }; struct hif_req_pta_settings { - uint8_t pta_mode; - uint8_t request_signal_active_level; - uint8_t priority_signal_active_level; - uint8_t freq_signal_active_level; - uint8_t grant_signal_active_level; - uint8_t coex_type; - uint8_t default_grant_state; - uint8_t simultaneous_rx_accesses; - uint8_t priority_sampling_time; - uint8_t tx_rx_sampling_time; - uint8_t freq_sampling_time; - uint8_t grant_valid_time; - uint8_t fem_control_time; - uint8_t first_slot_time; - uint16_t periodic_tx_rx_sampling_time; - uint16_t coex_quota; - uint16_t wlan_quota; + u8 pta_mode; + u8 request_signal_active_level; + u8 priority_signal_active_level; + u8 freq_signal_active_level; + u8 grant_signal_active_level; + u8 coex_type; + u8 default_grant_state; + u8 simultaneous_rx_accesses; + u8 priority_sampling_time; + u8 tx_rx_sampling_time; + u8 freq_sampling_time; + u8 grant_valid_time; + u8 fem_control_time; + u8 first_slot_time; + u16 periodic_tx_rx_sampling_time; + u16 coex_quota; + u16 wlan_quota; } __packed; struct hif_cnf_pta_settings { - uint32_t status; + u32 status; } __packed; enum hif_pta_priority { @@ -414,11 +414,11 @@ enum hif_pta_priority { }; struct hif_req_pta_priority { - uint32_t priority; + u32 priority; } __packed; struct hif_cnf_pta_priority { - uint32_t status; + u32 status; } __packed; enum hif_pta_state { @@ -427,11 +427,11 @@ enum hif_pta_state { }; struct hif_req_pta_state { - uint32_t pta_state; + u32 pta_state; } __packed; struct hif_cnf_pta_state { - uint32_t status; + u32 status; } __packed; #endif diff --git a/drivers/staging/wfx/hif_api_mib.h b/drivers/staging/wfx/hif_api_mib.h index af657555f894..94b789ceb4ff 100644 --- a/drivers/staging/wfx/hif_api_mib.h +++ b/drivers/staging/wfx/hif_api_mib.h @@ -72,23 +72,23 @@ enum hif_op_power_mode { }; struct hif_mib_gl_operational_power_mode { - uint8_t power_mode:4; - uint8_t reserved1:3; - uint8_t wup_ind_activation:1; - uint8_t reserved2[3]; + u8 power_mode:4; + u8 reserved1:3; + u8 wup_ind_activation:1; + u8 reserved2[3]; } __packed; struct hif_mib_gl_block_ack_info { - uint8_t rx_buffer_size; - uint8_t rx_max_num_agreements; - uint8_t tx_buffer_size; - uint8_t tx_max_num_agreements; + u8 rx_buffer_size; + u8 rx_max_num_agreements; + u8 tx_buffer_size; + u8 tx_max_num_agreements; } __packed; struct hif_mib_gl_set_multi_msg { - uint8_t enable_multi_tx_conf:1; - uint8_t reserved1:7; - uint8_t reserved2[3]; + u8 enable_multi_tx_conf:1; + u8 reserved1:7; + u8 reserved2[3]; } __packed; enum hif_cca_thr_mode { @@ -97,8 +97,8 @@ enum hif_cca_thr_mode { }; struct hif_mib_gl_cca_config { - uint8_t cca_thr_mode; - uint8_t reserved[3]; + u8 cca_thr_mode; + u8 reserved[3]; } __packed; #define MAX_NUMBER_DATA_FILTERS 0xA @@ -114,9 +114,9 @@ struct hif_mib_gl_cca_config { #define MAX_NUMBER_NS_CONDITIONS 0x2 struct hif_mib_ethertype_data_frame_condition { - uint8_t condition_idx; - uint8_t reserved; - uint16_t ether_type; + u8 condition_idx; + u8 reserved; + u16 ether_type; } __packed; enum hif_udp_tcp_protocol { @@ -132,22 +132,22 @@ enum hif_which_port { }; struct hif_mib_ports_data_frame_condition { - uint8_t condition_idx; - uint8_t protocol; - uint8_t which_port; - uint8_t reserved1; - uint16_t port_number; - uint8_t reserved2[2]; + u8 condition_idx; + u8 protocol; + u8 which_port; + u8 reserved1; + u16 port_number; + u8 reserved2[2]; } __packed; #define HIF_API_MAGIC_PATTERN_SIZE 32 struct hif_mib_magic_data_frame_condition { - uint8_t condition_idx; - uint8_t offset; - uint8_t magic_pattern_length; - uint8_t reserved; - uint8_t magic_pattern[HIF_API_MAGIC_PATTERN_SIZE]; + u8 condition_idx; + u8 offset; + u8 magic_pattern_length; + u8 reserved; + u8 magic_pattern[HIF_API_MAGIC_PATTERN_SIZE]; } __packed; enum hif_mac_addr_type { @@ -157,9 +157,9 @@ enum hif_mac_addr_type { }; struct hif_mib_mac_addr_data_frame_condition { - uint8_t condition_idx; - uint8_t address_type; - uint8_t mac_address[ETH_ALEN]; + u8 condition_idx; + u8 address_type; + u8 mac_address[ETH_ALEN]; } __packed; enum hif_ip_addr_mode { @@ -168,53 +168,53 @@ enum hif_ip_addr_mode { }; struct hif_mib_ipv4_addr_data_frame_condition { - uint8_t condition_idx; - uint8_t address_mode; - uint8_t reserved[2]; - uint8_t i_pv4_address[HIF_API_IPV4_ADDRESS_SIZE]; + u8 condition_idx; + u8 address_mode; + u8 reserved[2]; + u8 i_pv4_address[HIF_API_IPV4_ADDRESS_SIZE]; } __packed; struct hif_mib_ipv6_addr_data_frame_condition { - uint8_t condition_idx; - uint8_t address_mode; - uint8_t reserved[2]; - uint8_t i_pv6_address[HIF_API_IPV6_ADDRESS_SIZE]; + u8 condition_idx; + u8 address_mode; + u8 reserved[2]; + u8 i_pv6_address[HIF_API_IPV6_ADDRESS_SIZE]; } __packed; union hif_addr_type { - uint8_t value; + u8 value; struct { - uint8_t type_unicast:1; - uint8_t type_multicast:1; - uint8_t type_broadcast:1; - uint8_t reserved:5; + u8 type_unicast:1; + u8 type_multicast:1; + u8 type_broadcast:1; + u8 reserved:5; } bits; }; struct hif_mib_uc_mc_bc_data_frame_condition { - uint8_t condition_idx; + u8 condition_idx; union hif_addr_type param; - uint8_t reserved[2]; + u8 reserved[2]; } __packed; struct hif_mib_config_data_filter { - uint8_t filter_idx; - uint8_t enable; - uint8_t reserved1[2]; - uint8_t eth_type_cond; - uint8_t port_cond; - uint8_t magic_cond; - uint8_t mac_cond; - uint8_t ipv4_cond; - uint8_t ipv6_cond; - uint8_t uc_mc_bc_cond; - uint8_t reserved2; + u8 filter_idx; + u8 enable; + u8 reserved1[2]; + u8 eth_type_cond; + u8 port_cond; + u8 magic_cond; + u8 mac_cond; + u8 ipv4_cond; + u8 ipv6_cond; + u8 uc_mc_bc_cond; + u8 reserved2; } __packed; struct hif_mib_set_data_filtering { - uint8_t default_filter; - uint8_t enable; - uint8_t reserved[2]; + u8 default_filter; + u8 enable; + u8 reserved[2]; } __packed; enum hif_arp_ns_frame_treatment { @@ -224,45 +224,45 @@ enum hif_arp_ns_frame_treatment { }; struct hif_mib_arp_ip_addr_table { - uint8_t condition_idx; - uint8_t arp_enable; - uint8_t reserved[2]; - uint8_t ipv4_address[HIF_API_IPV4_ADDRESS_SIZE]; + u8 condition_idx; + u8 arp_enable; + u8 reserved[2]; + u8 ipv4_address[HIF_API_IPV4_ADDRESS_SIZE]; } __packed; struct hif_mib_ns_ip_addr_table { - uint8_t condition_idx; - uint8_t ns_enable; - uint8_t reserved[2]; - uint8_t ipv6_address[HIF_API_IPV6_ADDRESS_SIZE]; + u8 condition_idx; + u8 ns_enable; + u8 reserved[2]; + u8 ipv6_address[HIF_API_IPV6_ADDRESS_SIZE]; } __packed; struct hif_mib_rx_filter { - uint8_t reserved1:1; - uint8_t bssid_filter:1; - uint8_t reserved2:1; - uint8_t fwd_probe_req:1; - uint8_t keep_alive_filter:1; - uint8_t reserved3:3; - uint8_t reserved4[3]; + u8 reserved1:1; + u8 bssid_filter:1; + u8 reserved2:1; + u8 fwd_probe_req:1; + u8 keep_alive_filter:1; + u8 reserved3:3; + u8 reserved4[3]; } __packed; #define HIF_API_OUI_SIZE 3 #define HIF_API_MATCH_DATA_SIZE 3 struct hif_ie_table_entry { - uint8_t ie_id; - uint8_t has_changed:1; - uint8_t no_longer:1; - uint8_t has_appeared:1; - uint8_t reserved:1; - uint8_t num_match_data:4; - uint8_t oui[HIF_API_OUI_SIZE]; - uint8_t match_data[HIF_API_MATCH_DATA_SIZE]; + u8 ie_id; + u8 has_changed:1; + u8 no_longer:1; + u8 has_appeared:1; + u8 reserved:1; + u8 num_match_data:4; + u8 oui[HIF_API_OUI_SIZE]; + u8 match_data[HIF_API_MATCH_DATA_SIZE]; } __packed; struct hif_mib_bcn_filter_table { - uint32_t num_of_info_elmts; + u32 num_of_info_elmts; struct hif_ie_table_entry ie_table[]; } __packed; @@ -273,126 +273,126 @@ enum hif_beacon_filter { }; struct hif_mib_bcn_filter_enable { - uint32_t enable; - uint32_t bcn_count; + u32 enable; + u32 bcn_count; } __packed; struct hif_mib_group_seq_counter { - uint32_t bits4716; - uint16_t bits1500; - uint16_t reserved; + u32 bits4716; + u16 bits1500; + u16 reserved; } __packed; struct hif_mib_tsf_counter { - uint32_t tsf_counterlo; - uint32_t tsf_counterhi; + u32 tsf_counterlo; + u32 tsf_counterhi; } __packed; struct hif_mib_stats_table { - int16_t latest_snr; - uint8_t latest_rcpi; - int8_t latest_rssi; + s16 latest_snr; + u8 latest_rcpi; + s8 latest_rssi; } __packed; struct hif_mib_extended_count_table { - uint32_t count_plcp_errors; - uint32_t count_fcs_errors; - uint32_t count_tx_packets; - uint32_t count_rx_packets; - uint32_t count_rx_packet_errors; - uint32_t count_rx_decryption_failures; - uint32_t count_rx_mic_failures; - uint32_t count_rx_no_key_failures; - uint32_t count_tx_multicast_frames; - uint32_t count_tx_frames_success; - uint32_t count_tx_frame_failures; - uint32_t count_tx_frames_retried; - uint32_t count_tx_frames_multi_retried; - uint32_t count_rx_frame_duplicates; - uint32_t count_rts_success; - uint32_t count_rts_failures; - uint32_t count_ack_failures; - uint32_t count_rx_multicast_frames; - uint32_t count_rx_frames_success; - uint32_t count_rx_cmacicv_errors; - uint32_t count_rx_cmac_replays; - uint32_t count_rx_mgmt_ccmp_replays; - uint32_t count_rx_bipmic_errors; - uint32_t count_rx_beacon; - uint32_t count_miss_beacon; - uint32_t reserved[15]; + u32 count_plcp_errors; + u32 count_fcs_errors; + u32 count_tx_packets; + u32 count_rx_packets; + u32 count_rx_packet_errors; + u32 count_rx_decryption_failures; + u32 count_rx_mic_failures; + u32 count_rx_no_key_failures; + u32 count_tx_multicast_frames; + u32 count_tx_frames_success; + u32 count_tx_frame_failures; + u32 count_tx_frames_retried; + u32 count_tx_frames_multi_retried; + u32 count_rx_frame_duplicates; + u32 count_rts_success; + u32 count_rts_failures; + u32 count_ack_failures; + u32 count_rx_multicast_frames; + u32 count_rx_frames_success; + u32 count_rx_cmacicv_errors; + u32 count_rx_cmac_replays; + u32 count_rx_mgmt_ccmp_replays; + u32 count_rx_bipmic_errors; + u32 count_rx_beacon; + u32 count_miss_beacon; + u32 reserved[15]; } __packed; struct hif_mib_count_table { - uint32_t count_plcp_errors; - uint32_t count_fcs_errors; - uint32_t count_tx_packets; - uint32_t count_rx_packets; - uint32_t count_rx_packet_errors; - uint32_t count_rx_decryption_failures; - uint32_t count_rx_mic_failures; - uint32_t count_rx_no_key_failures; - uint32_t count_tx_multicast_frames; - uint32_t count_tx_frames_success; - uint32_t count_tx_frame_failures; - uint32_t count_tx_frames_retried; - uint32_t count_tx_frames_multi_retried; - uint32_t count_rx_frame_duplicates; - uint32_t count_rts_success; - uint32_t count_rts_failures; - uint32_t count_ack_failures; - uint32_t count_rx_multicast_frames; - uint32_t count_rx_frames_success; - uint32_t count_rx_cmacicv_errors; - uint32_t count_rx_cmac_replays; - uint32_t count_rx_mgmt_ccmp_replays; - uint32_t count_rx_bipmic_errors; + u32 count_plcp_errors; + u32 count_fcs_errors; + u32 count_tx_packets; + u32 count_rx_packets; + u32 count_rx_packet_errors; + u32 count_rx_decryption_failures; + u32 count_rx_mic_failures; + u32 count_rx_no_key_failures; + u32 count_tx_multicast_frames; + u32 count_tx_frames_success; + u32 count_tx_frame_failures; + u32 count_tx_frames_retried; + u32 count_tx_frames_multi_retried; + u32 count_rx_frame_duplicates; + u32 count_rts_success; + u32 count_rts_failures; + u32 count_ack_failures; + u32 count_rx_multicast_frames; + u32 count_rx_frames_success; + u32 count_rx_cmacicv_errors; + u32 count_rx_cmac_replays; + u32 count_rx_mgmt_ccmp_replays; + u32 count_rx_bipmic_errors; } __packed; struct hif_mib_max_tx_power_level { - int32_t max_tx_power_level_rf_port1; - int32_t max_tx_power_level_rf_port2; + s32 max_tx_power_level_rf_port1; + s32 max_tx_power_level_rf_port2; } __packed; struct hif_mib_beacon_stats { - int32_t latest_tbtt_diff; - uint32_t reserved[4]; + s32 latest_tbtt_diff; + u32 reserved[4]; } __packed; struct hif_mib_mac_address { - uint8_t mac_addr[ETH_ALEN]; - uint16_t reserved; + u8 mac_addr[ETH_ALEN]; + u16 reserved; } __packed; struct hif_mib_dot11_max_transmit_msdu_lifetime { - uint32_t max_life_time; + u32 max_life_time; } __packed; struct hif_mib_dot11_max_receive_lifetime { - uint32_t max_life_time; + u32 max_life_time; } __packed; struct hif_mib_wep_default_key_id { - uint8_t wep_default_key_id; - uint8_t reserved[3]; + u8 wep_default_key_id; + u8 reserved[3]; } __packed; struct hif_mib_dot11_rts_threshold { - uint32_t threshold; + u32 threshold; } __packed; struct hif_mib_slot_time { - uint32_t slot_time; + u32 slot_time; } __packed; struct hif_mib_current_tx_power_level { - int32_t power_level; + s32 power_level; } __packed; struct hif_mib_non_erp_protection { - uint8_t use_cts_to_self:1; - uint8_t reserved1:7; - uint8_t reserved2[3]; + u8 use_cts_to_self:1; + u8 reserved1:7; + u8 reserved2[3]; } __packed; enum hif_tx_mode { @@ -414,45 +414,45 @@ enum hif_tmplt { #define HIF_API_MAX_TEMPLATE_FRAME_SIZE 700 struct hif_mib_template_frame { - uint8_t frame_type; - uint8_t init_rate:7; - uint8_t mode:1; - uint16_t frame_length; - uint8_t frame[HIF_API_MAX_TEMPLATE_FRAME_SIZE]; + u8 frame_type; + u8 init_rate:7; + u8 mode:1; + u16 frame_length; + u8 frame[HIF_API_MAX_TEMPLATE_FRAME_SIZE]; } __packed; struct hif_mib_beacon_wake_up_period { - uint8_t wakeup_period_min; - uint8_t receive_dtim:1; - uint8_t reserved1:7; - uint8_t wakeup_period_max; - uint8_t reserved2; + u8 wakeup_period_min; + u8 receive_dtim:1; + u8 reserved1:7; + u8 wakeup_period_max; + u8 reserved2; } __packed; struct hif_mib_rcpi_rssi_threshold { - uint8_t detection:1; - uint8_t rcpi_rssi:1; - uint8_t upperthresh:1; - uint8_t lowerthresh:1; - uint8_t reserved:4; - uint8_t lower_threshold; - uint8_t upper_threshold; - uint8_t rolling_average_count; + u8 detection:1; + u8 rcpi_rssi:1; + u8 upperthresh:1; + u8 lowerthresh:1; + u8 reserved:4; + u8 lower_threshold; + u8 upper_threshold; + u8 rolling_average_count; } __packed; #define DEFAULT_BA_MAX_RX_BUFFER_SIZE 16 struct hif_mib_block_ack_policy { - uint8_t block_ack_tx_tid_policy; - uint8_t reserved1; - uint8_t block_ack_rx_tid_policy; - uint8_t block_ack_rx_max_buffer_size; + u8 block_ack_tx_tid_policy; + u8 reserved1; + u8 block_ack_rx_tid_policy; + u8 block_ack_rx_max_buffer_size; } __packed; struct hif_mib_override_int_rate { - uint8_t internal_tx_rate; - uint8_t non_erp_internal_tx_rate; - uint8_t reserved[2]; + u8 internal_tx_rate; + u8 non_erp_internal_tx_rate; + u8 reserved[2]; } __packed; enum hif_mpdu_start_spacing { @@ -467,92 +467,91 @@ enum hif_mpdu_start_spacing { }; struct hif_mib_set_association_mode { - uint8_t preambtype_use:1; - uint8_t mode:1; - uint8_t rateset:1; - uint8_t spacing:1; - uint8_t reserved:4; - uint8_t preamble_type; - uint8_t mixed_or_greenfield_type; - uint8_t mpdu_start_spacing; - uint32_t basic_rate_set; + u8 preambtype_use:1; + u8 mode:1; + u8 rateset:1; + u8 spacing:1; + u8 reserved:4; + u8 preamble_type; + u8 mixed_or_greenfield_type; + u8 mpdu_start_spacing; + u32 basic_rate_set; } __packed; struct hif_mib_set_uapsd_information { - uint8_t trig_bckgrnd:1; - uint8_t trig_be:1; - uint8_t trig_video:1; - uint8_t trig_voice:1; - uint8_t reserved1:4; - uint8_t deliv_bckgrnd:1; - uint8_t deliv_be:1; - uint8_t deliv_video:1; - uint8_t deliv_voice:1; - uint8_t reserved2:4; - uint16_t min_auto_trigger_interval; - uint16_t max_auto_trigger_interval; - uint16_t auto_trigger_step; + u8 trig_bckgrnd:1; + u8 trig_be:1; + u8 trig_video:1; + u8 trig_voice:1; + u8 reserved1:4; + u8 deliv_bckgrnd:1; + u8 deliv_be:1; + u8 deliv_video:1; + u8 deliv_voice:1; + u8 reserved2:4; + u16 min_auto_trigger_interval; + u16 max_auto_trigger_interval; + u16 auto_trigger_step; } __packed; struct hif_mib_tx_rate_retry_policy { - uint8_t policy_index; - uint8_t short_retry_count; - uint8_t long_retry_count; - uint8_t first_rate_sel:2; - uint8_t terminate:1; - uint8_t count_init:1; - uint8_t reserved1:4; - uint8_t rate_recovery_count; - uint8_t reserved2[3]; - uint8_t rates[12]; + u8 policy_index; + u8 short_retry_count; + u8 long_retry_count; + u8 first_rate_sel:2; + u8 terminate:1; + u8 count_init:1; + u8 reserved1:4; + u8 rate_recovery_count; + u8 reserved2[3]; + u8 rates[12]; } __packed; #define HIF_MIB_NUM_TX_RATE_RETRY_POLICIES 15 struct hif_mib_set_tx_rate_retry_policy { - uint8_t num_tx_rate_policies; - uint8_t reserved[3]; + u8 num_tx_rate_policies; + u8 reserved[3]; struct hif_mib_tx_rate_retry_policy tx_rate_retry_policy[]; } __packed; struct hif_mib_protected_mgmt_policy { - uint8_t pmf_enable:1; - uint8_t unpmf_allowed:1; - uint8_t host_enc_auth_frames:1; - uint8_t reserved1:5; - uint8_t reserved2[3]; + u8 pmf_enable:1; + u8 unpmf_allowed:1; + u8 host_enc_auth_frames:1; + u8 reserved1:5; + u8 reserved2[3]; } __packed; struct hif_mib_set_ht_protection { - uint8_t dual_cts_prot:1; - uint8_t reserved1:7; - uint8_t reserved2[3]; + u8 dual_cts_prot:1; + u8 reserved1:7; + u8 reserved2[3]; } __packed; struct hif_mib_keep_alive_period { - uint16_t keep_alive_period; - uint8_t reserved[2]; + u16 keep_alive_period; + u8 reserved[2]; } __packed; struct hif_mib_arp_keep_alive_period { - uint16_t arp_keep_alive_period; - uint8_t encr_type; - uint8_t reserved; - uint8_t sender_ipv4_address[HIF_API_IPV4_ADDRESS_SIZE]; - uint8_t target_ipv4_address[HIF_API_IPV4_ADDRESS_SIZE]; + u16 arp_keep_alive_period; + u8 encr_type; + u8 reserved; + u8 sender_ipv4_address[HIF_API_IPV4_ADDRESS_SIZE]; + u8 target_ipv4_address[HIF_API_IPV4_ADDRESS_SIZE]; } __packed; struct hif_mib_inactivity_timer { - uint8_t min_active_time; - uint8_t max_active_time; - uint16_t reserved; + u8 min_active_time; + u8 max_active_time; + u16 reserved; } __packed; struct hif_mib_interface_protection { - uint8_t use_cts_prot:1; - uint8_t reserved1:7; - uint8_t reserved2[3]; + u8 use_cts_prot:1; + u8 reserved1:7; + u8 reserved2[3]; } __packed; - #endif diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c index 2d40225a0fce..2f5dadff0660 100644 --- a/drivers/staging/wfx/hif_tx.c +++ b/drivers/staging/wfx/hif_tx.c @@ -452,7 +452,8 @@ int hif_sl_config(struct wfx_dev *wdev, const unsigned long *bitmap) 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; struct hif_msg *hif; diff --git a/drivers/staging/wfx/hif_tx.h b/drivers/staging/wfx/hif_tx.h index 6f2ea2f3a77d..f61ae7b0d41c 100644 --- a/drivers/staging/wfx/hif_tx.h +++ b/drivers/staging/wfx/hif_tx.h @@ -18,7 +18,7 @@ struct wfx_vif; struct wfx_scan_params { struct hif_req_start_scan scan_req; struct hif_ssid_def *ssids; - uint8_t *ch; + u8 *ch; }; struct wfx_hif_cmd { @@ -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_update_ie(struct wfx_vif *wvif, const struct hif_ie_flags *target_frame, 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_send_pub_keys(struct wfx_dev *wdev, - const uint8_t *pubkey, const uint8_t *pubkey_hmac); + const u8 *pubkey, const u8 *pubkey_hmac); #endif diff --git a/drivers/staging/wfx/hif_tx_mib.h b/drivers/staging/wfx/hif_tx_mib.h index 3339ad95f732..d1cabd697205 100644 --- a/drivers/staging/wfx/hif_tx_mib.h +++ b/drivers/staging/wfx/hif_tx_mib.h @@ -145,7 +145,7 @@ static inline int hif_set_mfp(struct wfx_vif *wvif, bool capable, bool required) } if (!required) val.unpmf_allowed = 1; - cpu_to_le32s((uint32_t *) &val); + cpu_to_le32s((u32 *) &val); return hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_PROTECTED_MGMT_POLICY, &val, sizeof(val)); diff --git a/drivers/staging/wfx/key.c b/drivers/staging/wfx/key.c index 6d03abec20e4..caea6d959b0e 100644 --- a/drivers/staging/wfx/key.c +++ b/drivers/staging/wfx/key.c @@ -31,7 +31,7 @@ static void wfx_free_key(struct wfx_dev *wdev, int 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) { 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, 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) { 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, 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) { - uint8_t *keybuf = key->key; + u8 *keybuf = key->key; WARN(key->keylen != sizeof(msg->tkip_key_data) + sizeof(msg->tx_mic_key) @@ -68,18 +68,20 @@ static uint8_t fill_tkip_pair(struct hif_tkip_pairwise_key *msg, 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_seq *seq, enum nl80211_iftype iftype) { - uint8_t *keybuf = key->key; + u8 *keybuf = key->key; WARN(key->keylen != sizeof(msg->tkip_key_data) + 2 * sizeof(msg->rx_mic_key), "inconsistent data"); msg->key_id = key->keyidx; - memcpy(msg->rx_sequence_counter, &seq->tkip.iv16, sizeof(seq->tkip.iv16)); - memcpy(msg->rx_sequence_counter + sizeof(uint16_t), &seq->tkip.iv32, sizeof(seq->tkip.iv32)); + memcpy(msg->rx_sequence_counter, + &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)); keybuf += sizeof(msg->tkip_key_data); if (iftype == NL80211_IFTYPE_AP) @@ -91,7 +93,7 @@ static uint8_t fill_tkip_group(struct hif_tkip_group_key *msg, 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) { 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, 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_seq *seq) { @@ -112,10 +114,10 @@ static uint8_t fill_ccmp_group(struct hif_aes_group_key *msg, 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) { - uint8_t *keybuf = key->key; + u8 *keybuf = key->key; WARN(key->keylen != sizeof(msg->wapi_key_data) + sizeof(msg->mic_key_data), "inconsistent data"); @@ -127,10 +129,10 @@ static uint8_t fill_sms4_pair(struct hif_wapi_pairwise_key *msg, 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) { - uint8_t *keybuf = key->key; + u8 *keybuf = key->key; WARN(key->keylen != sizeof(msg->wapi_key_data) + sizeof(msg->mic_key_data), "inconsistent data"); @@ -141,7 +143,7 @@ static uint8_t fill_sms4_group(struct hif_wapi_group_key *msg, 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_seq *seq) { diff --git a/drivers/staging/wfx/secure_link.h b/drivers/staging/wfx/secure_link.h index 376d7bc4c0c4..666b26e5308d 100644 --- a/drivers/staging/wfx/secure_link.h +++ b/drivers/staging/wfx/secure_link.h @@ -25,12 +25,14 @@ static inline int wfx_sl_decode(struct wfx_dev *wdev, struct hif_sl_msg *m) 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; } -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; } diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 93f3739b5f3a..43137657209c 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -456,7 +456,7 @@ void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, /* 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 = RCPI / 2 - 110 @@ -593,10 +593,10 @@ static void wfx_do_unjoin(struct wfx_vif *wvif) 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_size = 4 / sizeof(uint16_t); - const int akm_suite_size = 4 / sizeof(uint16_t); - const uint16_t *ptr = NULL; + const int pairwise_cipher_suite_count_offset = 8 / sizeof(u16); + const int pairwise_cipher_suite_size = 4 / sizeof(u16); + const int akm_suite_size = 4 / sizeof(u16); + const u16 *ptr = NULL; bool mfpc = false; bool mfpr = false; @@ -606,7 +606,8 @@ static void wfx_set_mfp(struct wfx_vif *wvif, struct cfg80211_bss *bss) rcu_read_lock(); 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) { ptr += pairwise_cipher_suite_count_offset; diff --git a/drivers/staging/wfx/sta.h b/drivers/staging/wfx/sta.h index 307ed0196110..57c46bd4e650 100644 --- a/drivers/staging/wfx/sta.h +++ b/drivers/staging/wfx/sta.h @@ -26,7 +26,7 @@ enum wfx_state { struct wfx_ht_info { struct ieee80211_sta_ht_cap ht_cap; enum nl80211_channel_type channel_type; - uint16_t operation_mode; + u16 operation_mode; }; struct wfx_hif_event { diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index d678b5a08873..44e580a07c91 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -179,11 +179,11 @@ static inline int wvif_count(struct wfx_dev *wdev) return ret; } -static inline void memreverse(uint8_t *src, uint8_t length) +static inline void memreverse(u8 *src, u8 length) { - uint8_t *lo = src; - uint8_t *hi = src + length - 1; - uint8_t swap; + u8 *lo = src; + u8 *hi = src + length - 1; + u8 swap; while (lo < hi) { swap = *lo; @@ -194,7 +194,7 @@ static inline void memreverse(uint8_t *src, uint8_t length) static inline int memzcmp(void *src, unsigned int size) { - uint8_t *buf = src; + u8 *buf = src; if (!size) return 0; -- 2.23.0 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v2 2/3] staging: wfx: wrap characters 2019-11-11 13:30 [PATCH v2 1/3] staging: wfx: replace uintXX_t to uXX and intXX_t to sXX Jules Irenge @ 2019-11-11 13:30 ` Jules Irenge 2019-11-11 15:34 ` Greg KH 2019-11-11 13:30 ` [PATCH v2 3/3] staging: wfx: replace u32 by __le32 Jules Irenge 2019-11-11 17:04 ` [PATCH v2 1/3] staging: wfx: replace uintXX_t to uXX and intXX_t to sXX Jerome Pouiller 2 siblings, 1 reply; 9+ messages in thread From: Jules Irenge @ 2019-11-11 13:30 UTC (permalink / raw) To: gregkh; +Cc: jerome.pouiller, devel, linux-kernel, Jules Irenge Wrap characters to fix line of over 80 characters. Issue detected by Checkpatch tool Signed-off-by: Jules Irenge <jbi.octave@gmail.com> --- v2 includes more of this type of errors drivers/staging/wfx/bus_sdio.c | 4 +- drivers/staging/wfx/data_rx.c | 6 +- drivers/staging/wfx/data_rx.h | 3 +- drivers/staging/wfx/data_tx.c | 7 +- drivers/staging/wfx/data_tx.h | 2 +- drivers/staging/wfx/debug.c | 15 ++-- drivers/staging/wfx/fwio.c | 61 ++++++++++----- drivers/staging/wfx/hif_rx.c | 89 +++++++++++++++------- drivers/staging/wfx/hif_tx.c | 69 +++++++++++------ drivers/staging/wfx/hif_tx_mib.h | 14 ++-- drivers/staging/wfx/hwio.c | 42 +++++++---- drivers/staging/wfx/hwio.h | 9 ++- drivers/staging/wfx/key.c | 24 ++++-- drivers/staging/wfx/main.c | 55 +++++++++----- drivers/staging/wfx/queue.c | 34 ++++++--- drivers/staging/wfx/scan.c | 15 ++-- drivers/staging/wfx/sta.c | 123 +++++++++++++++++++++---------- drivers/staging/wfx/sta.h | 6 +- drivers/staging/wfx/traces.h | 27 ++++--- drivers/staging/wfx/wfx.h | 6 +- 20 files changed, 409 insertions(+), 202 deletions(-) diff --git a/drivers/staging/wfx/bus_sdio.c b/drivers/staging/wfx/bus_sdio.c index 375e07d6d9ae..f8901164c206 100644 --- a/drivers/staging/wfx/bus_sdio.c +++ b/drivers/staging/wfx/bus_sdio.c @@ -188,7 +188,9 @@ static int wfx_sdio_probe(struct sdio_func *func, bus->func = func; sdio_set_drvdata(func, bus); - func->card->quirks |= MMC_QUIRK_LENIENT_FN0 | MMC_QUIRK_BLKSZ_FOR_BYTE_MODE | MMC_QUIRK_BROKEN_BYTE_MODE_512; + func->card->quirks |= MMC_QUIRK_LENIENT_FN0 | + MMC_QUIRK_BLKSZ_FOR_BYTE_MODE | + MMC_QUIRK_BROKEN_BYTE_MODE_512; sdio_claim_host(func); ret = sdio_enable_func(func); diff --git a/drivers/staging/wfx/data_rx.c b/drivers/staging/wfx/data_rx.c index e7fcce8d0cc4..e27c8234c4af 100644 --- a/drivers/staging/wfx/data_rx.c +++ b/drivers/staging/wfx/data_rx.c @@ -48,9 +48,10 @@ static int wfx_handle_pspoll(struct wfx_vif *wvif, struct sk_buff *skb) return 0; } -static int wfx_drop_encrypt_data(struct wfx_dev *wdev, struct hif_ind_rx *arg, struct sk_buff *skb) +static int wfx_drop_encrypt_data(struct wfx_dev *wdev, struct hif_ind_rx *arg, + struct sk_buff *skb) { - struct ieee80211_hdr *frame = (struct ieee80211_hdr *) skb->data; + struct ieee80211_hdr *frame = (struct ieee80211_hdr *)skb->data; size_t hdrlen = ieee80211_hdrlen(frame->frame_control); size_t iv_len, icv_len; @@ -95,7 +96,6 @@ static int wfx_drop_encrypt_data(struct wfx_dev *wdev, struct hif_ind_rx *arg, s memmove(skb->data + iv_len, skb->data, hdrlen); skb_pull(skb, iv_len); return 0; - } void wfx_rx_cb(struct wfx_vif *wvif, struct hif_ind_rx *arg, diff --git a/drivers/staging/wfx/data_rx.h b/drivers/staging/wfx/data_rx.h index b44d15268f83..a50ce352bc5e 100644 --- a/drivers/staging/wfx/data_rx.h +++ b/drivers/staging/wfx/data_rx.h @@ -13,6 +13,7 @@ struct wfx_vif; struct sk_buff; -void wfx_rx_cb(struct wfx_vif *wvif, struct hif_ind_rx *arg, struct sk_buff *skb); +void wfx_rx_cb(struct wfx_vif *wvif, struct hif_ind_rx *arg, + struct sk_buff *skb); #endif /* WFX_DATA_RX_H */ diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index b722e9773232..1bc576e19751 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -482,7 +482,7 @@ static u8 wfx_tx_get_raw_link_id(struct wfx_vif *wvif, struct ieee80211_hdr *hdr) { struct wfx_sta_priv *sta_priv = - sta ? (struct wfx_sta_priv *) &sta->drv_priv : NULL; + sta ? (struct wfx_sta_priv *)&sta->drv_priv : NULL; const u8 *da = ieee80211_get_DA(hdr); int ret; @@ -566,7 +566,8 @@ static u8 wfx_tx_get_rate_id(struct wfx_vif *wvif, return rate_id; } -static struct hif_ht_tx_parameters wfx_tx_get_tx_parms(struct wfx_dev *wdev, struct ieee80211_tx_info *tx_info) +static struct hif_ht_tx_parameters wfx_tx_get_tx_parms(struct wfx_dev *wdev, + struct ieee80211_tx_info *tx_info) { struct ieee80211_tx_rate *rate = &tx_info->driver_rates[0]; struct hif_ht_tx_parameters ret = { }; @@ -615,7 +616,7 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta, struct ieee80211_key_conf *hw_key = tx_info->control.hw_key; struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; int queue_id = tx_info->hw_queue; - size_t offset = (size_t) skb->data & 3; + size_t offset = (size_t)skb->data & 3; int wmsg_len = sizeof(struct hif_msg) + sizeof(struct hif_req_tx) + offset; diff --git a/drivers/staging/wfx/data_tx.h b/drivers/staging/wfx/data_tx.h index 29faa5640516..4e7217e70157 100644 --- a/drivers/staging/wfx/data_tx.h +++ b/drivers/staging/wfx/data_tx.h @@ -85,7 +85,7 @@ static inline struct wfx_tx_priv *wfx_skb_tx_priv(struct sk_buff *skb) static inline struct hif_req_tx *wfx_skb_txreq(struct sk_buff *skb) { struct hif_msg *hif = (struct hif_msg *)skb->data; - struct hif_req_tx *req = (struct hif_req_tx *) hif->body; + struct hif_req_tx *req = (struct hif_req_tx *)hif->body; return req; } diff --git a/drivers/staging/wfx/debug.c b/drivers/staging/wfx/debug.c index 0a9ca109039c..d17a75242365 100644 --- a/drivers/staging/wfx/debug.c +++ b/drivers/staging/wfx/debug.c @@ -72,7 +72,8 @@ static int wfx_counters_show(struct seq_file *seq, void *v) return -EIO; #define PUT_COUNTER(name) \ - seq_printf(seq, "%24s %d\n", #name ":", le32_to_cpu(counters.count_##name)) + seq_printf(seq, "%24s %d\n", #name ":",\ + le32_to_cpu(counters.count_##name)) PUT_COUNTER(tx_packets); PUT_COUNTER(tx_multicast_frames); @@ -211,7 +212,8 @@ struct dbgfs_hif_msg { int ret; }; -static ssize_t wfx_send_hif_msg_write(struct file *file, const char __user *user_buf, +static ssize_t wfx_send_hif_msg_write(struct file *file, + const char __user *user_buf, size_t count, loff_t *ppos) { struct dbgfs_hif_msg *context = file->private_data; @@ -236,7 +238,8 @@ static ssize_t wfx_send_hif_msg_write(struct file *file, const char __user *user kfree(request); return -EINVAL; } - context->ret = wfx_cmd_send(wdev, request, context->reply, sizeof(context->reply), false); + context->ret = wfx_cmd_send(wdev, request, context->reply, + sizeof(context->reply), false); kfree(request); complete(&context->complete); @@ -299,8 +302,10 @@ int wfx_debug_init(struct wfx_dev *wdev) debugfs_create_file("counters", 0444, d, wdev, &wfx_counters_fops); debugfs_create_file("rx_stats", 0444, d, wdev, &wfx_rx_stats_fops); debugfs_create_file("send_pds", 0200, d, wdev, &wfx_send_pds_fops); - debugfs_create_file("burn_slk_key", 0200, d, wdev, &wfx_burn_slk_key_fops); - debugfs_create_file("send_hif_msg", 0600, d, wdev, &wfx_send_hif_msg_fops); + debugfs_create_file("burn_slk_key", 0200, d, wdev, + &wfx_burn_slk_key_fops); + debugfs_create_file("send_hif_msg", 0600, d, wdev, + &wfx_send_hif_msg_fops); return 0; } diff --git a/drivers/staging/wfx/fwio.c b/drivers/staging/wfx/fwio.c index 6d82c6244c7f..0a36f5a59d47 100644 --- a/drivers/staging/wfx/fwio.c +++ b/drivers/staging/wfx/fwio.c @@ -107,11 +107,14 @@ int get_firmware(struct wfx_dev *wdev, u32 keyset_chip, const char *data; int ret; - snprintf(filename, sizeof(filename), "%s_%02X.sec", wdev->pdata.file_fw, keyset_chip); + snprintf(filename, sizeof(filename), "%s_%02X.sec", + wdev->pdata.file_fw, keyset_chip); ret = firmware_request_nowarn(fw, filename, wdev->dev); if (ret) { - dev_info(wdev->dev, "can't load %s, falling back to %s.sec\n", filename, wdev->pdata.file_fw); - snprintf(filename, sizeof(filename), "%s.sec", wdev->pdata.file_fw); + dev_info(wdev->dev, "can't load %s, falling back to %s.sec\n", + filename, wdev->pdata.file_fw); + snprintf(filename, sizeof(filename), "%s.sec", + wdev->pdata.file_fw); ret = request_firmware(fw, filename, wdev->dev); if (ret) { dev_err(wdev->dev, "can't load %s\n", filename); @@ -164,7 +167,8 @@ static int wait_ncp_status(struct wfx_dev *wdev, u32 status) return -ETIMEDOUT; } if (ktime_compare(now, start)) - dev_dbg(wdev->dev, "chip answer after %lldus\n", ktime_us_delta(now, start)); + dev_dbg(wdev->dev, "chip answer after %lldus\n", + ktime_us_delta(now, start)); else dev_dbg(wdev->dev, "chip answer immediately\n"); return 0; @@ -188,15 +192,18 @@ static int upload_firmware(struct wfx_dev *wdev, const u8 *data, size_t len) if (ret < 0) return ret; now = ktime_get(); - if (offs + DNLD_BLOCK_SIZE - bytes_done < DNLD_FIFO_SIZE) + if (offs + DNLD_BLOCK_SIZE - bytes_done < + DNLD_FIFO_SIZE) break; if (ktime_after(now, ktime_add_ms(start, DCA_TIMEOUT))) return -ETIMEDOUT; } if (ktime_compare(now, start)) - dev_dbg(wdev->dev, "answer after %lldus\n", ktime_us_delta(now, start)); + dev_dbg(wdev->dev, "answer after %lldus\n", + ktime_us_delta(now, start)); - ret = sram_write_dma_safe(wdev, WFX_DNLD_FIFO + (offs % DNLD_FIFO_SIZE), + ret = sram_write_dma_safe(wdev, WFX_DNLD_FIFO + + (offs % DNLD_FIFO_SIZE), data + offs, DNLD_BLOCK_SIZE); if (ret < 0) return ret; @@ -220,10 +227,13 @@ static void print_boot_status(struct wfx_dev *wdev) dev_info(wdev->dev, "no error reported by secure boot\n"); } else { sram_reg_read(wdev, WFX_ERR_INFO, &val32); - if (val32 < ARRAY_SIZE(fwio_error_strings) && fwio_error_strings[val32]) - dev_info(wdev->dev, "secure boot error: %s\n", fwio_error_strings[val32]); + if (val32 < ARRAY_SIZE(fwio_error_strings) && + fwio_error_strings[val32]) + dev_info(wdev->dev, "secure boot error: %s\n", + fwio_error_strings[val32]); else - dev_info(wdev->dev, "secure boot error: Unknown (0x%02x)\n", val32); + dev_info(wdev->dev, + "secure boot error: Unknown(0x%02x)\n", val32); } } @@ -262,9 +272,12 @@ static int load_firmware_secure(struct wfx_dev *wdev) goto error; sram_reg_write(wdev, WFX_DNLD_FIFO, 0xFFFFFFFF); // Fifo init - sram_write_dma_safe(wdev, WFX_DCA_FW_VERSION, "\x01\x00\x00\x00", FW_VERSION_SIZE); - sram_write_dma_safe(wdev, WFX_DCA_FW_SIGNATURE, fw->data + fw_offset, FW_SIGNATURE_SIZE); - sram_write_dma_safe(wdev, WFX_DCA_FW_HASH, fw->data + fw_offset + FW_SIGNATURE_SIZE, FW_HASH_SIZE); + sram_write_dma_safe(wdev, WFX_DCA_FW_VERSION, "\x01\x00\x00\x00", + FW_VERSION_SIZE); + sram_write_dma_safe(wdev, WFX_DCA_FW_SIGNATURE, fw->data + fw_offset, + FW_SIGNATURE_SIZE); + sram_write_dma_safe(wdev, WFX_DCA_FW_HASH, fw->data + fw_offset + + FW_SIGNATURE_SIZE, FW_HASH_SIZE); sram_reg_write(wdev, WFX_DCA_IMAGE_SIZE, fw->size - header_size); sram_reg_write(wdev, WFX_DCA_HOST_STATUS, HOST_UPLOAD_PENDING); ret = wait_ncp_status(wdev, NCP_DOWNLOAD_PENDING); @@ -272,10 +285,12 @@ static int load_firmware_secure(struct wfx_dev *wdev) goto error; start = ktime_get(); - ret = upload_firmware(wdev, fw->data + header_size, fw->size - header_size); + ret = upload_firmware(wdev, fw->data + header_size, + fw->size - header_size); if (ret) goto error; - dev_dbg(wdev->dev, "firmware load after %lldus\n", ktime_us_delta(ktime_get(), start)); + dev_dbg(wdev->dev, "firmware load after %lldus\n", + ktime_us_delta(ktime_get(), start)); sram_reg_write(wdev, WFX_DCA_HOST_STATUS, HOST_UPLOAD_COMPLETE); ret = wait_ncp_status(wdev, NCP_AUTH_OK); @@ -310,10 +325,12 @@ static int init_gpr(struct wfx_dev *wdev) }; for (i = 0; i < ARRAY_SIZE(gpr_init); i++) { - ret = igpr_reg_write(wdev, gpr_init[i].index, gpr_init[i].value); + ret = igpr_reg_write(wdev, gpr_init[i].index, + gpr_init[i].value); if (ret < 0) return ret; - dev_dbg(wdev->dev, " index %02x: %08x\n", gpr_init[i].index, gpr_init[i].value); + dev_dbg(wdev->dev, " index %02x: %08x\n", gpr_init[i].index, + gpr_init[i].value); } return 0; } @@ -348,7 +365,8 @@ int wfx_init_device(struct wfx_dev *wdev) hw_revision = FIELD_GET(CFG_DEVICE_ID_MAJOR, reg); if (hw_revision == 0 || hw_revision > 2) { - dev_err(wdev->dev, "bad hardware revision number: %d\n", hw_revision); + dev_err(wdev->dev, "bad hardware revision number: %d\n", + hw_revision); return -ENODEV; } hw_type = FIELD_GET(CFG_DEVICE_ID_TYPE, reg); @@ -375,7 +393,8 @@ int wfx_init_device(struct wfx_dev *wdev) return -ETIMEDOUT; } } - dev_dbg(wdev->dev, "chip wake up after %lldus\n", ktime_us_delta(now, start)); + dev_dbg(wdev->dev, "chip wake up after %lldus\n", + ktime_us_delta(now, start)); ret = config_reg_write_bits(wdev, CFG_CPU_RESET, 0); if (ret < 0) @@ -383,6 +402,8 @@ int wfx_init_device(struct wfx_dev *wdev) ret = load_firmware_secure(wdev); if (ret < 0) return ret; - ret = config_reg_write_bits(wdev, CFG_DIRECT_ACCESS_MODE | CFG_IRQ_ENABLE_DATA | CFG_IRQ_ENABLE_WRDY, CFG_IRQ_ENABLE_DATA); + ret = config_reg_write_bits(wdev, CFG_DIRECT_ACCESS_MODE | + CFG_IRQ_ENABLE_DATA | CFG_IRQ_ENABLE_WRDY, + CFG_IRQ_ENABLE_DATA); return ret; } diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/staging/wfx/hif_rx.c index 36e171b27ae2..de830e95bda2 100644 --- a/drivers/staging/wfx/hif_rx.c +++ b/drivers/staging/wfx/hif_rx.c @@ -18,7 +18,8 @@ #include "secure_link.h" #include "hif_api_cmd.h" -static int hif_generic_confirm(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) +static int hif_generic_confirm(struct wfx_dev *wdev, struct hif_msg *hif, + void *buf) { // All confirm messages start with status int status = le32_to_cpu(*((__le32 *) buf)); @@ -33,7 +34,8 @@ static int hif_generic_confirm(struct wfx_dev *wdev, struct hif_msg *hif, void * } if (cmd != wdev->hif_cmd.buf_send->id) { - dev_warn(wdev->dev, "chip response mismatch request: 0x%.2x vs 0x%.2x\n", + dev_warn(wdev->dev, + "chip response mismatch request: 0x%.2x vs 0x%.2x\n", cmd, wdev->hif_cmd.buf_send->id); return -EINVAL; } @@ -70,10 +72,11 @@ static int hif_tx_confirm(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) return 0; } -static int hif_multi_tx_confirm(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) +static int hif_multi_tx_confirm(struct wfx_dev *wdev, struct hif_msg *hif, + void *buf) { struct hif_cnf_multi_transmit *body = buf; - struct hif_cnf_tx *buf_loc = (struct hif_cnf_tx *) &body->tx_conf_payload; + struct hif_cnf_tx *buf_loc = (struct hif_cnf_tx *)&body->tx_conf_payload; struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); int count = body->num_tx_confs; int i; @@ -90,7 +93,8 @@ static int hif_multi_tx_confirm(struct wfx_dev *wdev, struct hif_msg *hif, void return 0; } -static int hif_startup_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) +static int hif_startup_indication(struct wfx_dev *wdev, + struct hif_msg *hif, void *buf) { struct hif_ind_startup *body = buf; @@ -108,7 +112,8 @@ static int hif_startup_indication(struct wfx_dev *wdev, struct hif_msg *hif, voi return 0; } -static int hif_wakeup_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) +static int hif_wakeup_indication(struct wfx_dev *wdev, + struct hif_msg *hif, void *buf) { if (!wdev->pdata.gpio_wakeup || !gpiod_get_value(wdev->pdata.gpio_wakeup)) { @@ -118,7 +123,8 @@ static int hif_wakeup_indication(struct wfx_dev *wdev, struct hif_msg *hif, void return 0; } -static int hif_keys_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) +static int hif_keys_indication(struct wfx_dev *wdev, struct hif_msg *hif, + void *buf) { struct hif_ind_sl_exchange_pub_keys *body = buf; @@ -131,13 +137,15 @@ static int hif_keys_indication(struct wfx_dev *wdev, struct hif_msg *hif, void * return 0; } -static int hif_receive_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf, struct sk_buff *skb) +static int hif_receive_indication(struct wfx_dev *wdev, struct hif_msg *hif, + void *buf, struct sk_buff *skb) { struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); struct hif_ind_rx *body = buf; if (!wvif) { - dev_warn(wdev->dev, "ignore rx data for non-existent vif %d\n", hif->interface); + dev_warn(wdev->dev, "ignore rx data for non-existent vif %d\n", + hif->interface); return 0; } skb_pull(skb, sizeof(struct hif_msg) + sizeof(struct hif_ind_rx)); @@ -146,7 +154,8 @@ static int hif_receive_indication(struct wfx_dev *wdev, struct hif_msg *hif, voi return 0; } -static int hif_event_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) +static int hif_event_indication(struct wfx_dev *wdev, struct hif_msg *hif, + void *buf) { struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); struct hif_ind_event *body = buf; @@ -173,7 +182,8 @@ static int hif_event_indication(struct wfx_dev *wdev, struct hif_msg *hif, void return 0; } -static int hif_pm_mode_complete_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) +static int hif_pm_mode_complete_indication(struct wfx_dev *wdev, + struct hif_msg *hif, void *buf) { struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); @@ -183,7 +193,8 @@ static int hif_pm_mode_complete_indication(struct wfx_dev *wdev, struct hif_msg return 0; } -static int hif_scan_complete_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) +static int hif_scan_complete_indication(struct wfx_dev *wdev, + struct hif_msg *hif, void *buf) { struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); struct hif_ind_scan_cmpl *body = buf; @@ -194,7 +205,8 @@ static int hif_scan_complete_indication(struct wfx_dev *wdev, struct hif_msg *hi return 0; } -static int hif_join_complete_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) +static int hif_join_complete_indication(struct wfx_dev *wdev, + struct hif_msg *hif, void *buf) { struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); @@ -204,7 +216,8 @@ static int hif_join_complete_indication(struct wfx_dev *wdev, struct hif_msg *hi return 0; } -static int hif_suspend_resume_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) +static int hif_suspend_resume_indication(struct wfx_dev *wdev, + struct hif_msg *hif, void *buf) { struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); struct hif_ind_suspend_resume_tx *body = buf; @@ -215,7 +228,8 @@ static int hif_suspend_resume_indication(struct wfx_dev *wdev, struct hif_msg *h return 0; } -static int hif_error_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) +static int hif_error_indication(struct wfx_dev *wdev, + struct hif_msg *hif, void *buf) { struct hif_ind_error *body = buf; u8 *pRollback = (u8 *) body->data; @@ -223,31 +237,42 @@ static int hif_error_indication(struct wfx_dev *wdev, struct hif_msg *hif, void switch (body->type) { case HIF_ERROR_FIRMWARE_ROLLBACK: - dev_err(wdev->dev, "asynchronous error: firmware rollback error %d\n", *pRollback); + dev_err(wdev->dev, + "asynchronous error: firmware rollback error %d\n", + *pRollback); break; case HIF_ERROR_FIRMWARE_DEBUG_ENABLED: - dev_err(wdev->dev, "asynchronous error: firmware debug feature enabled\n"); + dev_err(wdev->dev, + "asynchronous error: firmware debug feature enabled\n"); break; case HIF_ERROR_OUTDATED_SESSION_KEY: - dev_err(wdev->dev, "asynchronous error: secure link outdated key: %#.8x\n", *pStatus); + dev_err(wdev->dev, + "asynchronous error: secure link outdated key:%#.8x\n", + *pStatus); break; case HIF_ERROR_INVALID_SESSION_KEY: dev_err(wdev->dev, "asynchronous error: invalid session key\n"); break; case HIF_ERROR_OOR_VOLTAGE: - dev_err(wdev->dev, "asynchronous error: out-of-range overvoltage: %#.8x\n", *pStatus); + dev_err(wdev->dev, + "asynchronous error: out-of-range overvoltage: %#.8x\n", + *pStatus); break; case HIF_ERROR_PDS_VERSION: - dev_err(wdev->dev, "asynchronous error: wrong PDS payload or version: %#.8x\n", *pStatus); + dev_err(wdev->dev, + "asynchronous error: wrong PDS payload or version: %#.8x\n", + *pStatus); break; default: - dev_err(wdev->dev, "asynchronous error: unknown (%d)\n", body->type); + dev_err(wdev->dev, "asynchronous error: unknown (%d)\n", + body->type); break; } return 0; } -static int hif_generic_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) +static int hif_generic_indication(struct wfx_dev *wdev, struct hif_msg *hif, + void *buf) { struct hif_ind_generic *body = buf; @@ -255,23 +280,30 @@ static int hif_generic_indication(struct wfx_dev *wdev, struct hif_msg *hif, voi case HIF_GENERIC_INDICATION_TYPE_RAW: return 0; case HIF_GENERIC_INDICATION_TYPE_STRING: - dev_info(wdev->dev, "firmware says: %s\n", (char *) body->indication_data.raw_data); + dev_info(wdev->dev, "firmware says: %s\n", + (char *) body->indication_data.raw_data); return 0; case HIF_GENERIC_INDICATION_TYPE_RX_STATS: mutex_lock(&wdev->rx_stats_lock); // Older firmware send a generic indication beside RxStats if (!wfx_api_older_than(wdev, 1, 4)) - dev_info(wdev->dev, "Rx test ongoing. Temperature: %d°C\n", body->indication_data.rx_stats.current_temp); - memcpy(&wdev->rx_stats, &body->indication_data.rx_stats, sizeof(wdev->rx_stats)); + dev_info(wdev->dev, + "Rx test ongoing. Temperature: %d°C\n", + body->indication_data.rx_stats.current_temp); + memcpy(&wdev->rx_stats, &body->indication_data.rx_stats, + sizeof(wdev->rx_stats)); mutex_unlock(&wdev->rx_stats_lock); return 0; default: - dev_err(wdev->dev, "generic_indication: unknown indication type: %#.8x\n", body->indication_type); + dev_err(wdev->dev, + "generic_indication: unknown indication type: %#.8x\n", + body->indication_type); return -EIO; } } -static int hif_exception_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) +static int hif_exception_indication(struct wfx_dev *wdev, struct hif_msg *hif, + void *buf) { size_t len = hif->len - 4; // drop header dev_err(wdev->dev, "firmware exception\n"); @@ -300,7 +332,8 @@ static const struct { { HIF_IND_ID_GENERIC, hif_generic_indication }, { HIF_IND_ID_ERROR, hif_error_indication }, { HIF_IND_ID_EXCEPTION, hif_exception_indication }, - // FIXME: allocate skb_p from hif_receive_indication and make it generic + // FIXME: allocate skb_p from hif_receive_indication + // and make it generic //{ HIF_IND_ID_RX, hif_receive_indication }, }; diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c index 2f5dadff0660..f4db4581e406 100644 --- a/drivers/staging/wfx/hif_tx.c +++ b/drivers/staging/wfx/hif_tx.c @@ -24,7 +24,8 @@ void wfx_init_hif_cmd(struct wfx_hif_cmd *hif_cmd) mutex_init(&hif_cmd->key_renew_lock); } -static void wfx_fill_header(struct hif_msg *hif, int if_id, unsigned int cmd, size_t size) +static void wfx_fill_header(struct hif_msg *hif, int if_id, unsigned int cmd, + size_t size) { if (if_id == -1) if_id = 2; @@ -47,7 +48,8 @@ static void *wfx_alloc_hif(size_t body_len, struct hif_msg **hif) return NULL; } -int wfx_cmd_send(struct wfx_dev *wdev, struct hif_msg *request, void *reply, size_t reply_len, bool async) +int wfx_cmd_send(struct wfx_dev *wdev, struct hif_msg *request, void *reply, + size_t reply_len, bool async) { const char *mib_name = ""; const char *mib_sep = ""; @@ -100,7 +102,8 @@ int wfx_cmd_send(struct wfx_dev *wdev, struct hif_msg *request, void *reply, siz wdev->hif_cmd.buf_send = NULL; mutex_unlock(&wdev->hif_cmd.lock); - if (ret && (cmd == HIF_REQ_ID_READ_MIB || cmd == HIF_REQ_ID_WRITE_MIB)) { + if (ret && + (cmd == HIF_REQ_ID_READ_MIB || cmd == HIF_REQ_ID_WRITE_MIB)) { mib_name = get_mib_name(((u16 *) request)[2]); mib_sep = "/"; } @@ -170,7 +173,8 @@ int hif_reset(struct wfx_vif *wvif, bool reset_stat) return ret; } -int hif_read_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id, void *val, size_t val_len) +int hif_read_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id, void *val, + size_t val_len) { int ret; struct hif_msg *hif; @@ -183,11 +187,13 @@ int hif_read_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id, void *val, size_t ret = wfx_cmd_send(wdev, hif, reply, buf_len, false); if (!ret && mib_id != reply->mib_id) { - dev_warn(wdev->dev, "%s: confirmation mismatch request\n", __func__); + dev_warn(wdev->dev, + "%s: confirmation mismatch request\n", __func__); ret = -EIO; } if (ret == -ENOMEM) - dev_err(wdev->dev, "buffer is too small to receive %s (%zu < %d)\n", + dev_err(wdev->dev, + "buffer is too small to receive %s (%zu < %d)\n", get_mib_name(mib_id), val_len, reply->length); if (!ret) memcpy(val, &reply->mib_data, reply->length); @@ -198,7 +204,8 @@ int hif_read_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id, void *val, size_t return ret; } -int hif_write_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id, void *val, size_t val_len) +int hif_write_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id, + void *val, size_t val_len) { int ret; struct hif_msg *hif; @@ -225,7 +232,8 @@ int hif_scan(struct wfx_vif *wvif, const struct wfx_scan_params *arg) struct hif_req_start_scan *body = wfx_alloc_hif(buf_len, &hif); u8 *ptr = (u8 *) body + sizeof(*body); - WARN(arg->scan_req.num_of_channels > HIF_API_MAX_NB_CHANNELS, "invalid params"); + WARN(arg->scan_req.num_of_channels > HIF_API_MAX_NB_CHANNELS, + "invalid params"); WARN(arg->scan_req.num_of_ssi_ds > 2, "invalid params"); WARN(arg->scan_req.band > 1, "invalid params"); @@ -236,7 +244,8 @@ int hif_scan(struct wfx_vif *wvif, const struct wfx_scan_params *arg) cpu_to_le32s(&body->min_channel_time); cpu_to_le32s(&body->max_channel_time); cpu_to_le32s(&body->tx_power_level); - memcpy(ptr, arg->ssids, arg->scan_req.num_of_ssi_ds * sizeof(struct hif_ssid_def)); + memcpy(ptr, arg->ssids, + arg->scan_req.num_of_ssi_ds * sizeof(struct hif_ssid_def)); ssids = (struct hif_ssid_def *) ptr; for (i = 0; i < body->num_of_ssi_ds; ++i) cpu_to_le32s(&ssids[i].ssid_length); @@ -281,16 +290,19 @@ int hif_join(struct wfx_vif *wvif, const struct hif_req_join *arg) return ret; } -int hif_set_bss_params(struct wfx_vif *wvif, const struct hif_req_set_bss_params *arg) +int hif_set_bss_params(struct wfx_vif *wvif, + const struct hif_req_set_bss_params *arg) { int ret; struct hif_msg *hif; - struct hif_req_set_bss_params *body = wfx_alloc_hif(sizeof(*body), &hif); + struct hif_req_set_bss_params *body = wfx_alloc_hif(sizeof(*body), + &hif); memcpy(body, arg, sizeof(*body)); cpu_to_le16s(&body->aid); cpu_to_le32s(&body->operational_rate_set); - wfx_fill_header(hif, wvif->id, HIF_REQ_ID_SET_BSS_PARAMS, sizeof(*body)); + wfx_fill_header(hif, wvif->id, HIF_REQ_ID_SET_BSS_PARAMS, + sizeof(*body)); ret = wfx_cmd_send(wvif->wdev, hif, NULL, 0, false); kfree(hif); return ret; @@ -308,7 +320,8 @@ int hif_add_key(struct wfx_dev *wdev, const struct hif_req_add_key *arg) if (wfx_api_older_than(wdev, 1, 5)) // Legacy firmwares expect that add_key to be sent on right // interface. - wfx_fill_header(hif, arg->int_id, HIF_REQ_ID_ADD_KEY, sizeof(*body)); + wfx_fill_header(hif, arg->int_id, HIF_REQ_ID_ADD_KEY, + sizeof(*body)); else wfx_fill_header(hif, -1, HIF_REQ_ID_ADD_KEY, sizeof(*body)); ret = wfx_cmd_send(wdev, hif, NULL, 0, false); @@ -329,18 +342,21 @@ int hif_remove_key(struct wfx_dev *wdev, int idx) return ret; } -int hif_set_edca_queue_params(struct wfx_vif *wvif, const struct hif_req_edca_queue_params *arg) +int hif_set_edca_queue_params(struct wfx_vif *wvif, + const struct hif_req_edca_queue_params *arg) { int ret; struct hif_msg *hif; - struct hif_req_edca_queue_params *body = wfx_alloc_hif(sizeof(*body), &hif); + struct hif_req_edca_queue_params *body = wfx_alloc_hif(sizeof(*body), + &hif); // NOTE: queues numerotation are not the same between WFx and Linux memcpy(body, arg, sizeof(*body)); cpu_to_le16s(&body->cw_min); cpu_to_le16s(&body->cw_max); cpu_to_le16s(&body->tx_op_limit); - wfx_fill_header(hif, wvif->id, HIF_REQ_ID_EDCA_QUEUE_PARAMS, sizeof(*body)); + wfx_fill_header(hif, wvif->id, HIF_REQ_ID_EDCA_QUEUE_PARAMS, + sizeof(*body)); ret = wfx_cmd_send(wvif->wdev, hif, NULL, 0, false); kfree(hif); return ret; @@ -379,10 +395,12 @@ int hif_beacon_transmit(struct wfx_vif *wvif, bool enable_beaconing) { int ret; struct hif_msg *hif; - struct hif_req_beacon_transmit *body = wfx_alloc_hif(sizeof(*body), &hif); + struct hif_req_beacon_transmit *body = wfx_alloc_hif(sizeof(*body), + &hif); body->enable_beaconing = enable_beaconing ? 1 : 0; - wfx_fill_header(hif, wvif->id, HIF_REQ_ID_BEACON_TRANSMIT, sizeof(*body)); + wfx_fill_header(hif, wvif->id, HIF_REQ_ID_BEACON_TRANSMIT, + sizeof(*body)); ret = wfx_cmd_send(wvif->wdev, hif, NULL, 0, false); kfree(hif); return ret; @@ -421,16 +439,20 @@ int hif_update_ie(struct wfx_vif *wvif, const struct hif_ie_flags *target_frame, return ret; } -int hif_sl_send_pub_keys(struct wfx_dev *wdev, const uint8_t *pubkey, const uint8_t *pubkey_hmac) +int hif_sl_send_pub_keys(struct wfx_dev *wdev, const u8 *pubkey, + const u8 *pubkey_hmac) { int ret; struct hif_msg *hif; - struct hif_req_sl_exchange_pub_keys *body = wfx_alloc_hif(sizeof(*body), &hif); + struct hif_req_sl_exchange_pub_keys *body = wfx_alloc_hif(sizeof(*body), + &hif); body->algorithm = HIF_SL_CURVE25519; memcpy(body->host_pub_key, pubkey, sizeof(body->host_pub_key)); - memcpy(body->host_pub_key_mac, pubkey_hmac, sizeof(body->host_pub_key_mac)); - wfx_fill_header(hif, -1, HIF_REQ_ID_SL_EXCHANGE_PUB_KEYS, sizeof(*body)); + memcpy(body->host_pub_key_mac, pubkey_hmac, + sizeof(body->host_pub_key_mac)); + wfx_fill_header(hif, -1, HIF_REQ_ID_SL_EXCHANGE_PUB_KEYS, + sizeof(*body)); ret = wfx_cmd_send(wdev, hif, NULL, 0, false); kfree(hif); // Compatibility with legacy secure link @@ -457,7 +479,8 @@ int hif_sl_set_mac_key(struct wfx_dev *wdev, const u8 *slk_key, { int ret; struct hif_msg *hif; - struct hif_req_set_sl_mac_key *body = wfx_alloc_hif(sizeof(*body), &hif); + struct hif_req_set_sl_mac_key *body = wfx_alloc_hif(sizeof(*body), + &hif); memcpy(body->key_value, slk_key, sizeof(body->key_value)); body->otp_or_ram = destination; diff --git a/drivers/staging/wfx/hif_tx_mib.h b/drivers/staging/wfx/hif_tx_mib.h index d1cabd697205..bb71bdc48dca 100644 --- a/drivers/staging/wfx/hif_tx_mib.h +++ b/drivers/staging/wfx/hif_tx_mib.h @@ -57,8 +57,9 @@ static inline int hif_get_counters_table(struct wfx_dev *wdev, return hif_read_mib(wdev, 0, HIF_MIB_ID_COUNTERS_TABLE, arg, sizeof(struct hif_mib_count_table)); } else { - return hif_read_mib(wdev, 0, HIF_MIB_ID_EXTENDED_COUNTERS_TABLE, - arg, sizeof(struct hif_mib_extended_count_table)); + return hif_read_mib(wdev, 0, + HIF_MIB_ID_EXTENDED_COUNTERS_TABLE, arg, + sizeof(struct hif_mib_extended_count_table)); } } @@ -112,7 +113,8 @@ static inline int hif_beacon_filter_control(struct wfx_vif *wvif, .bcn_count = cpu_to_le32(beacon_count), }; return hif_write_mib(wvif->wdev, wvif->id, - HIF_MIB_ID_BEACON_FILTER_ENABLE, &arg, sizeof(arg)); + HIF_MIB_ID_BEACON_FILTER_ENABLE, + &arg, sizeof(arg)); } static inline int hif_set_operational_mode(struct wfx_dev *wdev, @@ -167,13 +169,15 @@ static inline int hif_set_association_mode(struct wfx_vif *wvif, struct hif_mib_set_association_mode *arg) { return hif_write_mib(wvif->wdev, wvif->id, - HIF_MIB_ID_SET_ASSOCIATION_MODE, arg, sizeof(*arg)); + HIF_MIB_ID_SET_ASSOCIATION_MODE, + arg, sizeof(*arg)); } static inline int hif_set_tx_rate_retry_policy(struct wfx_vif *wvif, struct hif_mib_set_tx_rate_retry_policy *arg) { - size_t size = struct_size(arg, tx_rate_retry_policy, arg->num_tx_rate_policies); + size_t size = struct_size(arg, tx_rate_retry_policy, + arg->num_tx_rate_policies); return hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_SET_TX_RATE_RETRY_POLICY, arg, size); diff --git a/drivers/staging/wfx/hwio.c b/drivers/staging/wfx/hwio.c index 0cf52aee10e7..ca4111326ea5 100644 --- a/drivers/staging/wfx/hwio.c +++ b/drivers/staging/wfx/hwio.c @@ -34,12 +34,14 @@ static int read32(struct wfx_dev *wdev, int reg, u32 *val) *val = ~0; // Never return undefined value if (!tmp) return -ENOMEM; - ret = wdev->hwbus_ops->copy_from_io(wdev->hwbus_priv, reg, tmp, sizeof(u32)); + ret = wdev->hwbus_ops->copy_from_io(wdev->hwbus_priv, reg, tmp, + sizeof(u32)); if (ret >= 0) *val = le32_to_cpu(*tmp); kfree(tmp); if (ret) - dev_err(wdev->dev, "%s: bus communication error: %d\n", __func__, ret); + dev_err(wdev->dev, "%s: bus communication error: %d\n", + __func__, ret); return ret; } @@ -51,10 +53,12 @@ static int write32(struct wfx_dev *wdev, int reg, u32 val) if (!tmp) return -ENOMEM; *tmp = cpu_to_le32(val); - ret = wdev->hwbus_ops->copy_to_io(wdev->hwbus_priv, reg, tmp, sizeof(u32)); + ret = wdev->hwbus_ops->copy_to_io(wdev->hwbus_priv, reg, + tmp, sizeof(u32)); kfree(tmp); if (ret) - dev_err(wdev->dev, "%s: bus communication error: %d\n", __func__, ret); + dev_err(wdev->dev, "%s: bus communication error: %d\n", + __func__, ret); return ret; } @@ -102,7 +106,8 @@ static int write32_bits_locked(struct wfx_dev *wdev, int reg, u32 mask, u32 val) return ret; } -static int indirect_read(struct wfx_dev *wdev, int reg, u32 addr, void *buf, size_t len) +static int indirect_read(struct wfx_dev *wdev, int reg, u32 addr, + void *buf, size_t len) { int ret; int i; @@ -152,7 +157,8 @@ static int indirect_read(struct wfx_dev *wdev, int reg, u32 addr, void *buf, siz return ret; } -static int indirect_write(struct wfx_dev *wdev, int reg, u32 addr, const void *buf, size_t len) +static int indirect_write(struct wfx_dev *wdev, int reg, u32 addr, + const void *buf, size_t len) { int ret; @@ -165,7 +171,8 @@ static int indirect_write(struct wfx_dev *wdev, int reg, u32 addr, const void *b return wdev->hwbus_ops->copy_to_io(wdev->hwbus_priv, reg, buf, len); } -static int indirect_read_locked(struct wfx_dev *wdev, int reg, u32 addr, void *buf, size_t len) +static int indirect_read_locked(struct wfx_dev *wdev, int reg, + u32 addr, void *buf, size_t len) { int ret; @@ -176,7 +183,8 @@ static int indirect_read_locked(struct wfx_dev *wdev, int reg, u32 addr, void *b return ret; } -static int indirect_write_locked(struct wfx_dev *wdev, int reg, u32 addr, const void *buf, size_t len) +static int indirect_write_locked(struct wfx_dev *wdev, int reg, u32 addr, + const void *buf, size_t len) { int ret; @@ -187,7 +195,8 @@ static int indirect_write_locked(struct wfx_dev *wdev, int reg, u32 addr, const return ret; } -static int indirect_read32_locked(struct wfx_dev *wdev, int reg, u32 addr, u32 *val) +static int indirect_read32_locked(struct wfx_dev *wdev, int reg, + u32 addr, u32 *val) { int ret; __le32 *tmp = kmalloc(sizeof(u32), GFP_KERNEL); @@ -203,7 +212,8 @@ static int indirect_read32_locked(struct wfx_dev *wdev, int reg, u32 addr, u32 * return ret; } -static int indirect_write32_locked(struct wfx_dev *wdev, int reg, u32 addr, u32 val) +static int indirect_write32_locked(struct wfx_dev *wdev, int reg, + u32 addr, u32 val) { int ret; __le32 *tmp = kmalloc(sizeof(u32), GFP_KERNEL); @@ -225,11 +235,13 @@ int wfx_data_read(struct wfx_dev *wdev, void *buf, size_t len) WARN((long) buf & 3, "%s: unaligned buffer", __func__); wdev->hwbus_ops->lock(wdev->hwbus_priv); - ret = wdev->hwbus_ops->copy_from_io(wdev->hwbus_priv, WFX_REG_IN_OUT_QUEUE, buf, len); + ret = wdev->hwbus_ops->copy_from_io(wdev->hwbus_priv, + WFX_REG_IN_OUT_QUEUE, buf, len); _trace_io_read(WFX_REG_IN_OUT_QUEUE, buf, len); wdev->hwbus_ops->unlock(wdev->hwbus_priv); if (ret) - dev_err(wdev->dev, "%s: bus communication error: %d\n", __func__, ret); + dev_err(wdev->dev, "%s: bus communication error: %d\n", + __func__, ret); return ret; } @@ -239,11 +251,13 @@ int wfx_data_write(struct wfx_dev *wdev, const void *buf, size_t len) WARN((long) buf & 3, "%s: unaligned buffer", __func__); wdev->hwbus_ops->lock(wdev->hwbus_priv); - ret = wdev->hwbus_ops->copy_to_io(wdev->hwbus_priv, WFX_REG_IN_OUT_QUEUE, buf, len); + ret = wdev->hwbus_ops->copy_to_io(wdev->hwbus_priv, + WFX_REG_IN_OUT_QUEUE, buf, len); _trace_io_write(WFX_REG_IN_OUT_QUEUE, buf, len); wdev->hwbus_ops->unlock(wdev->hwbus_priv); if (ret) - dev_err(wdev->dev, "%s: bus communication error: %d\n", __func__, ret); + dev_err(wdev->dev, "%s: bus communication error: %d\n", + __func__, ret); return ret; } diff --git a/drivers/staging/wfx/hwio.h b/drivers/staging/wfx/hwio.h index 906524f71fd1..f66a0c9059f6 100644 --- a/drivers/staging/wfx/hwio.h +++ b/drivers/staging/wfx/hwio.h @@ -37,8 +37,13 @@ int ahb_reg_write(struct wfx_dev *wdev, u32 addr, u32 val); #define CFG_ERR_HOST_NO_IN_QUEUE 0x00000040 #define CFG_ERR_HOST_CRC_MISS 0x00000080 // only with SDIO #define CFG_SPI_IGNORE_CS 0x00000080 // only with SPI -#define CFG_WORD_MODE_MASK 0x00000300 // Bytes ordering (only writable in SPI): -#define CFG_WORD_MODE0 0x00000000 // B1,B0,B3,B2 (In SPI, register address and CONFIG data always use this mode) +/* Bytes ordering (only writable in SPI) */ +#define CFG_WORD_MODE_MASK 0x00000300 +/* + * B1,B0,B3,B2 (In SPI, register address + * and CONFIG data always use this mode) + */ +#define CFG_WORD_MODE0 0x00000000 #define CFG_WORD_MODE1 0x00000100 // B3,B2,B1,B0 #define CFG_WORD_MODE2 0x00000200 // B0,B1,B2,B3 (SDIO) #define CFG_DIRECT_ACCESS_MODE 0x00000400 // Direct or queue access mode diff --git a/drivers/staging/wfx/key.c b/drivers/staging/wfx/key.c index caea6d959b0e..ab27db006757 100644 --- a/drivers/staging/wfx/key.c +++ b/drivers/staging/wfx/key.c @@ -171,28 +171,36 @@ static int wfx_add_key(struct wfx_vif *wvif, struct ieee80211_sta *sta, return -EINVAL; k = &wdev->keys[idx]; k->int_id = wvif->id; - if (key->cipher == WLAN_CIPHER_SUITE_WEP40 || key->cipher == WLAN_CIPHER_SUITE_WEP104) { + if (key->cipher == WLAN_CIPHER_SUITE_WEP40 || + key->cipher == WLAN_CIPHER_SUITE_WEP104) { if (pairwise) - k->type = fill_wep_pair(&k->key.wep_pairwise_key, key, sta->addr); + k->type = fill_wep_pair(&k->key.wep_pairwise_key, + key, sta->addr); else k->type = fill_wep_group(&k->key.wep_group_key, key); } else if (key->cipher == WLAN_CIPHER_SUITE_TKIP) { if (pairwise) - k->type = fill_tkip_pair(&k->key.tkip_pairwise_key, key, sta->addr); + k->type = fill_tkip_pair(&k->key.tkip_pairwise_key, + key, sta->addr); else - k->type = fill_tkip_group(&k->key.tkip_group_key, key, &seq, wvif->vif->type); + k->type = fill_tkip_group(&k->key.tkip_group_key, key, + &seq, wvif->vif->type); } else if (key->cipher == WLAN_CIPHER_SUITE_CCMP) { if (pairwise) - k->type = fill_ccmp_pair(&k->key.aes_pairwise_key, key, sta->addr); + k->type = fill_ccmp_pair(&k->key.aes_pairwise_key, key, + sta->addr); else - k->type = fill_ccmp_group(&k->key.aes_group_key, key, &seq); + k->type = fill_ccmp_group(&k->key.aes_group_key, + key, &seq); } else if (key->cipher == WLAN_CIPHER_SUITE_SMS4) { if (pairwise) - k->type = fill_sms4_pair(&k->key.wapi_pairwise_key, key, sta->addr); + k->type = fill_sms4_pair(&k->key.wapi_pairwise_key, + key, sta->addr); else k->type = fill_sms4_group(&k->key.wapi_group_key, key); } else if (key->cipher == WLAN_CIPHER_SUITE_AES_CMAC) { - k->type = fill_aes_cmac_group(&k->key.igtk_group_key, key, &seq); + k->type = fill_aes_cmac_group(&k->key.igtk_group_key, + key, &seq); } else { dev_warn(wdev->dev, "unsupported key type %d\n", key->cipher); wfx_free_key(wdev, idx); diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c index 18f07f7ad347..36f62cf5f401 100644 --- a/drivers/staging/wfx/main.c +++ b/drivers/staging/wfx/main.c @@ -99,7 +99,8 @@ static const struct ieee80211_supported_band wfx_band_2ghz = { .ht_cap = { // Receive caps .cap = IEEE80211_HT_CAP_GRN_FLD | IEEE80211_HT_CAP_SGI_20 | - IEEE80211_HT_CAP_MAX_AMSDU | (1 << IEEE80211_HT_CAP_RX_STBC_SHIFT), + IEEE80211_HT_CAP_MAX_AMSDU | + (1 << IEEE80211_HT_CAP_RX_STBC_SHIFT), .ht_supported = 1, .ampdu_factor = IEEE80211_HT_MAX_AMPDU_16K, .ampdu_density = IEEE80211_HT_MPDU_DENSITY_NONE, @@ -163,14 +164,16 @@ bool wfx_api_older_than(struct wfx_dev *wdev, int major, int minor) return false; } -struct gpio_desc *wfx_get_gpio(struct device *dev, int override, const char *label) +struct gpio_desc *wfx_get_gpio(struct device *dev, int override, + const char *label) { struct gpio_desc *ret; char label_buf[256]; if (override >= 0) { snprintf(label_buf, sizeof(label_buf), "wfx_%s", label); - ret = ERR_PTR(devm_gpio_request_one(dev, override, GPIOF_OUT_INIT_LOW, label_buf)); + ret = ERR_PTR(devm_gpio_request_one(dev, override, + GPIOF_OUT_INIT_LOW, label_buf)); if (!ret) ret = gpio_to_desc(override); } else if (override == -1) { @@ -182,10 +185,12 @@ struct gpio_desc *wfx_get_gpio(struct device *dev, int override, const char *lab if (!ret || PTR_ERR(ret) == -ENOENT) dev_warn(dev, "gpio %s is not defined\n", label); else - dev_warn(dev, "error while requesting gpio %s\n", label); + dev_warn(dev, "error while requesting gpio %s\n", + label); ret = NULL; } else { - dev_dbg(dev, "using gpio %d for %s\n", desc_to_gpio(ret), label); + dev_dbg(dev, "using gpio %d for %s\n", + desc_to_gpio(ret), label); } return ret; } @@ -215,7 +220,8 @@ int wfx_send_pds(struct wfx_dev *wdev, unsigned char *buf, size_t len) buf[i] = 0; dev_dbg(wdev->dev, "send PDS '%s}'\n", buf + start); buf[i] = '}'; - ret = hif_configuration(wdev, buf + start, i - start + 1); + ret = hif_configuration(wdev, + buf + start, i - start + 1); if (ret == HIF_STATUS_FAILURE) { dev_err(wdev->dev, "PDS bytes %d to %d: invalid data (unsupported options?)\n", start, i); return -EINVAL; @@ -243,7 +249,8 @@ static int wfx_send_pdata_pds(struct wfx_dev *wdev) ret = request_firmware(&pds, wdev->pdata.file_pds, wdev->dev); if (ret) { - dev_err(wdev->dev, "can't load PDS file %s\n", wdev->pdata.file_pds); + dev_err(wdev->dev, "can't load PDS file %s\n", + wdev->pdata.file_pds); return ret; } tmp_buf = kmemdup(pds->data, pds->size, GFP_KERNEL); @@ -282,9 +289,10 @@ struct wfx_dev *wfx_init_common(struct device *dev, hw->queues = 4; hw->max_rates = 8; hw->max_rate_tries = 15; - hw->extra_tx_headroom = sizeof(struct hif_sl_msg_hdr) + sizeof(struct hif_msg) - + sizeof(struct hif_req_tx) - + 4 /* alignment */ + 8 /* TKIP IV */; + hw->extra_tx_headroom = sizeof(struct hif_sl_msg_hdr) + + sizeof(struct hif_msg) + + sizeof(struct hif_req_tx) + + 4 /* alignment */ + 8 /* TKIP IV */; hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_ADHOC) | BIT(NL80211_IFTYPE_AP); @@ -297,7 +305,8 @@ struct wfx_dev *wfx_init_common(struct device *dev, hw->wiphy->iface_combinations = wfx_iface_combinations; hw->wiphy->bands[NL80211_BAND_2GHZ] = devm_kmalloc(dev, sizeof(wfx_band_2ghz), GFP_KERNEL); // FIXME: also copy wfx_rates and wfx_2ghz_chantable - memcpy(hw->wiphy->bands[NL80211_BAND_2GHZ], &wfx_band_2ghz, sizeof(wfx_band_2ghz)); + memcpy(hw->wiphy->bands[NL80211_BAND_2GHZ], &wfx_band_2ghz, + sizeof(wfx_band_2ghz)); wdev = hw->priv; wdev->hw = hw; @@ -305,7 +314,8 @@ struct wfx_dev *wfx_init_common(struct device *dev, wdev->hwbus_ops = hwbus_ops; wdev->hwbus_priv = hwbus_priv; memcpy(&wdev->pdata, pdata, sizeof(*pdata)); - of_property_read_string(dev->of_node, "config-file", &wdev->pdata.file_pds); + of_property_read_string(dev->of_node, "config-file", + &wdev->pdata.file_pds); wdev->pdata.gpio_wakeup = wfx_get_gpio(dev, gpio_wakeup, "wakeup"); wfx_sl_fill_pdata(dev, &wdev->pdata); @@ -344,7 +354,8 @@ int wfx_probe(struct wfx_dev *wdev) if (err) goto err1; - err = wait_for_completion_interruptible_timeout(&wdev->firmware_ready, 10 * HZ); + err = wait_for_completion_interruptible_timeout(&wdev->firmware_ready, + 10 * HZ); if (err <= 0) { if (err == 0) { dev_err(wdev->dev, "timeout while waiting for startup indication. IRQ configuration error?\n"); @@ -359,9 +370,11 @@ int wfx_probe(struct wfx_dev *wdev) dev_info(wdev->dev, "started firmware %d.%d.%d \"%s\" (API: %d.%d, keyset: %02X, caps: 0x%.8X)\n", wdev->hw_caps.firmware_major, wdev->hw_caps.firmware_minor, wdev->hw_caps.firmware_build, wdev->hw_caps.firmware_label, - wdev->hw_caps.api_version_major, wdev->hw_caps.api_version_minor, + wdev->hw_caps.api_version_major, + wdev->hw_caps.api_version_minor, wdev->keyset, *((u32 *) &wdev->hw_caps.capabilities)); - snprintf(wdev->hw->wiphy->fw_version, sizeof(wdev->hw->wiphy->fw_version), + snprintf(wdev->hw->wiphy->fw_version, + sizeof(wdev->hw->wiphy->fw_version), "%d.%d.%d", wdev->hw_caps.firmware_major, wdev->hw_caps.firmware_minor, @@ -386,7 +399,8 @@ int wfx_probe(struct wfx_dev *wdev) wdev->hw->wiphy->bands[NL80211_BAND_2GHZ]->channels[13].flags |= IEEE80211_CHAN_DISABLED; } - dev_dbg(wdev->dev, "sending configuration file %s\n", wdev->pdata.file_pds); + dev_dbg(wdev->dev, "sending configuration file %s\n", + wdev->pdata.file_pds); err = wfx_send_pdata_pds(wdev); if (err < 0) goto err1; @@ -394,7 +408,8 @@ int wfx_probe(struct wfx_dev *wdev) wdev->pdata.gpio_wakeup = gpio_saved; if (wdev->pdata.gpio_wakeup) { dev_dbg(wdev->dev, "enable 'quiescent' power mode with gpio %d and PDS file %s\n", - desc_to_gpio(wdev->pdata.gpio_wakeup), wdev->pdata.file_pds); + desc_to_gpio(wdev->pdata.gpio_wakeup), + wdev->pdata.file_pds); gpiod_set_value(wdev->pdata.gpio_wakeup, 1); control_reg_write(wdev, 0); hif_set_operational_mode(wdev, HIF_OP_POWER_MODE_QUIESCENT); @@ -411,13 +426,15 @@ int wfx_probe(struct wfx_dev *wdev) ether_addr_copy(wdev->addresses[i].addr, macaddr); wdev->addresses[i].addr[ETH_ALEN - 1] += i; } else { - ether_addr_copy(wdev->addresses[i].addr, wdev->hw_caps.mac_addr[i]); + ether_addr_copy(wdev->addresses[i].addr, + wdev->hw_caps.mac_addr[i]); } if (!is_valid_ether_addr(wdev->addresses[i].addr)) { dev_warn(wdev->dev, "using random MAC address\n"); eth_random_addr(wdev->addresses[i].addr); } - dev_info(wdev->dev, "MAC address %d: %pM\n", i, wdev->addresses[i].addr); + dev_info(wdev->dev, "MAC address %d: %pM\n", i, + wdev->addresses[i].addr); } wdev->hw->wiphy->n_addresses = ARRAY_SIZE(wdev->addresses); wdev->hw->wiphy->addresses = wdev->addresses; diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index ef3ee55cf621..3e4c46619718 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -42,7 +42,8 @@ void wfx_tx_flush(struct wfx_dev *wdev) !wdev->hif.tx_buffers_used, msecs_to_jiffies(3000)); if (!ret) { - dev_warn(wdev->dev, "cannot flush tx buffers (%d still busy)\n", wdev->hif.tx_buffers_used); + dev_warn(wdev->dev, "cannot flush tx buffers (%d still busy)\n", + wdev->hif.tx_buffers_used); wfx_pending_dump_old_frames(wdev, 3000); // FIXME: drop pending frames here wdev->chip_frozen = 1; @@ -121,7 +122,8 @@ void wfx_tx_queues_wait_empty_vif(struct wfx_vif *wvif) } while (!done); } -static void wfx_tx_queue_clear(struct wfx_dev *wdev, struct wfx_queue *queue, struct sk_buff_head *gc_list) +static void wfx_tx_queue_clear(struct wfx_dev *wdev, struct wfx_queue *queue, + struct sk_buff_head *gc_list) { int i; struct sk_buff *item; @@ -189,7 +191,8 @@ size_t wfx_tx_queue_get_num_queued(struct wfx_queue *queue, ret = skb_queue_len(&queue->queue); } else { ret = 0; - for (i = 0, bit = 1; i < ARRAY_SIZE(queue->link_map_cache); ++i, bit <<= 1) { + for (i = 0, bit = 1; i < ARRAY_SIZE(queue->link_map_cache); ++i, + bit <<= 1) { if (link_id_map & bit) ret += queue->link_map_cache[i]; } @@ -198,7 +201,8 @@ size_t wfx_tx_queue_get_num_queued(struct wfx_queue *queue, return ret; } -void wfx_tx_queue_put(struct wfx_dev *wdev, struct wfx_queue *queue, struct sk_buff *skb) +void wfx_tx_queue_put(struct wfx_dev *wdev, struct wfx_queue *queue, + struct sk_buff *skb) { struct wfx_queue_stats *stats = &wdev->tx_queue_stats; struct wfx_tx_priv *tx_priv = wfx_skb_tx_priv(skb); @@ -315,7 +319,8 @@ void wfx_pending_dump_old_frames(struct wfx_dev *wdev, unsigned int limit_ms) skb_queue_walk(&stats->pending, skb) { tx_priv = wfx_skb_tx_priv(skb); req = wfx_skb_txreq(skb); - if (ktime_after(now, ktime_add_ms(tx_priv->xmit_timestamp, limit_ms))) { + if (ktime_after(now, ktime_add_ms(tx_priv->xmit_timestamp, + limit_ms))) { if (first) { dev_info(wdev->dev, "frames stuck in firmware since %dms or more:\n", limit_ms); @@ -329,7 +334,8 @@ void wfx_pending_dump_old_frames(struct wfx_dev *wdev, unsigned int limit_ms) spin_unlock_bh(&stats->pending.lock); } -unsigned int wfx_pending_get_pkt_us_delay(struct wfx_dev *wdev, struct sk_buff *skb) +unsigned int wfx_pending_get_pkt_us_delay(struct wfx_dev *wdev, + struct sk_buff *skb) { ktime_t now = ktime_get(); struct wfx_tx_priv *tx_priv = wfx_skb_tx_priv(skb); @@ -376,7 +382,8 @@ static bool hif_handle_tx_data(struct wfx_vif *wvif, struct sk_buff *skb, case NL80211_IFTYPE_AP: if (!wvif->state) { action = do_drop; - } else if (!(BIT(tx_priv->raw_link_id) & (BIT(0) | wvif->link_id_map))) { + } else if (!(BIT(tx_priv->raw_link_id) & + (BIT(0) | wvif->link_id_map))) { dev_warn(wvif->wdev->dev, "a frame with expired link-id is dropped\n"); action = do_drop; } @@ -462,7 +469,8 @@ static int wfx_get_prio_queue(struct wfx_vif *wvif, /* override winner if bursting */ if (winner >= 0 && wvif->wdev->tx_burst_idx >= 0 && winner != wvif->wdev->tx_burst_idx && - !wfx_tx_queue_get_num_queued(&wvif->wdev->tx_queue[winner], tx_allowed_mask & urgent) && + !wfx_tx_queue_get_num_queued(&wvif->wdev->tx_queue[winner], + tx_allowed_mask & urgent) && wfx_tx_queue_get_num_queued(&wvif->wdev->tx_queue[wvif->wdev->tx_burst_idx], tx_allowed_mask)) winner = wvif->wdev->tx_burst_idx; @@ -536,10 +544,13 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) while ((wvif = wvif_iterate(wdev, wvif)) != NULL) { spin_lock_bh(&wvif->ps_state_lock); - not_found = wfx_tx_queue_mask_get(wvif, &vif_queue, &vif_tx_allowed_mask, &vif_more); + not_found = wfx_tx_queue_mask_get(wvif, &vif_queue, + &vif_tx_allowed_mask, + &vif_more); if (wvif->mcast_buffered && (not_found || !vif_more) && - (wvif->mcast_tx || !wvif->sta_asleep_mask)) { + (wvif->mcast_tx || + !wvif->sta_asleep_mask)) { wvif->mcast_buffered = false; if (wvif->mcast_tx) { wvif->mcast_tx = false; @@ -600,7 +611,8 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) */ if (more) { req = (struct hif_req_tx *) hif->body; - hdr = (struct ieee80211_hdr *) (req->frame + req->data_flags.fc_offset); + hdr = (struct ieee80211_hdr *) (req->frame + + req->data_flags.fc_offset); hdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_MOREDATA); } return hif; diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.c index cba735c1e73c..35fcf9119f96 100644 --- a/drivers/staging/wfx/scan.c +++ b/drivers/staging/wfx/scan.c @@ -12,7 +12,8 @@ #include "sta.h" #include "hif_tx_mib.h" -static void __ieee80211_scan_completed_compat(struct ieee80211_hw *hw, bool aborted) +static void __ieee80211_scan_completed_compat(struct ieee80211_hw *hw, + bool aborted) { struct cfg80211_scan_info info = { .aborted = aborted ? 1 : 0, @@ -159,7 +160,8 @@ void wfx_scan_work(struct work_struct *work) if (!wvif->scan.req || wvif->scan.curr == wvif->scan.end) { if (wvif->scan.output_power != wvif->wdev->output_power) - hif_set_output_power(wvif, wvif->wdev->output_power * 10); + hif_set_output_power(wvif, + wvif->wdev->output_power * 10); if (wvif->scan.status < 0) dev_warn(wvif->wdev->dev, "scan failed\n"); @@ -172,7 +174,8 @@ void wfx_scan_work(struct work_struct *work) wfx_scan_restart_delayed(wvif); wfx_tx_unlock(wvif->wdev); mutex_unlock(&wvif->wdev->conf_mutex); - __ieee80211_scan_completed_compat(wvif->wdev->hw, wvif->scan.status ? 1 : 0); + __ieee80211_scan_completed_compat(wvif->wdev->hw, + wvif->scan.status ? 1 : 0); up(&wvif->scan.lock); if (wvif->state == WFX_STATE_STA && !(wvif->powersave_mode.pm_mode.enter_psm)) @@ -211,7 +214,8 @@ void wfx_scan_work(struct work_struct *work) scan.scan_req.scan_flags.fbg = 1; } - scan.ch = kcalloc(scan.scan_req.num_of_channels, sizeof(u8), GFP_KERNEL); + scan.ch = kcalloc(scan.scan_req.num_of_channels, + sizeof(u8), GFP_KERNEL); if (!scan.ch) { wvif->scan.status = -ENOMEM; @@ -273,7 +277,8 @@ void wfx_scan_complete_cb(struct wfx_vif *wvif, struct hif_ind_scan_cmpl *arg) void wfx_scan_timeout(struct work_struct *work) { - struct wfx_vif *wvif = container_of(work, struct wfx_vif, scan.timeout.work); + struct wfx_vif *wvif = container_of(work, struct wfx_vif, + scan.timeout.work); if (atomic_xchg(&wvif->scan.in_progress, 0)) { if (wvif->scan.status > 0) { diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 43137657209c..3a8c24a51300 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -100,7 +100,8 @@ void wfx_cqm_bssloss_sm(struct wfx_vif *wvif, int init, int good, int bad) skb = ieee80211_nullfunc_get(wvif->wdev->hw, wvif->vif, false); if (!skb) goto end; - memset(IEEE80211_SKB_CB(skb), 0, sizeof(*IEEE80211_SKB_CB(skb))); + memset(IEEE80211_SKB_CB(skb), 0, + sizeof(*IEEE80211_SKB_CB(skb))); IEEE80211_SKB_CB(skb)->control.vif = wvif->vif; IEEE80211_SKB_CB(skb)->driver_rates[0].idx = 0; IEEE80211_SKB_CB(skb)->driver_rates[0].count = 1; @@ -180,7 +181,8 @@ static int wfx_set_mcast_filter(struct wfx_vif *wvif, for (i = 0; i < fp->num_addresses; i++) { filter_addr_val.condition_idx = i; filter_addr_val.address_type = HIF_MAC_ADDR_A1; - ether_addr_copy(filter_addr_val.mac_address, fp->address_list[i]); + ether_addr_copy(filter_addr_val.mac_address, + fp->address_list[i]); ret = hif_set_mac_addr_condition(wvif, &filter_addr_val); if (ret) return ret; @@ -246,7 +248,8 @@ void wfx_update_filtering(struct wfx_vif *wvif) bf_ctrl.bcn_count = 1; n_filter_ies = 0; } else if (!is_sta) { - bf_ctrl.enable = HIF_BEACON_FILTER_ENABLE | HIF_BEACON_FILTER_AUTO_ERP; + bf_ctrl.enable = HIF_BEACON_FILTER_ENABLE | + HIF_BEACON_FILTER_AUTO_ERP; bf_ctrl.bcn_count = 0; n_filter_ies = 2; } else { @@ -257,9 +260,11 @@ void wfx_update_filtering(struct wfx_vif *wvif) ret = hif_set_rx_filter(wvif, filter_bssid, fwd_probe_req); if (!ret) - ret = hif_set_beacon_filter_table(wvif, n_filter_ies, filter_ies); + ret = hif_set_beacon_filter_table(wvif, + n_filter_ies, filter_ies); if (!ret) - ret = hif_beacon_filter_control(wvif, bf_ctrl.enable, bf_ctrl.bcn_count); + ret = hif_beacon_filter_control(wvif, bf_ctrl.enable, + bf_ctrl.bcn_count); if (!ret) ret = wfx_set_mcast_filter(wvif, &wvif->mcast_filter); if (ret) @@ -268,7 +273,8 @@ void wfx_update_filtering(struct wfx_vif *wvif) static void wfx_update_filtering_work(struct work_struct *work) { - struct wfx_vif *wvif = container_of(work, struct wfx_vif, update_filtering_work); + struct wfx_vif *wvif = container_of(work, struct wfx_vif, + update_filtering_work); wfx_update_filtering(wvif); } @@ -283,7 +289,8 @@ u64 wfx_prepare_multicast(struct ieee80211_hw *hw, struct netdev_hw_addr_list *m while ((wvif = wvif_iterate(wdev, wvif)) != NULL) { memset(&wvif->mcast_filter, 0x00, sizeof(wvif->mcast_filter)); - if (!count || count > ARRAY_SIZE(wvif->mcast_filter.address_list)) + if (!count || + count > ARRAY_SIZE(wvif->mcast_filter.address_list)) continue; i = 0; @@ -384,7 +391,8 @@ int wfx_set_pm(struct wfx_vif *wvif, const struct hif_req_set_pm_mode *arg) pm.pm_mode.fast_psm = 0; } - if (!wait_for_completion_timeout(&wvif->set_pm_mode_complete, msecs_to_jiffies(300))) + if (!wait_for_completion_timeout(&wvif->set_pm_mode_complete, + msecs_to_jiffies(300))) dev_warn(wvif->wdev->dev, "timeout while waiting of set_pm_mode_complete\n"); ret = hif_set_pm(wvif, &pm); // FIXME: why ? @@ -445,7 +453,8 @@ void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, wvif = (struct wfx_vif *) vif->drv_priv; if (wvif->vif->type == NL80211_IFTYPE_MONITOR) drop = true; - if (wvif->vif->type == NL80211_IFTYPE_AP && !wvif->enable_beacon) + if (wvif->vif->type == NL80211_IFTYPE_AP && + !wvif->enable_beacon) drop = true; } @@ -497,7 +506,8 @@ static void wfx_event_handler_work(struct work_struct *work) */ wvif->delayed_link_loss = 1; /* Also start a watchdog. */ - schedule_delayed_work(&wvif->bss_loss_work, 5 * HZ); + schedule_delayed_work(&wvif->bss_loss_work, + 5 * HZ); } break; case HIF_EVENT_IND_BSSREGAINED: @@ -505,13 +515,15 @@ static void wfx_event_handler_work(struct work_struct *work) cancel_work_sync(&wvif->unjoin_work); break; case HIF_EVENT_IND_RCPI_RSSI: - wfx_event_report_rssi(wvif, event->evt.event_data.rcpi_rssi); + wfx_event_report_rssi(wvif, + event->evt.event_data.rcpi_rssi); break; case HIF_EVENT_IND_PS_MODE_ERROR: dev_warn(wvif->wdev->dev, "error while processing power save request\n"); break; default: - dev_warn(wvif->wdev->dev, "unhandled event indication: %.2x\n", event->evt.event_id); + dev_warn(wvif->wdev->dev, "unhandled event indication: %.2x\n", + event->evt.event_id); break; } } @@ -520,14 +532,16 @@ static void wfx_event_handler_work(struct work_struct *work) static void wfx_bss_loss_work(struct work_struct *work) { - struct wfx_vif *wvif = container_of(work, struct wfx_vif, bss_loss_work.work); + struct wfx_vif *wvif = container_of(work, struct wfx_vif, + bss_loss_work.work); ieee80211_connection_loss(wvif->vif); } static void wfx_bss_params_work(struct work_struct *work) { - struct wfx_vif *wvif = container_of(work, struct wfx_vif, bss_params_work); + struct wfx_vif *wvif = container_of(work, struct wfx_vif, + bss_params_work); mutex_lock(&wvif->wdev->conf_mutex); wvif->bss_params.bss_flags.lost_count_only = 1; @@ -538,9 +552,11 @@ static void wfx_bss_params_work(struct work_struct *work) static void wfx_set_beacon_wakeup_period_work(struct work_struct *work) { - struct wfx_vif *wvif = container_of(work, struct wfx_vif, set_beacon_wakeup_period_work); + struct wfx_vif *wvif = container_of(work, struct wfx_vif, + set_beacon_wakeup_period_work); - hif_set_beacon_wakeup_period(wvif, wvif->dtim_period, wvif->dtim_period); + hif_set_beacon_wakeup_period(wvif, wvif->dtim_period, + wvif->dtim_period); } static void wfx_do_unjoin(struct wfx_vif *wvif) @@ -632,7 +648,8 @@ static void wfx_do_join(struct wfx_vif *wvif) .preamble_type = conf->use_short_preamble ? HIF_PREAMBLE_SHORT : HIF_PREAMBLE_LONG, .probe_for_join = 1, .atim_window = 0, - .basic_rate_set = wfx_rate_mask_to_hw(wvif->wdev, conf->basic_rates), + .basic_rate_set = wfx_rate_mask_to_hw(wvif->wdev, + conf->basic_rates), }; if (wvif->channel->flags & IEEE80211_CHAN_NO_IR) @@ -643,7 +660,8 @@ static void wfx_do_join(struct wfx_vif *wvif) bssid = wvif->vif->bss_conf.bssid; - bss = cfg80211_get_bss(wvif->wdev->hw->wiphy, wvif->channel, bssid, NULL, 0, + bss = cfg80211_get_bss(wvif->wdev->hw->wiphy, wvif->channel, bssid, + NULL, 0, IEEE80211_BSS_TYPE_ANY, IEEE80211_PRIVACY_ANY); if (!bss && !conf->ibss_joined) { @@ -819,7 +837,8 @@ static int wfx_start_ap(struct wfx_vif *wvif) .beacon_interval = conf->beacon_int, .dtim_period = conf->dtim_period, .preamble_type = conf->use_short_preamble ? HIF_PREAMBLE_SHORT : HIF_PREAMBLE_LONG, - .basic_rate_set = wfx_rate_mask_to_hw(wvif->wdev, conf->basic_rates), + .basic_rate_set = wfx_rate_mask_to_hw(wvif->wdev, + conf->basic_rates), }; memset(start.ssid, 0, sizeof(start.ssid)); @@ -931,7 +950,8 @@ static int wfx_ht_ampdu_density(const struct wfx_ht_info *ht_info) return ht_info->ht_cap.ampdu_density; } -static void wfx_join_finalize(struct wfx_vif *wvif, struct ieee80211_bss_conf *info) +static void wfx_join_finalize(struct wfx_vif *wvif, + struct ieee80211_bss_conf *info) { struct ieee80211_sta *sta = NULL; struct hif_mib_set_association_mode association_mode = { }; @@ -946,7 +966,8 @@ static void wfx_join_finalize(struct wfx_vif *wvif, struct ieee80211_bss_conf *i if (sta) { wvif->ht_info.ht_cap = sta->ht_cap; wvif->bss_params.operational_rate_set = - wfx_rate_mask_to_hw(wvif->wdev, sta->supp_rates[wvif->channel->band]); + wfx_rate_mask_to_hw(wvif->wdev, + sta->supp_rates[wvif->channel->band]); wvif->ht_info.operation_mode = info->ht_operation_mode; } else { memset(&wvif->ht_info, 0, sizeof(wvif->ht_info)); @@ -955,7 +976,8 @@ static void wfx_join_finalize(struct wfx_vif *wvif, struct ieee80211_bss_conf *i rcu_read_unlock(); /* Non Greenfield stations present */ - if (wvif->ht_info.operation_mode & IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT) + if (wvif->ht_info.operation_mode & + IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT) hif_dual_cts_protection(wvif, true); else hif_dual_cts_protection(wvif, false); @@ -1007,14 +1029,17 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, struct hif_mib_arp_ip_addr_table filter = { }; nb_arp_addr = info->arp_addr_cnt; - if (nb_arp_addr <= 0 || nb_arp_addr > HIF_MAX_ARP_IP_ADDRTABLE_ENTRIES) + if (nb_arp_addr <= 0 || + nb_arp_addr > HIF_MAX_ARP_IP_ADDRTABLE_ENTRIES) nb_arp_addr = 0; for (i = 0; i < HIF_MAX_ARP_IP_ADDRTABLE_ENTRIES; i++) { filter.condition_idx = i; if (i < nb_arp_addr) { // Caution: type of arp_addr_list[i] is __be32 - memcpy(filter.ipv4_address, &info->arp_addr_list[i], sizeof(filter.ipv4_address)); + memcpy(filter.ipv4_address, + &info->arp_addr_list[i], + sizeof(filter.ipv4_address)); filter.arp_enable = HIF_ARP_NS_FILTERING_ENABLE; } else { filter.arp_enable = HIF_ARP_NS_FILTERING_DISABLE; @@ -1031,7 +1056,8 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, wfx_upload_beacon(wvif); } - if (changed & BSS_CHANGED_BEACON_ENABLED && wvif->state != WFX_STATE_IBSS) { + if (changed & BSS_CHANGED_BEACON_ENABLED && + wvif->state != WFX_STATE_IBSS) { if (wvif->enable_beacon != info->enable_beacon) { hif_beacon_transmit(wvif, info->enable_beacon); wvif->enable_beacon = info->enable_beacon; @@ -1064,7 +1090,8 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, if (changed & (BSS_CHANGED_ASSOC | BSS_CHANGED_BSSID | - BSS_CHANGED_IBSS | BSS_CHANGED_BASIC_RATES | BSS_CHANGED_HT)) { + BSS_CHANGED_IBSS | BSS_CHANGED_BASIC_RATES | + BSS_CHANGED_HT)) { if (info->assoc) { if (wvif->state < WFX_STATE_PRE_STA) { ieee80211_connection_loss(vif); @@ -1080,7 +1107,8 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, if (info->assoc || info->ibss_joined) wfx_join_finalize(wvif, info); else - memset(&wvif->bss_params, 0, sizeof(wvif->bss_params)); + memset(&wvif->bss_params, + 0, sizeof(wvif->bss_params)); } } @@ -1127,7 +1155,8 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, /* RSSI: signed Q8.0, RCPI: unsigned Q7.1 * RSSI = RCPI / 2 - 110 */ - th.upper_threshold = info->cqm_rssi_thold + info->cqm_rssi_hyst; + th.upper_threshold = info->cqm_rssi_thold + + info->cqm_rssi_hyst; th.upper_threshold = (th.upper_threshold + 110) * 2; th.lower_threshold = info->cqm_rssi_thold; th.lower_threshold = (th.lower_threshold + 110) * 2; @@ -1135,7 +1164,8 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, hif_set_rcpi_rssi_threshold(wvif, &th); } - if (changed & BSS_CHANGED_TXPOWER && info->txpower != wdev->output_power) { + if (changed & BSS_CHANGED_TXPOWER && + info->txpower != wdev->output_power) { wdev->output_power = info->txpower; hif_set_output_power(wvif, wdev->output_power * 10); } @@ -1250,7 +1280,8 @@ int wfx_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta, bool set) static void wfx_mcast_start_work(struct work_struct *work) { - struct wfx_vif *wvif = container_of(work, struct wfx_vif, mcast_start_work); + struct wfx_vif *wvif = container_of(work, struct wfx_vif, + mcast_start_work); long tmo = wvif->dtim_period * TU_TO_JIFFIES(wvif->beacon_int + 20); cancel_work_sync(&wvif->mcast_stop_work); @@ -1265,7 +1296,8 @@ static void wfx_mcast_start_work(struct work_struct *work) static void wfx_mcast_stop_work(struct work_struct *work) { - struct wfx_vif *wvif = container_of(work, struct wfx_vif, mcast_stop_work); + struct wfx_vif *wvif = container_of(work, struct wfx_vif, + mcast_stop_work); if (wvif->aid0_bit_set) { del_timer_sync(&wvif->mcast_timeout); @@ -1313,7 +1345,8 @@ void wfx_suspend_resume(struct wfx_vif *wvif, if (!arg->suspend_resume_flags.resume) wvif->mcast_tx = false; else - wvif->mcast_tx = wvif->aid0_bit_set && wvif->mcast_buffered; + wvif->mcast_tx = wvif->aid0_bit_set && + wvif->mcast_buffered; if (wvif->mcast_tx) { cancel_tmo = true; wfx_bh_request_tx(wvif->wdev); @@ -1361,7 +1394,8 @@ int wfx_assign_vif_chanctx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, return 0; } -void wfx_unassign_vif_chanctx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, +void wfx_unassign_vif_chanctx(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, struct ieee80211_chanctx_conf *conf) { struct wfx_vif *wvif = (struct wfx_vif *) vif->drv_priv; @@ -1395,17 +1429,23 @@ int wfx_config(struct ieee80211_hw *hw, u32 changed) if (changed & IEEE80211_CONF_CHANGE_PS) { wvif = NULL; while ((wvif = wvif_iterate(wdev, wvif)) != NULL) { - memset(&wvif->powersave_mode, 0, sizeof(wvif->powersave_mode)); + memset(&wvif->powersave_mode, 0, + sizeof(wvif->powersave_mode)); if (conf->flags & IEEE80211_CONF_PS) { wvif->powersave_mode.pm_mode.enter_psm = 1; if (conf->dynamic_ps_timeout > 0) { wvif->powersave_mode.pm_mode.fast_psm = 1; - // Firmware does not support more than 128ms + /* + * Firmware does not support + * more than 128ms + */ wvif->powersave_mode.fast_psm_idle_period = - min(conf->dynamic_ps_timeout * 2, 255); + min(conf->dynamic_ps_timeout * + 2, 255); } } - if (wvif->state == WFX_STATE_STA && wvif->bss_params.aid) + if (wvif->state == WFX_STATE_STA && + wvif->bss_params.aid) wfx_set_pm(wvif, &wvif->powersave_mode); } wvif = wdev_to_wvif(wdev, 0); @@ -1518,7 +1558,8 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) init_completion(&wvif->set_pm_mode_complete); complete(&wvif->set_pm_mode_complete); - INIT_WORK(&wvif->set_beacon_wakeup_period_work, wfx_set_beacon_wakeup_period_work); + INIT_WORK(&wvif->set_beacon_wakeup_period_work, + wfx_set_beacon_wakeup_period_work); INIT_WORK(&wvif->update_filtering_work, wfx_update_filtering_work); INIT_WORK(&wvif->bss_params_work, wfx_bss_params_work); INIT_WORK(&wvif->set_cts_work, wfx_set_cts_work); @@ -1528,7 +1569,8 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) hif_set_macaddr(wvif, vif->addr); for (i = 0; i < IEEE80211_NUM_ACS; i++) { - memcpy(&wvif->edca.params[i], &default_edca_params[i], sizeof(default_edca_params[i])); + memcpy(&wvif->edca.params[i], &default_edca_params[i], + sizeof(default_edca_params[i])); wvif->edca.uapsd_enable[i] = false; hif_set_edca_queue_params(wvif, &wvif->edca.params[i]); } @@ -1559,7 +1601,8 @@ void wfx_remove_interface(struct ieee80211_hw *hw, while (down_trylock(&wvif->scan.lock)) schedule(); up(&wvif->scan.lock); - wait_for_completion_timeout(&wvif->set_pm_mode_complete, msecs_to_jiffies(300)); + wait_for_completion_timeout(&wvif->set_pm_mode_complete, + msecs_to_jiffies(300)); mutex_lock(&wdev->conf_mutex); switch (wvif->state) { diff --git a/drivers/staging/wfx/sta.h b/drivers/staging/wfx/sta.h index 57c46bd4e650..4ccf1b17632b 100644 --- a/drivers/staging/wfx/sta.h +++ b/drivers/staging/wfx/sta.h @@ -86,11 +86,13 @@ void wfx_change_chanctx(struct ieee80211_hw *hw, struct ieee80211_chanctx_conf *conf, u32 changed); int wfx_assign_vif_chanctx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_chanctx_conf *conf); -void wfx_unassign_vif_chanctx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, +void wfx_unassign_vif_chanctx(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, struct ieee80211_chanctx_conf *conf); // WSM Callbacks -void wfx_suspend_resume(struct wfx_vif *wvif, struct hif_ind_suspend_resume_tx *arg); +void wfx_suspend_resume(struct wfx_vif *wvif, + struct hif_ind_suspend_resume_tx *arg); // Other Helpers void wfx_cqm_bssloss_sm(struct wfx_vif *wvif, int init, int good, int bad); diff --git a/drivers/staging/wfx/traces.h b/drivers/staging/wfx/traces.h index 67457cda133b..9c135410a3e8 100644 --- a/drivers/staging/wfx/traces.h +++ b/drivers/staging/wfx/traces.h @@ -177,14 +177,16 @@ DECLARE_EVENT_CLASS(hif_data, else __entry->msg_type = "REQ"; if (!is_recv && - (__entry->msg_id == HIF_REQ_ID_READ_MIB || __entry->msg_id == HIF_REQ_ID_WRITE_MIB)) { + (__entry->msg_id == HIF_REQ_ID_READ_MIB || + __entry->msg_id == HIF_REQ_ID_WRITE_MIB)) { __entry->mib = le16_to_cpup((u16 *) hif->body); header_len = 4; } else { __entry->mib = -1; header_len = 0; } - __entry->buf_len = min_t(int, __entry->msg_len, sizeof(__entry->buf)) + __entry->buf_len = min_t(int, __entry->msg_len, + sizeof(__entry->buf)) - sizeof(struct hif_msg) - header_len; memcpy(__entry->buf, hif->body + header_len, __entry->buf_len); ), @@ -203,11 +205,13 @@ DECLARE_EVENT_CLASS(hif_data, DEFINE_EVENT(hif_data, hif_send, TP_PROTO(struct hif_msg *hif, int tx_fill_level, bool is_recv), TP_ARGS(hif, tx_fill_level, is_recv)); -#define _trace_hif_send(hif, tx_fill_level) trace_hif_send(hif, tx_fill_level, false) +#define _trace_hif_send(hif, tx_fill_level)\ + trace_hif_send(hif, tx_fill_level, false) DEFINE_EVENT(hif_data, hif_recv, TP_PROTO(struct hif_msg *hif, int tx_fill_level, bool is_recv), TP_ARGS(hif, tx_fill_level, is_recv)); -#define _trace_hif_recv(hif, tx_fill_level) trace_hif_recv(hif, tx_fill_level, true) +#define _trace_hif_recv(hif, tx_fill_level)\ + trace_hif_recv(hif, tx_fill_level, true) #define wfx_reg_list_enum \ wfx_reg_name(WFX_REG_CONFIG, "CONFIG") \ @@ -241,7 +245,8 @@ DECLARE_EVENT_CLASS(io_data, __entry->reg = reg; __entry->addr = addr; __entry->msg_len = len; - __entry->buf_len = min_t(int, sizeof(__entry->buf), __entry->msg_len); + __entry->buf_len = min_t(int, sizeof(__entry->buf), + __entry->msg_len); memcpy(__entry->buf, io_buf, __entry->buf_len); if (addr >= 0) snprintf(__entry->addr_str, 10, "/%08x", addr); @@ -259,12 +264,14 @@ DECLARE_EVENT_CLASS(io_data, DEFINE_EVENT(io_data, io_write, TP_PROTO(int reg, int addr, const void *io_buf, size_t len), TP_ARGS(reg, addr, io_buf, len)); -#define _trace_io_ind_write(reg, addr, io_buf, len) trace_io_write(reg, addr, io_buf, len) +#define _trace_io_ind_write(reg, addr, io_buf, len)\ + trace_io_write(reg, addr, io_buf, len) #define _trace_io_write(reg, io_buf, len) trace_io_write(reg, -1, io_buf, len) DEFINE_EVENT(io_data, io_read, TP_PROTO(int reg, int addr, const void *io_buf, size_t len), TP_ARGS(reg, addr, io_buf, len)); -#define _trace_io_ind_read(reg, addr, io_buf, len) trace_io_read(reg, addr, io_buf, len) +#define _trace_io_ind_read(reg, addr, io_buf, len)\ + trace_io_read(reg, addr, io_buf, len) #define _trace_io_read(reg, io_buf, len) trace_io_read(reg, -1, io_buf, len) DECLARE_EVENT_CLASS(io_data32, @@ -348,7 +355,8 @@ TRACE_EVENT(bh_stats, __entry->release ? "release" : "keep" ) ); -#define _trace_bh_stats(ind, req, cnf, busy, release) trace_bh_stats(ind, req, cnf, busy, release) +#define _trace_bh_stats(ind, req, cnf, busy, release)\ + trace_bh_stats(ind, req, cnf, busy, release) TRACE_EVENT(tx_stats, TP_PROTO(struct hif_cnf_tx *tx_cnf, struct sk_buff *skb, int delay), @@ -365,7 +373,8 @@ TRACE_EVENT(tx_stats, ), TP_fast_assign( // Keep sync with wfx_rates definition in main.c - static const int hw_rate[] = { 0, 1, 2, 3, 6, 7, 8, 9, 10, 11, 12, 13 }; + static const int hw_rate[] = { 0, 1, 2, 3, 6, 7, 8, + 9, 10, 11, 12, 13 }; struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); struct ieee80211_tx_rate *rates = tx_info->driver_rates; int i; diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index 44e580a07c91..781a8c8ba982 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -141,13 +141,15 @@ static inline struct wfx_vif *wdev_to_wvif(struct wfx_dev *wdev, int vif_id) } vif_id = array_index_nospec(vif_id, ARRAY_SIZE(wdev->vif)); if (!wdev->vif[vif_id]) { - dev_dbg(wdev->dev, "requesting non-allocated vif: %d\n", vif_id); + dev_dbg(wdev->dev, "requesting non-allocated vif: %d\n", + vif_id); return NULL; } return (struct wfx_vif *) wdev->vif[vif_id]->drv_priv; } -static inline struct wfx_vif *wvif_iterate(struct wfx_dev *wdev, struct wfx_vif *cur) +static inline struct wfx_vif *wvif_iterate(struct wfx_dev *wdev, + struct wfx_vif *cur) { int i; int mark = 0; -- 2.23.0 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH v2 2/3] staging: wfx: wrap characters 2019-11-11 13:30 ` [PATCH v2 2/3] staging: wfx: wrap characters Jules Irenge @ 2019-11-11 15:34 ` Greg KH 0 siblings, 0 replies; 9+ messages in thread From: Greg KH @ 2019-11-11 15:34 UTC (permalink / raw) To: Jules Irenge; +Cc: devel, linux-kernel On Mon, Nov 11, 2019 at 01:30:54PM +0000, Jules Irenge wrote: > Wrap characters to fix line of over 80 characters. > Issue detected by Checkpatch tool You did other things in here as well: > { > - struct ieee80211_hdr *frame = (struct ieee80211_hdr *) skb->data; > + struct ieee80211_hdr *frame = (struct ieee80211_hdr *)skb->data; Please only do "one type of change per patch". thanks, greg k-h ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2 3/3] staging: wfx: replace u32 by __le32 2019-11-11 13:30 [PATCH v2 1/3] staging: wfx: replace uintXX_t to uXX and intXX_t to sXX Jules Irenge 2019-11-11 13:30 ` [PATCH v2 2/3] staging: wfx: wrap characters Jules Irenge @ 2019-11-11 13:30 ` Jules Irenge 2019-11-11 14:12 ` Greg KH 2019-11-11 16:58 ` Jerome Pouiller 2019-11-11 17:04 ` [PATCH v2 1/3] staging: wfx: replace uintXX_t to uXX and intXX_t to sXX Jerome Pouiller 2 siblings, 2 replies; 9+ messages in thread From: Jules Irenge @ 2019-11-11 13:30 UTC (permalink / raw) To: gregkh; +Cc: jerome.pouiller, devel, linux-kernel, Jules Irenge Replace u32 by __le32 to fix warning of cast from restricted __le32. Issue detected by sparse tool. Signed-off-by: Jules Irenge <jbi.octave@gmail.com> --- v1 uses casting to fix the warnings v2 replace the declaration type of the variables drivers/staging/wfx/hif_api_mib.h | 48 +++++++++++++++---------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/drivers/staging/wfx/hif_api_mib.h b/drivers/staging/wfx/hif_api_mib.h index 94b789ceb4ff..e0a67410add2 100644 --- a/drivers/staging/wfx/hif_api_mib.h +++ b/drivers/staging/wfx/hif_api_mib.h @@ -295,31 +295,31 @@ struct hif_mib_stats_table { } __packed; struct hif_mib_extended_count_table { - u32 count_plcp_errors; - u32 count_fcs_errors; - u32 count_tx_packets; - u32 count_rx_packets; - u32 count_rx_packet_errors; - u32 count_rx_decryption_failures; - u32 count_rx_mic_failures; - u32 count_rx_no_key_failures; - u32 count_tx_multicast_frames; - u32 count_tx_frames_success; - u32 count_tx_frame_failures; - u32 count_tx_frames_retried; - u32 count_tx_frames_multi_retried; - u32 count_rx_frame_duplicates; - u32 count_rts_success; - u32 count_rts_failures; - u32 count_ack_failures; - u32 count_rx_multicast_frames; - u32 count_rx_frames_success; - u32 count_rx_cmacicv_errors; - u32 count_rx_cmac_replays; - u32 count_rx_mgmt_ccmp_replays; + __le32 count_plcp_errors; + __le32 count_fcs_errors; + __le32 count_tx_packets; + __le32 count_rx_packets; + __le32 count_rx_packet_errors; + __le32 count_rx_decryption_failures; + __le32 count_rx_mic_failures; + __le32 count_rx_no_key_failures; + __le32 count_tx_multicast_frames; + __le32 count_tx_frames_success; + __le32 count_tx_frame_failures; + __le32 count_tx_frames_retried; + __le32 count_tx_frames_multi_retried; + __le32 count_rx_frame_duplicates; + __le32 count_rts_success; + __le32 count_rts_failures; + __le32 count_rx_multicast_frames; + __le32 count_rx_cmacicv_errors; + __le32 count_rx_cmac_replays; + __le32 count_rx_mgmt_ccmp_replays; + __le32 count_rx_beacon; + __le32 count_miss_beacon; + __le32 count_ack_failures; + __le32 count_rx_frames_success; u32 count_rx_bipmic_errors; - u32 count_rx_beacon; - u32 count_miss_beacon; u32 reserved[15]; } __packed; -- 2.23.0 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH v2 3/3] staging: wfx: replace u32 by __le32 2019-11-11 13:30 ` [PATCH v2 3/3] staging: wfx: replace u32 by __le32 Jules Irenge @ 2019-11-11 14:12 ` Greg KH 2019-11-11 16:58 ` Jerome Pouiller 1 sibling, 0 replies; 9+ messages in thread From: Greg KH @ 2019-11-11 14:12 UTC (permalink / raw) To: Jules Irenge; +Cc: devel, linux-kernel On Mon, Nov 11, 2019 at 01:30:55PM +0000, Jules Irenge wrote: > Replace u32 by __le32 to fix warning of cast from restricted __le32. > Issue detected by sparse tool. > > Signed-off-by: Jules Irenge <jbi.octave@gmail.com> > --- > v1 uses casting to fix the warnings > v2 replace the declaration type of the variables > > drivers/staging/wfx/hif_api_mib.h | 48 +++++++++++++++---------------- > 1 file changed, 24 insertions(+), 24 deletions(-) > > diff --git a/drivers/staging/wfx/hif_api_mib.h b/drivers/staging/wfx/hif_api_mib.h > index 94b789ceb4ff..e0a67410add2 100644 > --- a/drivers/staging/wfx/hif_api_mib.h > +++ b/drivers/staging/wfx/hif_api_mib.h > @@ -295,31 +295,31 @@ struct hif_mib_stats_table { > } __packed; > > struct hif_mib_extended_count_table { > - u32 count_plcp_errors; > - u32 count_fcs_errors; > - u32 count_tx_packets; > - u32 count_rx_packets; > - u32 count_rx_packet_errors; > - u32 count_rx_decryption_failures; > - u32 count_rx_mic_failures; > - u32 count_rx_no_key_failures; > - u32 count_tx_multicast_frames; > - u32 count_tx_frames_success; > - u32 count_tx_frame_failures; > - u32 count_tx_frames_retried; > - u32 count_tx_frames_multi_retried; > - u32 count_rx_frame_duplicates; > - u32 count_rts_success; > - u32 count_rts_failures; > - u32 count_ack_failures; > - u32 count_rx_multicast_frames; > - u32 count_rx_frames_success; > - u32 count_rx_cmacicv_errors; > - u32 count_rx_cmac_replays; > - u32 count_rx_mgmt_ccmp_replays; > + __le32 count_plcp_errors; > + __le32 count_fcs_errors; > + __le32 count_tx_packets; > + __le32 count_rx_packets; > + __le32 count_rx_packet_errors; > + __le32 count_rx_decryption_failures; > + __le32 count_rx_mic_failures; > + __le32 count_rx_no_key_failures; > + __le32 count_tx_multicast_frames; > + __le32 count_tx_frames_success; > + __le32 count_tx_frame_failures; > + __le32 count_tx_frames_retried; > + __le32 count_tx_frames_multi_retried; > + __le32 count_rx_frame_duplicates; > + __le32 count_rts_success; > + __le32 count_rts_failures; > + __le32 count_rx_multicast_frames; > + __le32 count_rx_cmacicv_errors; > + __le32 count_rx_cmac_replays; > + __le32 count_rx_mgmt_ccmp_replays; > + __le32 count_rx_beacon; > + __le32 count_miss_beacon; > + __le32 count_ack_failures; > + __le32 count_rx_frames_success; > u32 count_rx_bipmic_errors; > - u32 count_rx_beacon; > - u32 count_miss_beacon; > u32 reserved[15]; > } __packed; Is this structure coming from the hardware directly? If so, you just messed up the layout by moving things around, which will break the driver :( thanks, greg k-h ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 3/3] staging: wfx: replace u32 by __le32 2019-11-11 13:30 ` [PATCH v2 3/3] staging: wfx: replace u32 by __le32 Jules Irenge 2019-11-11 14:12 ` Greg KH @ 2019-11-11 16:58 ` Jerome Pouiller 2019-11-11 23:15 ` Joe Perches 1 sibling, 1 reply; 9+ messages in thread From: Jerome Pouiller @ 2019-11-11 16:58 UTC (permalink / raw) To: Jules Irenge; +Cc: gregkh, devel, linux-kernel On Monday 11 November 2019 14:30:55 CET Jules Irenge wrote: [...] > - u32 count_rts_failures; > - u32 count_ack_failures; > - u32 count_rx_multicast_frames; > - u32 count_rx_frames_success; > - u32 count_rx_cmacicv_errors; > - u32 count_rx_cmac_replays; > - u32 count_rx_mgmt_ccmp_replays; [...] > + __le32 count_rts_failures; > + __le32 count_rx_multicast_frames; > + __le32 count_rx_cmacicv_errors; > + __le32 count_rx_cmac_replays; > + __le32 count_rx_mgmt_ccmp_replays; > + __le32 count_rx_beacon; > + __le32 count_miss_beacon; > + __le32 count_ack_failures; > + __le32 count_rx_frames_success; > u32 count_rx_bipmic_errors; > - u32 count_rx_beacon; > - u32 count_miss_beacon; Hello Jules, Your patch reorders members of the structure. It will break API with the chip. -- Jérôme Pouiller ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 3/3] staging: wfx: replace u32 by __le32 2019-11-11 16:58 ` Jerome Pouiller @ 2019-11-11 23:15 ` Joe Perches 0 siblings, 0 replies; 9+ messages in thread From: Joe Perches @ 2019-11-11 23:15 UTC (permalink / raw) To: Jerome Pouiller, Jules Irenge; +Cc: gregkh, devel, linux-kernel On Mon, 2019-11-11 at 16:58 +0000, Jerome Pouiller wrote: > On Monday 11 November 2019 14:30:55 CET Jules Irenge wrote: > [...] > > - u32 count_rts_failures; > > - u32 count_ack_failures; > > - u32 count_rx_multicast_frames; > > - u32 count_rx_frames_success; > > - u32 count_rx_cmacicv_errors; > > - u32 count_rx_cmac_replays; > > - u32 count_rx_mgmt_ccmp_replays; > [...] > > + __le32 count_rts_failures; > > + __le32 count_rx_multicast_frames; > > + __le32 count_rx_cmacicv_errors; > > + __le32 count_rx_cmac_replays; > > + __le32 count_rx_mgmt_ccmp_replays; > > + __le32 count_rx_beacon; > > + __le32 count_miss_beacon; > > + __le32 count_ack_failures; > > + __le32 count_rx_frames_success; > > u32 count_rx_bipmic_errors; > > - u32 count_rx_beacon; > > - u32 count_miss_beacon; > > Hello Jules, > > Your patch reorders members of the structure. It will break API with the > chip. And if the hardware really is le, then almost certainly _all_ the members of the struct should be __le32 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 1/3] staging: wfx: replace uintXX_t to uXX and intXX_t to sXX 2019-11-11 13:30 [PATCH v2 1/3] staging: wfx: replace uintXX_t to uXX and intXX_t to sXX Jules Irenge 2019-11-11 13:30 ` [PATCH v2 2/3] staging: wfx: wrap characters Jules Irenge 2019-11-11 13:30 ` [PATCH v2 3/3] staging: wfx: replace u32 by __le32 Jules Irenge @ 2019-11-11 17:04 ` Jerome Pouiller 2019-11-11 17:48 ` gregkh 2 siblings, 1 reply; 9+ messages in thread From: Jerome Pouiller @ 2019-11-11 17:04 UTC (permalink / raw) To: Jules Irenge; +Cc: gregkh, devel, linux-kernel On Monday 11 November 2019 14:30:53 CET Jules Irenge wrote: > CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe. > > > 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: Jules Irenge <jbi.octave@gmail.com> > --- > Changes > v1 had a spacing error > v2 fixes the error and includes all the changes related to this patch in > the driver. > > drivers/staging/wfx/bh.c | 2 +- > drivers/staging/wfx/data_tx.c | 10 +- > drivers/staging/wfx/data_tx.h | 18 +- > drivers/staging/wfx/hif_api_cmd.h | 498 ++++++++++++ +------------- > drivers/staging/wfx/hif_api_general.h | 212 +++++------ > drivers/staging/wfx/hif_api_mib.h | 477 ++++++++++++------------ > drivers/staging/wfx/hif_tx.c | 3 +- > drivers/staging/wfx/hif_tx.h | 7 +- > drivers/staging/wfx/hif_tx_mib.h | 2 +- > drivers/staging/wfx/key.c | 32 +- > drivers/staging/wfx/secure_link.h | 6 +- > drivers/staging/wfx/sta.c | 13 +- > drivers/staging/wfx/sta.h | 2 +- > drivers/staging/wfx/wfx.h | 10 +- > 14 files changed, 649 insertions(+), 643 deletions(-) > > diff --git a/drivers/staging/wfx/bh.c b/drivers/staging/wfx/bh.c > index 955ed3a1dd73..2432ba95c2f5 100644 > --- a/drivers/staging/wfx/bh.c > +++ b/drivers/staging/wfx/bh.c > @@ -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) > { > - uint32_t cfg_reg; > + u32 cfg_reg; > > config_reg_read(wdev, &cfg_reg); > if (cfg_reg & 0xFF) { > diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/ data_tx.c > index ea4205ac2149..b722e9773232 100644 > --- a/drivers/staging/wfx/data_tx.c > +++ b/drivers/staging/wfx/data_tx.c > @@ -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) { > int rateid; > - uint8_t count; > + u8 count; > > if (rates[i].idx < 0) > break; > @@ -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); > } > > -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_hdr *hdr) > { > @@ -542,11 +542,11 @@ static void wfx_tx_fixup_rates(struct ieee80211_tx_rate *rates) > 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) > { > bool tx_policy_renew = false; > - uint8_t rate_id; > + u8 rate_id; > > rate_id = wfx_tx_policy_get(wvif, > 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 > 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. > if (!ieee80211_is_data(hdr->frame_control)) > diff --git a/drivers/staging/wfx/data_tx.h b/drivers/staging/wfx/ data_tx.h > index f74d1988925d..29faa5640516 100644 > --- a/drivers/staging/wfx/data_tx.h > +++ b/drivers/staging/wfx/data_tx.h > @@ -31,17 +31,17 @@ enum wfx_link_status { > struct wfx_link_entry { > unsigned long timestamp; > enum wfx_link_status status; > - uint8_t mac[ETH_ALEN]; > - uint8_t old_mac[ETH_ALEN]; > - uint8_t buffered[WFX_MAX_TID]; > + u8 mac[ETH_ALEN]; > + u8 old_mac[ETH_ALEN]; > + u8 buffered[WFX_MAX_TID]; > struct sk_buff_head rx_queue; > }; > > struct tx_policy { > struct list_head link; > - uint8_t rates[12]; > - uint8_t usage_count; > - uint8_t uploaded; > + u8 rates[12]; > + u8 usage_count; > + u8 uploaded; > }; > > struct tx_policy_cache { > @@ -55,9 +55,9 @@ struct tx_policy_cache { > struct wfx_tx_priv { > ktime_t xmit_timestamp; > struct ieee80211_key_conf *hw_key; > - uint8_t link_id; > - uint8_t raw_link_id; > - uint8_t tid; > + u8 link_id; > + u8 raw_link_id; > + u8 tid; > } __packed; > > void wfx_tx_policy_init(struct wfx_vif *wvif); > diff --git a/drivers/staging/wfx/hif_api_cmd.h b/drivers/staging/wfx/ hif_api_cmd.h > index 7c5d1ea6098d..c15831de4ff4 100644 > --- a/drivers/staging/wfx/hif_api_cmd.h > +++ b/drivers/staging/wfx/hif_api_cmd.h > @@ -85,10 +85,10 @@ enum hif_status { > }; > > struct hif_reset_flags { > - uint8_t reset_stat:1; > - uint8_t reset_all_int:1; > - uint8_t reserved1:6; > - uint8_t reserved2[3]; > + u8 reset_stat:1; > + u8 reset_all_int:1; > + u8 reserved1:6; > + u8 reserved2[3]; > } __packed; > > struct hif_req_reset { > @@ -96,121 +96,121 @@ struct hif_req_reset { > } __packed; > > struct hif_cnf_reset { > - uint32_t status; > + u32 status; > } __packed; > > struct hif_req_read_mib { > - uint16_t mib_id; > - uint16_t reserved; > + u16 mib_id; > + u16 reserved; > } __packed; > > struct hif_cnf_read_mib { > - uint32_t status; > - uint16_t mib_id; > - uint16_t length; > - uint8_t mib_data[]; > + u32 status; > + u16 mib_id; > + u16 length; > + u8 mib_data[]; > } __packed; > > struct hif_req_write_mib { > - uint16_t mib_id; > - uint16_t length; > - uint8_t mib_data[]; > + u16 mib_id; > + u16 length; > + u8 mib_data[]; > } __packed; > > struct hif_cnf_write_mib { > - uint32_t status; > + u32 status; > } __packed; > > struct hif_ie_flags { > - uint8_t beacon:1; > - uint8_t probe_resp:1; > - uint8_t probe_req:1; > - uint8_t reserved1:5; > - uint8_t reserved2; > + u8 beacon:1; > + u8 probe_resp:1; > + u8 probe_req:1; > + u8 reserved1:5; > + u8 reserved2; > } __packed; > > struct hif_ie_tlv { > - uint8_t type; > - uint8_t length; > - uint8_t data[]; > + u8 type; > + u8 length; > + u8 data[]; > } __packed; > > struct hif_req_update_ie { > struct hif_ie_flags ie_flags; > - uint16_t num_i_es; > + u16 num_i_es; > struct hif_ie_tlv ie[]; > } __packed; > > struct hif_cnf_update_ie { > - uint32_t status; > + u32 status; > } __packed; > > struct hif_scan_type { > - uint8_t type:1; > - uint8_t mode:1; > - uint8_t reserved:6; > + u8 type:1; > + u8 mode:1; > + u8 reserved:6; > } __packed; > > struct hif_scan_flags { > - uint8_t fbg:1; > - uint8_t reserved1:1; > - uint8_t pre:1; > - uint8_t reserved2:5; > + u8 fbg:1; > + u8 reserved1:1; > + u8 pre:1; > + u8 reserved2:5; > } __packed; > > struct hif_auto_scan_param { > - uint16_t interval; > - uint8_t reserved; > - int8_t rssi_thr; > + u16 interval; > + u8 reserved; > + s8 rssi_thr; > } __packed; > > struct hif_ssid_def { > - uint32_t ssid_length; > - uint8_t ssid[HIF_API_SSID_SIZE]; > + u32 ssid_length; > + u8 ssid[HIF_API_SSID_SIZE]; > } __packed; > > #define HIF_API_MAX_NB_SSIDS 2 > #define HIF_API_MAX_NB_CHANNELS 14 > > struct hif_req_start_scan { > - uint8_t band; > + u8 band; > struct hif_scan_type scan_type; > struct hif_scan_flags scan_flags; > - uint8_t max_transmit_rate; > + u8 max_transmit_rate; > struct hif_auto_scan_param auto_scan_param; > - uint8_t num_of_probe_requests; > - uint8_t probe_delay; > - uint8_t num_of_ssi_ds; > - uint8_t num_of_channels; > - uint32_t min_channel_time; > - uint32_t max_channel_time; > - int32_t tx_power_level; > - uint8_t ssid_and_channel_lists[]; > + u8 num_of_probe_requests; > + u8 probe_delay; > + u8 num_of_ssi_ds; > + u8 num_of_channels; > + u32 min_channel_time; > + u32 max_channel_time; > + s32 tx_power_level; > + u8 ssid_and_channel_lists[]; > } __packed; > > struct hif_start_scan_req_cstnbssid_body { > - uint8_t band; > + u8 band; > struct hif_scan_type scan_type; > struct hif_scan_flags scan_flags; > - uint8_t max_transmit_rate; > + u8 max_transmit_rate; > struct hif_auto_scan_param auto_scan_param; > - uint8_t num_of_probe_requests; > - uint8_t probe_delay; > - uint8_t num_of_ssi_ds; > - uint8_t num_of_channels; > - uint32_t min_channel_time; > - uint32_t max_channel_time; > - int32_t tx_power_level; > + u8 num_of_probe_requests; > + u8 probe_delay; > + u8 num_of_ssi_ds; > + u8 num_of_channels; > + u32 min_channel_time; > + u32 max_channel_time; > + s32 tx_power_level; > struct hif_ssid_def ssid_def[HIF_API_MAX_NB_SSIDS]; > - uint8_t channel_list[]; > + u8 channel_list[]; > } __packed; > > struct hif_cnf_start_scan { > - uint32_t status; > + u32 status; > } __packed; > > struct hif_cnf_stop_scan { > - uint32_t status; > + u32 status; > } __packed; > > enum hif_pm_mode_status { > @@ -220,10 +220,10 @@ enum hif_pm_mode_status { > }; > > struct hif_ind_scan_cmpl { > - uint32_t status; > - uint8_t pm_mode; > - uint8_t num_channels_completed; > - uint16_t reserved; > + u32 status; > + u8 pm_mode; > + u8 num_channels_completed; > + u16 reserved; > } __packed; > > enum hif_queue_id { > @@ -245,45 +245,45 @@ enum hif_stbc { > }; > > struct hif_queue { > - uint8_t queue_id:2; > - uint8_t peer_sta_id:4; > - uint8_t reserved:2; > + u8 queue_id:2; > + u8 peer_sta_id:4; > + u8 reserved:2; > } __packed; > > struct hif_data_flags { > - uint8_t more:1; > - uint8_t fc_offset:3; > - uint8_t reserved:4; > + u8 more:1; > + u8 fc_offset:3; > + u8 reserved:4; > } __packed; > > struct hif_tx_flags { > - uint8_t start_exp:1; > - uint8_t reserved:3; > - uint8_t retry_policy_index:4; > + u8 start_exp:1; > + u8 reserved:3; > + u8 retry_policy_index:4; > } __packed; > > struct hif_ht_tx_parameters { > - uint8_t frame_format:4; > - uint8_t fec_coding:1; > - uint8_t short_gi:1; > - uint8_t reserved1:1; > - uint8_t stbc:1; > - uint8_t reserved2; > - uint8_t aggregation:1; > - uint8_t reserved3:7; > - uint8_t reserved4; > + u8 frame_format:4; > + u8 fec_coding:1; > + u8 short_gi:1; > + u8 reserved1:1; > + u8 stbc:1; > + u8 reserved2; > + u8 aggregation:1; > + u8 reserved3:7; > + u8 reserved4; > } __packed; > > struct hif_req_tx { > - uint32_t packet_id; > - uint8_t max_tx_rate; > + u32 packet_id; > + u8 max_tx_rate; > struct hif_queue queue_id; > struct hif_data_flags data_flags; > struct hif_tx_flags tx_flags; > - uint32_t reserved; > - uint32_t expire_time; > + u32 reserved; > + u32 expire_time; > struct hif_ht_tx_parameters ht_tx_parameters; > - uint8_t frame[]; > + u8 frame[]; > } __packed; > > enum hif_qos_ackplcy { > @@ -294,26 +294,26 @@ enum hif_qos_ackplcy { > }; > > struct hif_tx_result_flags { > - uint8_t aggr:1; > - uint8_t requeue:1; > - uint8_t ack_policy:2; > - uint8_t txop_limit:1; > - uint8_t reserved1:3; > - uint8_t reserved2; > + u8 aggr:1; > + u8 requeue:1; > + u8 ack_policy:2; > + u8 txop_limit:1; > + u8 reserved1:3; > + u8 reserved2; > } __packed; > > struct hif_cnf_tx { > - uint32_t status; > - uint32_t packet_id; > - uint8_t txed_rate; > - uint8_t ack_failures; > + u32 status; > + u32 packet_id; > + u8 txed_rate; > + u8 ack_failures; > struct hif_tx_result_flags tx_result_flags; > - uint32_t media_delay; > - uint32_t tx_queue_delay; > + u32 media_delay; > + u32 tx_queue_delay; > } __packed; > > struct hif_cnf_multi_transmit { > - uint32_t num_tx_confs; > + u32 num_tx_confs; > struct hif_cnf_tx tx_conf_payload[]; > } __packed; > > @@ -326,55 +326,55 @@ enum hif_ri_flags_encrypt { > }; > > struct hif_rx_flags { > - uint8_t encryp:3; > - uint8_t in_aggr:1; > - uint8_t first_aggr:1; > - uint8_t last_aggr:1; > - uint8_t defrag:1; > - uint8_t beacon:1; > - uint8_t tim:1; > - uint8_t bitmap:1; > - uint8_t match_ssid:1; > - uint8_t match_bssid:1; > - uint8_t more:1; > - uint8_t reserved1:1; > - uint8_t ht:1; > - uint8_t stbc:1; > - uint8_t match_uc_addr:1; > - uint8_t match_mc_addr:1; > - uint8_t match_bc_addr:1; > - uint8_t key_type:1; > - uint8_t key_index:4; > - uint8_t reserved2:1; > - uint8_t peer_sta_id:4; > - uint8_t reserved3:2; > - uint8_t reserved4:1; > + u8 encryp:3; > + u8 in_aggr:1; > + u8 first_aggr:1; > + u8 last_aggr:1; > + u8 defrag:1; > + u8 beacon:1; > + u8 tim:1; > + u8 bitmap:1; > + u8 match_ssid:1; > + u8 match_bssid:1; > + u8 more:1; > + u8 reserved1:1; > + u8 ht:1; > + u8 stbc:1; > + u8 match_uc_addr:1; > + u8 match_mc_addr:1; > + u8 match_bc_addr:1; > + u8 key_type:1; > + u8 key_index:4; > + u8 reserved2:1; > + u8 peer_sta_id:4; > + u8 reserved3:2; > + u8 reserved4:1; > } __packed; > > struct hif_ind_rx { > - uint32_t status; > - uint16_t channel_number; > - uint8_t rxed_rate; > - uint8_t rcpi_rssi; > + u32 status; > + u16 channel_number; > + u8 rxed_rate; > + u8 rcpi_rssi; > struct hif_rx_flags rx_flags; > - uint8_t frame[]; > + u8 frame[]; > } __packed; > > > struct hif_req_edca_queue_params { > - uint8_t queue_id; > - uint8_t reserved1; > - uint8_t aifsn; > - uint8_t reserved2; > - uint16_t cw_min; > - uint16_t cw_max; > - uint16_t tx_op_limit; > - uint16_t allowed_medium_time; > - uint32_t reserved3; > + u8 queue_id; > + u8 reserved1; > + u8 aifsn; > + u8 reserved2; > + u16 cw_min; > + u16 cw_max; > + u16 tx_op_limit; > + u16 allowed_medium_time; > + u32 reserved3; > } __packed; > > struct hif_cnf_edca_queue_params { > - uint32_t status; > + u32 status; > } __packed; > > enum hif_ap_mode { > @@ -389,92 +389,92 @@ enum hif_preamble { > }; > > struct hif_join_flags { > - uint8_t reserved1:2; > - uint8_t force_no_beacon:1; > - uint8_t force_with_ind:1; > - uint8_t reserved2:4; > + u8 reserved1:2; > + u8 force_no_beacon:1; > + u8 force_with_ind:1; > + u8 reserved2:4; > } __packed; > > struct hif_req_join { > - uint8_t mode; > - uint8_t band; > - uint16_t channel_number; > - uint8_t bssid[ETH_ALEN]; > - uint16_t atim_window; > - uint8_t preamble_type; > - uint8_t probe_for_join; > - uint8_t reserved; > + u8 mode; > + u8 band; > + u16 channel_number; > + u8 bssid[ETH_ALEN]; > + u16 atim_window; > + u8 preamble_type; > + u8 probe_for_join; > + u8 reserved; > struct hif_join_flags join_flags; > - uint32_t ssid_length; > - uint8_t ssid[HIF_API_SSID_SIZE]; > - uint32_t beacon_interval; > - uint32_t basic_rate_set; > + u32 ssid_length; > + u8 ssid[HIF_API_SSID_SIZE]; > + u32 beacon_interval; > + u32 basic_rate_set; > } __packed; > > struct hif_cnf_join { > - uint32_t status; > + u32 status; > } __packed; > > struct hif_ind_join_complete { > - uint32_t status; > + u32 status; > } __packed; > > struct hif_bss_flags { > - uint8_t lost_count_only:1; > - uint8_t reserved:7; > + u8 lost_count_only:1; > + u8 reserved:7; > } __packed; > > struct hif_req_set_bss_params { > struct hif_bss_flags bss_flags; > - uint8_t beacon_lost_count; > - uint16_t aid; > - uint32_t operational_rate_set; > + u8 beacon_lost_count; > + u16 aid; > + u32 operational_rate_set; > } __packed; > > struct hif_cnf_set_bss_params { > - uint32_t status; > + u32 status; > } __packed; > > struct hif_pm_mode { > - uint8_t enter_psm:1; > - uint8_t reserved:6; > - uint8_t fast_psm:1; > + u8 enter_psm:1; > + u8 reserved:6; > + u8 fast_psm:1; > } __packed; > > struct hif_req_set_pm_mode { > struct hif_pm_mode pm_mode; > - uint8_t fast_psm_idle_period; > - uint8_t ap_psm_change_period; > - uint8_t min_auto_ps_poll_period; > + u8 fast_psm_idle_period; > + u8 ap_psm_change_period; > + u8 min_auto_ps_poll_period; > } __packed; > > struct hif_cnf_set_pm_mode { > - uint32_t status; > + u32 status; > } __packed; > > struct hif_ind_set_pm_mode_cmpl { > - uint32_t status; > - uint8_t pm_mode; > - uint8_t reserved[3]; > + u32 status; > + u8 pm_mode; > + u8 reserved[3]; > } __packed; > > > struct hif_req_start { > - uint8_t mode; > - uint8_t band; > - uint16_t channel_number; > - uint32_t reserved1; > - uint32_t beacon_interval; > - uint8_t dtim_period; > - uint8_t preamble_type; > - uint8_t reserved2; > - uint8_t ssid_length; > - uint8_t ssid[HIF_API_SSID_SIZE]; > - uint32_t basic_rate_set; > + u8 mode; > + u8 band; > + u16 channel_number; > + u32 reserved1; > + u32 beacon_interval; > + u8 dtim_period; > + u8 preamble_type; > + u8 reserved2; > + u8 ssid_length; > + u8 ssid[HIF_API_SSID_SIZE]; > + u32 basic_rate_set; > } __packed; > > struct hif_cnf_start { > - uint32_t status; > + u32 status; > } __packed; > > enum hif_beacon { > @@ -483,12 +483,12 @@ enum hif_beacon { > }; > > struct hif_req_beacon_transmit { > - uint8_t enable_beaconing; > - uint8_t reserved[3]; > + u8 enable_beaconing; > + u8 reserved[3]; > } __packed; > > struct hif_cnf_beacon_transmit { > - uint32_t status; > + u32 status; > } __packed; > > enum hif_sta_map_direction { > @@ -497,32 +497,32 @@ enum hif_sta_map_direction { > }; > > struct hif_map_link_flags { > - uint8_t map_direction:1; > - uint8_t mfpc:1; > - uint8_t reserved:6; > + u8 map_direction:1; > + u8 mfpc:1; > + u8 reserved:6; > } __packed; > > struct hif_req_map_link { > - uint8_t mac_addr[ETH_ALEN]; > + u8 mac_addr[ETH_ALEN]; > struct hif_map_link_flags map_link_flags; > - uint8_t peer_sta_id; > + u8 peer_sta_id; > } __packed; > > struct hif_cnf_map_link { > - uint32_t status; > + u32 status; > } __packed; > > struct hif_suspend_resume_flags { > - uint8_t resume:1; > - uint8_t reserved1:2; > - uint8_t bc_mc_only:1; > - uint8_t reserved2:4; > - uint8_t reserved3; > + u8 resume:1; > + u8 reserved1:2; > + u8 bc_mc_only:1; > + u8 reserved2:4; > + u8 reserved3; > } __packed; > > struct hif_ind_suspend_resume_tx { > struct hif_suspend_resume_flags suspend_resume_flags; > - uint16_t peer_sta_set; > + u16 peer_sta_set; > } __packed; > > > @@ -552,68 +552,68 @@ enum hif_key_type { > }; > > struct hif_wep_pairwise_key { > - uint8_t peer_address[ETH_ALEN]; > - uint8_t reserved; > - uint8_t key_length; > - uint8_t key_data[HIF_API_WEP_KEY_DATA_SIZE]; > + u8 peer_address[ETH_ALEN]; > + u8 reserved; > + u8 key_length; > + u8 key_data[HIF_API_WEP_KEY_DATA_SIZE]; > } __packed; > > struct hif_wep_group_key { > - uint8_t key_id; > - uint8_t key_length; > - uint8_t reserved[2]; > - uint8_t key_data[HIF_API_WEP_KEY_DATA_SIZE]; > + u8 key_id; > + u8 key_length; > + u8 reserved[2]; > + u8 key_data[HIF_API_WEP_KEY_DATA_SIZE]; > } __packed; > > struct hif_tkip_pairwise_key { > - uint8_t peer_address[ETH_ALEN]; > - uint8_t reserved[2]; > - uint8_t tkip_key_data[HIF_API_TKIP_KEY_DATA_SIZE]; > - uint8_t rx_mic_key[HIF_API_RX_MIC_KEY_SIZE]; > - uint8_t tx_mic_key[HIF_API_TX_MIC_KEY_SIZE]; > + u8 peer_address[ETH_ALEN]; > + u8 reserved[2]; > + u8 tkip_key_data[HIF_API_TKIP_KEY_DATA_SIZE]; > + u8 rx_mic_key[HIF_API_RX_MIC_KEY_SIZE]; > + u8 tx_mic_key[HIF_API_TX_MIC_KEY_SIZE]; > } __packed; > > struct hif_tkip_group_key { > - uint8_t tkip_key_data[HIF_API_TKIP_KEY_DATA_SIZE]; > - uint8_t rx_mic_key[HIF_API_RX_MIC_KEY_SIZE]; > - uint8_t key_id; > - uint8_t reserved[3]; > - uint8_t rx_sequence_counter[HIF_API_RX_SEQUENCE_COUNTER_SIZE]; > + u8 tkip_key_data[HIF_API_TKIP_KEY_DATA_SIZE]; > + u8 rx_mic_key[HIF_API_RX_MIC_KEY_SIZE]; > + u8 key_id; > + u8 reserved[3]; > + u8 rx_sequence_counter[HIF_API_RX_SEQUENCE_COUNTER_SIZE]; > } __packed; > > struct hif_aes_pairwise_key { > - uint8_t peer_address[ETH_ALEN]; > - uint8_t reserved[2]; > - uint8_t aes_key_data[HIF_API_AES_KEY_DATA_SIZE]; > + u8 peer_address[ETH_ALEN]; > + u8 reserved[2]; > + u8 aes_key_data[HIF_API_AES_KEY_DATA_SIZE]; > } __packed; > > struct hif_aes_group_key { > - uint8_t aes_key_data[HIF_API_AES_KEY_DATA_SIZE]; > - uint8_t key_id; > - uint8_t reserved[3]; > - uint8_t rx_sequence_counter[HIF_API_RX_SEQUENCE_COUNTER_SIZE]; > + u8 aes_key_data[HIF_API_AES_KEY_DATA_SIZE]; > + u8 key_id; > + u8 reserved[3]; > + u8 rx_sequence_counter[HIF_API_RX_SEQUENCE_COUNTER_SIZE]; > } __packed; > > struct hif_wapi_pairwise_key { > - uint8_t peer_address[ETH_ALEN]; > - uint8_t key_id; > - uint8_t reserved; > - uint8_t wapi_key_data[HIF_API_WAPI_KEY_DATA_SIZE]; > - uint8_t mic_key_data[HIF_API_MIC_KEY_DATA_SIZE]; > + u8 peer_address[ETH_ALEN]; > + u8 key_id; > + u8 reserved; > + u8 wapi_key_data[HIF_API_WAPI_KEY_DATA_SIZE]; > + u8 mic_key_data[HIF_API_MIC_KEY_DATA_SIZE]; > } __packed; > > struct hif_wapi_group_key { > - uint8_t wapi_key_data[HIF_API_WAPI_KEY_DATA_SIZE]; > - uint8_t mic_key_data[HIF_API_MIC_KEY_DATA_SIZE]; > - uint8_t key_id; > - uint8_t reserved[3]; > + u8 wapi_key_data[HIF_API_WAPI_KEY_DATA_SIZE]; > + u8 mic_key_data[HIF_API_MIC_KEY_DATA_SIZE]; > + u8 key_id; > + u8 reserved[3]; > } __packed; > > struct hif_igtk_group_key { > - uint8_t igtk_key_data[HIF_API_IGTK_KEY_DATA_SIZE]; > - uint8_t key_id; > - uint8_t reserved[3]; > - uint8_t ipn[HIF_API_IPN_SIZE]; > + u8 igtk_key_data[HIF_API_IGTK_KEY_DATA_SIZE]; > + u8 key_id; > + u8 reserved[3]; > + u8 ipn[HIF_API_IPN_SIZE]; > } __packed; > > union hif_privacy_key_data { > @@ -629,25 +629,25 @@ union hif_privacy_key_data { > }; > > struct hif_req_add_key { > - uint8_t type; > - uint8_t entry_index; > - uint8_t int_id:2; > - uint8_t reserved1:6; > - uint8_t reserved2; > + u8 type; > + u8 entry_index; > + u8 int_id:2; > + u8 reserved1:6; > + u8 reserved2; > union hif_privacy_key_data key; > } __packed; > > struct hif_cnf_add_key { > - uint32_t status; > + u32 status; > } __packed; > > struct hif_req_remove_key { > - uint8_t entry_index; > - uint8_t reserved[3]; > + u8 entry_index; > + u8 reserved[3]; > } __packed; > > struct hif_cnf_remove_key { > - uint32_t status; > + u32 status; > } __packed; > > enum hif_event_ind { > @@ -667,13 +667,13 @@ enum hif_ps_mode_error { > }; > > union hif_event_data { > - uint8_t rcpi_rssi; > - uint32_t ps_mode_error; > - uint32_t peer_sta_set; > + u8 rcpi_rssi; > + u32 ps_mode_error; > + u32 peer_sta_set; > }; > > struct hif_ind_event { > - uint32_t event_id; > + u32 event_id; > union hif_event_data event_data; > } __packed; > > diff --git a/drivers/staging/wfx/hif_api_general.h b/drivers/staging/ wfx/hif_api_general.h > index d885b55d2882..a069c3a21b4d 100644 > --- a/drivers/staging/wfx/hif_api_general.h > +++ b/drivers/staging/wfx/hif_api_general.h > @@ -23,13 +23,13 @@ > #define HIF_COUNTER_MAX 7 > > struct hif_msg { > - uint16_t len; > - uint8_t id; > - uint8_t reserved:1; > - uint8_t interface:2; > - uint8_t seqnum:3; > - uint8_t encrypted:2; > - uint8_t body[]; > + u16 len; > + u8 id; > + u8 reserved:1; > + u8 interface:2; > + u8 seqnum:3; > + u8 encrypted:2; > + u8 body[]; > } __packed; > > enum hif_general_requests_ids { > @@ -117,22 +117,22 @@ enum hif_fw_type { > }; > > struct hif_capabilities { > - uint8_t link_mode:2; > - uint8_t reserved1:6; > - uint8_t reserved2; > - uint8_t reserved3; > - uint8_t reserved4; > + u8 link_mode:2; > + u8 reserved1:6; > + u8 reserved2; > + u8 reserved3; > + u8 reserved4; > } __packed; > > struct hif_otp_regul_sel_mode_info { > - uint8_t region_sel_mode:4; > - uint8_t reserved:4; > + u8 region_sel_mode:4; > + u8 reserved:4; > } __packed; > > struct hif_otp_phy_info { > - uint8_t phy1_region:3; > - uint8_t phy0_region:3; > - uint8_t otp_phy_ver:2; > + u8 phy1_region:3; > + u8 phy0_region:3; > + u8 otp_phy_ver:2; > } __packed; > > #define API_OPN_SIZE 14 > @@ -141,39 +141,39 @@ struct hif_otp_phy_info { > #define API_FIRMWARE_LABEL_SIZE 128 > > struct hif_ind_startup { > - uint32_t status; > - uint16_t hardware_id; > - uint8_t opn[API_OPN_SIZE]; > - uint8_t uid[API_UID_SIZE]; > - uint16_t num_inp_ch_bufs; > - uint16_t size_inp_ch_buf; > - uint8_t num_links_ap; > - uint8_t num_interfaces; > - uint8_t mac_addr[2][ETH_ALEN]; > - uint8_t api_version_minor; > - uint8_t api_version_major; > + u32 status; > + u16 hardware_id; > + u8 opn[API_OPN_SIZE]; > + u8 uid[API_UID_SIZE]; > + u16 num_inp_ch_bufs; > + u16 size_inp_ch_buf; > + u8 num_links_ap; > + u8 num_interfaces; > + u8 mac_addr[2][ETH_ALEN]; > + u8 api_version_minor; > + u8 api_version_major; > struct hif_capabilities capabilities; > - uint8_t firmware_build; > - uint8_t firmware_minor; > - uint8_t firmware_major; > - uint8_t firmware_type; > - uint8_t disabled_channel_list[API_DISABLED_CHANNEL_LIST_SIZE]; > + u8 firmware_build; > + u8 firmware_minor; > + u8 firmware_major; > + u8 firmware_type; > + u8 disabled_channel_list[API_DISABLED_CHANNEL_LIST_SIZE]; > struct hif_otp_regul_sel_mode_info regul_sel_mode_info; > struct hif_otp_phy_info otp_phy_info; > - uint32_t supported_rate_mask; > - uint8_t firmware_label[API_FIRMWARE_LABEL_SIZE]; > + u32 supported_rate_mask; > + u8 firmware_label[API_FIRMWARE_LABEL_SIZE]; > } __packed; > > struct hif_ind_wakeup { > } __packed; > > struct hif_req_configuration { > - uint16_t length; > - uint8_t pds_data[]; > + u16 length; > + u8 pds_data[]; > } __packed; > > struct hif_cnf_configuration { > - uint32_t status; > + u32 status; > } __packed; > > enum hif_gpio_mode { > @@ -187,8 +187,8 @@ enum hif_gpio_mode { > }; > > struct hif_req_control_gpio { > - uint8_t gpio_label; > - uint8_t gpio_mode; > + u8 gpio_label; > + u8 gpio_mode; > } __packed; > > enum hif_gpio_error { > @@ -198,8 +198,8 @@ enum hif_gpio_error { > }; > > struct hif_cnf_control_gpio { > - uint32_t status; > - uint32_t value; > + u32 status; > + u32 value; > } __packed; > > enum hif_generic_indication_type { > @@ -209,28 +209,28 @@ enum hif_generic_indication_type { > }; > > struct hif_rx_stats { > - uint32_t nb_rx_frame; > - uint32_t nb_crc_frame; > - uint32_t per_total; > - uint32_t throughput; > - uint32_t nb_rx_by_rate[API_RATE_NUM_ENTRIES]; > - uint16_t per[API_RATE_NUM_ENTRIES]; > - int16_t snr[API_RATE_NUM_ENTRIES]; > - int16_t rssi[API_RATE_NUM_ENTRIES]; > - int16_t cfo[API_RATE_NUM_ENTRIES]; > - uint32_t date; > - uint32_t pwr_clk_freq; > - uint8_t is_ext_pwr_clk; > - int8_t current_temp; > + u32 nb_rx_frame; > + u32 nb_crc_frame; > + u32 per_total; > + u32 throughput; > + u32 nb_rx_by_rate[API_RATE_NUM_ENTRIES]; > + u16 per[API_RATE_NUM_ENTRIES]; > + s16 snr[API_RATE_NUM_ENTRIES]; > + s16 rssi[API_RATE_NUM_ENTRIES]; > + s16 cfo[API_RATE_NUM_ENTRIES]; > + u32 date; > + u32 pwr_clk_freq; > + u8 is_ext_pwr_clk; > + s8 current_temp; > } __packed; > > union hif_indication_data { > struct hif_rx_stats rx_stats; > - uint8_t raw_data[1]; > + u8 raw_data[1]; > }; > > struct hif_ind_generic { > - uint32_t indication_type; > + u32 indication_type; > union hif_indication_data indication_data; > } __packed; > > @@ -238,7 +238,7 @@ struct hif_ind_generic { > #define HIF_EXCEPTION_DATA_SIZE 124 > > struct hif_ind_exception { > - uint8_t data[HIF_EXCEPTION_DATA_SIZE]; > + u8 data[HIF_EXCEPTION_DATA_SIZE]; > } __packed; > > > @@ -257,8 +257,8 @@ enum hif_error { > }; > > struct hif_ind_error { > - uint32_t type; > - uint8_t data[]; > + u32 type; > + u8 data[]; > } __packed; > > enum hif_secure_link_state { > @@ -276,20 +276,20 @@ enum hif_sl_encryption_type { > }; > > struct hif_sl_msg_hdr { > - uint32_t seqnum:30; > - uint32_t encrypted:2; > + u32 seqnum:30; > + u32 encrypted:2; > } __packed; > > struct hif_sl_msg { > struct hif_sl_msg_hdr hdr; > - uint16_t len; > - uint8_t payload[]; > + u16 len; > + u8 payload[]; > } __packed; > > #define AES_CCM_TAG_SIZE 16 > > struct hif_sl_tag { > - uint8_t tag[16]; > + u8 tag[16]; > } __packed; > > enum hif_sl_mac_key_dest { > @@ -300,12 +300,12 @@ enum hif_sl_mac_key_dest { > #define API_KEY_VALUE_SIZE 32 > > struct hif_req_set_sl_mac_key { > - uint8_t otp_or_ram; > - uint8_t key_value[API_KEY_VALUE_SIZE]; > + u8 otp_or_ram; > + u8 key_value[API_KEY_VALUE_SIZE]; > } __packed; > > struct hif_cnf_set_sl_mac_key { > - uint32_t status; > + u32 status; > } __packed; > > #define API_HOST_PUB_KEY_SIZE 32 > @@ -317,45 +317,45 @@ enum hif_sl_session_key_alg { > }; > > struct hif_req_sl_exchange_pub_keys { > - uint8_t algorithm:2; > - uint8_t reserved1:6; > - uint8_t reserved2[3]; > - uint8_t host_pub_key[API_HOST_PUB_KEY_SIZE]; > - uint8_t host_pub_key_mac[API_HOST_PUB_KEY_MAC_SIZE]; > + u8 algorithm:2; > + u8 reserved1:6; > + u8 reserved2[3]; > + u8 host_pub_key[API_HOST_PUB_KEY_SIZE]; > + u8 host_pub_key_mac[API_HOST_PUB_KEY_MAC_SIZE]; > } __packed; > > struct hif_cnf_sl_exchange_pub_keys { > - uint32_t status; > + u32 status; > } __packed; > > #define API_NCP_PUB_KEY_SIZE 32 > #define API_NCP_PUB_KEY_MAC_SIZE 64 > > struct hif_ind_sl_exchange_pub_keys { > - uint32_t status; > - uint8_t ncp_pub_key[API_NCP_PUB_KEY_SIZE]; > - uint8_t ncp_pub_key_mac[API_NCP_PUB_KEY_MAC_SIZE]; > + u32 status; > + u8 ncp_pub_key[API_NCP_PUB_KEY_SIZE]; > + u8 ncp_pub_key_mac[API_NCP_PUB_KEY_MAC_SIZE]; > } __packed; > > #define API_ENCR_BMP_SIZE 32 > > struct hif_req_sl_configure { > - uint8_t encr_bmp[API_ENCR_BMP_SIZE]; > - uint8_t disable_session_key_protection:1; > - uint8_t reserved1:7; > - uint8_t reserved2[3]; > + u8 encr_bmp[API_ENCR_BMP_SIZE]; > + u8 disable_session_key_protection:1; > + u8 reserved1:7; > + u8 reserved2[3]; > } __packed; > > struct hif_cnf_sl_configure { > - uint32_t status; > + u32 status; > } __packed; > > struct hif_req_prevent_rollback { > - uint32_t magic_word; > + u32 magic_word; > } __packed; > > struct hif_cnf_prevent_rollback { > - uint32_t status; > + u32 status; > } __packed; > > enum hif_pta_mode { > @@ -382,27 +382,27 @@ enum hif_grant_state { > }; > > struct hif_req_pta_settings { > - uint8_t pta_mode; > - uint8_t request_signal_active_level; > - uint8_t priority_signal_active_level; > - uint8_t freq_signal_active_level; > - uint8_t grant_signal_active_level; > - uint8_t coex_type; > - uint8_t default_grant_state; > - uint8_t simultaneous_rx_accesses; > - uint8_t priority_sampling_time; > - uint8_t tx_rx_sampling_time; > - uint8_t freq_sampling_time; > - uint8_t grant_valid_time; > - uint8_t fem_control_time; > - uint8_t first_slot_time; > - uint16_t periodic_tx_rx_sampling_time; > - uint16_t coex_quota; > - uint16_t wlan_quota; > + u8 pta_mode; > + u8 request_signal_active_level; > + u8 priority_signal_active_level; > + u8 freq_signal_active_level; > + u8 grant_signal_active_level; > + u8 coex_type; > + u8 default_grant_state; > + u8 simultaneous_rx_accesses; > + u8 priority_sampling_time; > + u8 tx_rx_sampling_time; > + u8 freq_sampling_time; > + u8 grant_valid_time; > + u8 fem_control_time; > + u8 first_slot_time; > + u16 periodic_tx_rx_sampling_time; > + u16 coex_quota; > + u16 wlan_quota; > } __packed; > > struct hif_cnf_pta_settings { > - uint32_t status; > + u32 status; > } __packed; > > enum hif_pta_priority { > @@ -414,11 +414,11 @@ enum hif_pta_priority { > }; > > struct hif_req_pta_priority { > - uint32_t priority; > + u32 priority; > } __packed; > > struct hif_cnf_pta_priority { > - uint32_t status; > + u32 status; > } __packed; > > enum hif_pta_state { > @@ -427,11 +427,11 @@ enum hif_pta_state { > }; > > struct hif_req_pta_state { > - uint32_t pta_state; > + u32 pta_state; > } __packed; > > struct hif_cnf_pta_state { > - uint32_t status; > + u32 status; > } __packed; > > #endif > diff --git a/drivers/staging/wfx/hif_api_mib.h b/drivers/staging/wfx/ hif_api_mib.h > index af657555f894..94b789ceb4ff 100644 > --- a/drivers/staging/wfx/hif_api_mib.h > +++ b/drivers/staging/wfx/hif_api_mib.h > @@ -72,23 +72,23 @@ enum hif_op_power_mode { > }; > > struct hif_mib_gl_operational_power_mode { > - uint8_t power_mode:4; > - uint8_t reserved1:3; > - uint8_t wup_ind_activation:1; > - uint8_t reserved2[3]; > + u8 power_mode:4; > + u8 reserved1:3; > + u8 wup_ind_activation:1; > + u8 reserved2[3]; > } __packed; > > struct hif_mib_gl_block_ack_info { > - uint8_t rx_buffer_size; > - uint8_t rx_max_num_agreements; > - uint8_t tx_buffer_size; > - uint8_t tx_max_num_agreements; > + u8 rx_buffer_size; > + u8 rx_max_num_agreements; > + u8 tx_buffer_size; > + u8 tx_max_num_agreements; > } __packed; > > struct hif_mib_gl_set_multi_msg { > - uint8_t enable_multi_tx_conf:1; > - uint8_t reserved1:7; > - uint8_t reserved2[3]; > + u8 enable_multi_tx_conf:1; > + u8 reserved1:7; > + u8 reserved2[3]; > } __packed; > > enum hif_cca_thr_mode { > @@ -97,8 +97,8 @@ enum hif_cca_thr_mode { > }; > > struct hif_mib_gl_cca_config { > - uint8_t cca_thr_mode; > - uint8_t reserved[3]; > + u8 cca_thr_mode; > + u8 reserved[3]; > } __packed; > > #define MAX_NUMBER_DATA_FILTERS 0xA > @@ -114,9 +114,9 @@ struct hif_mib_gl_cca_config { > #define MAX_NUMBER_NS_CONDITIONS 0x2 > > struct hif_mib_ethertype_data_frame_condition { > - uint8_t condition_idx; > - uint8_t reserved; > - uint16_t ether_type; > + u8 condition_idx; > + u8 reserved; > + u16 ether_type; > } __packed; > > enum hif_udp_tcp_protocol { > @@ -132,22 +132,22 @@ enum hif_which_port { > }; > > struct hif_mib_ports_data_frame_condition { > - uint8_t condition_idx; > - uint8_t protocol; > - uint8_t which_port; > - uint8_t reserved1; > - uint16_t port_number; > - uint8_t reserved2[2]; > + u8 condition_idx; > + u8 protocol; > + u8 which_port; > + u8 reserved1; > + u16 port_number; > + u8 reserved2[2]; > } __packed; > > #define HIF_API_MAGIC_PATTERN_SIZE 32 > > struct hif_mib_magic_data_frame_condition { > - uint8_t condition_idx; > - uint8_t offset; > - uint8_t magic_pattern_length; > - uint8_t reserved; > - uint8_t magic_pattern[HIF_API_MAGIC_PATTERN_SIZE]; > + u8 condition_idx; > + u8 offset; > + u8 magic_pattern_length; > + u8 reserved; > + u8 magic_pattern[HIF_API_MAGIC_PATTERN_SIZE]; > } __packed; > > enum hif_mac_addr_type { > @@ -157,9 +157,9 @@ enum hif_mac_addr_type { > }; > > struct hif_mib_mac_addr_data_frame_condition { > - uint8_t condition_idx; > - uint8_t address_type; > - uint8_t mac_address[ETH_ALEN]; > + u8 condition_idx; > + u8 address_type; > + u8 mac_address[ETH_ALEN]; > } __packed; > > enum hif_ip_addr_mode { > @@ -168,53 +168,53 @@ enum hif_ip_addr_mode { > }; > > struct hif_mib_ipv4_addr_data_frame_condition { > - uint8_t condition_idx; > - uint8_t address_mode; > - uint8_t reserved[2]; > - uint8_t i_pv4_address[HIF_API_IPV4_ADDRESS_SIZE]; > + u8 condition_idx; > + u8 address_mode; > + u8 reserved[2]; > + u8 i_pv4_address[HIF_API_IPV4_ADDRESS_SIZE]; > } __packed; > > struct hif_mib_ipv6_addr_data_frame_condition { > - uint8_t condition_idx; > - uint8_t address_mode; > - uint8_t reserved[2]; > - uint8_t i_pv6_address[HIF_API_IPV6_ADDRESS_SIZE]; > + u8 condition_idx; > + u8 address_mode; > + u8 reserved[2]; > + u8 i_pv6_address[HIF_API_IPV6_ADDRESS_SIZE]; > } __packed; > > union hif_addr_type { > - uint8_t value; > + u8 value; > struct { > - uint8_t type_unicast:1; > - uint8_t type_multicast:1; > - uint8_t type_broadcast:1; > - uint8_t reserved:5; > + u8 type_unicast:1; > + u8 type_multicast:1; > + u8 type_broadcast:1; > + u8 reserved:5; > } bits; > }; > > struct hif_mib_uc_mc_bc_data_frame_condition { > - uint8_t condition_idx; > + u8 condition_idx; > union hif_addr_type param; > - uint8_t reserved[2]; > + u8 reserved[2]; > } __packed; > > struct hif_mib_config_data_filter { > - uint8_t filter_idx; > - uint8_t enable; > - uint8_t reserved1[2]; > - uint8_t eth_type_cond; > - uint8_t port_cond; > - uint8_t magic_cond; > - uint8_t mac_cond; > - uint8_t ipv4_cond; > - uint8_t ipv6_cond; > - uint8_t uc_mc_bc_cond; > - uint8_t reserved2; > + u8 filter_idx; > + u8 enable; > + u8 reserved1[2]; > + u8 eth_type_cond; > + u8 port_cond; > + u8 magic_cond; > + u8 mac_cond; > + u8 ipv4_cond; > + u8 ipv6_cond; > + u8 uc_mc_bc_cond; > + u8 reserved2; > } __packed; > > struct hif_mib_set_data_filtering { > - uint8_t default_filter; > - uint8_t enable; > - uint8_t reserved[2]; > + u8 default_filter; > + u8 enable; > + u8 reserved[2]; > } __packed; > > enum hif_arp_ns_frame_treatment { > @@ -224,45 +224,45 @@ enum hif_arp_ns_frame_treatment { > }; > > struct hif_mib_arp_ip_addr_table { > - uint8_t condition_idx; > - uint8_t arp_enable; > - uint8_t reserved[2]; > - uint8_t ipv4_address[HIF_API_IPV4_ADDRESS_SIZE]; > + u8 condition_idx; > + u8 arp_enable; > + u8 reserved[2]; > + u8 ipv4_address[HIF_API_IPV4_ADDRESS_SIZE]; > } __packed; > > struct hif_mib_ns_ip_addr_table { > - uint8_t condition_idx; > - uint8_t ns_enable; > - uint8_t reserved[2]; > - uint8_t ipv6_address[HIF_API_IPV6_ADDRESS_SIZE]; > + u8 condition_idx; > + u8 ns_enable; > + u8 reserved[2]; > + u8 ipv6_address[HIF_API_IPV6_ADDRESS_SIZE]; > } __packed; > > struct hif_mib_rx_filter { > - uint8_t reserved1:1; > - uint8_t bssid_filter:1; > - uint8_t reserved2:1; > - uint8_t fwd_probe_req:1; > - uint8_t keep_alive_filter:1; > - uint8_t reserved3:3; > - uint8_t reserved4[3]; > + u8 reserved1:1; > + u8 bssid_filter:1; > + u8 reserved2:1; > + u8 fwd_probe_req:1; > + u8 keep_alive_filter:1; > + u8 reserved3:3; > + u8 reserved4[3]; > } __packed; > > #define HIF_API_OUI_SIZE 3 > #define HIF_API_MATCH_DATA_SIZE 3 > > struct hif_ie_table_entry { > - uint8_t ie_id; > - uint8_t has_changed:1; > - uint8_t no_longer:1; > - uint8_t has_appeared:1; > - uint8_t reserved:1; > - uint8_t num_match_data:4; > - uint8_t oui[HIF_API_OUI_SIZE]; > - uint8_t match_data[HIF_API_MATCH_DATA_SIZE]; > + u8 ie_id; > + u8 has_changed:1; > + u8 no_longer:1; > + u8 has_appeared:1; > + u8 reserved:1; > + u8 num_match_data:4; > + u8 oui[HIF_API_OUI_SIZE]; > + u8 match_data[HIF_API_MATCH_DATA_SIZE]; > } __packed; > > struct hif_mib_bcn_filter_table { > - uint32_t num_of_info_elmts; > + u32 num_of_info_elmts; > struct hif_ie_table_entry ie_table[]; > } __packed; > > @@ -273,126 +273,126 @@ enum hif_beacon_filter { > }; > > struct hif_mib_bcn_filter_enable { > - uint32_t enable; > - uint32_t bcn_count; > + u32 enable; > + u32 bcn_count; > } __packed; > > struct hif_mib_group_seq_counter { > - uint32_t bits4716; > - uint16_t bits1500; > - uint16_t reserved; > + u32 bits4716; > + u16 bits1500; > + u16 reserved; > } __packed; > > struct hif_mib_tsf_counter { > - uint32_t tsf_counterlo; > - uint32_t tsf_counterhi; > + u32 tsf_counterlo; > + u32 tsf_counterhi; > } __packed; > > struct hif_mib_stats_table { > - int16_t latest_snr; > - uint8_t latest_rcpi; > - int8_t latest_rssi; > + s16 latest_snr; > + u8 latest_rcpi; > + s8 latest_rssi; > } __packed; > > struct hif_mib_extended_count_table { > - uint32_t count_plcp_errors; > - uint32_t count_fcs_errors; > - uint32_t count_tx_packets; > - uint32_t count_rx_packets; > - uint32_t count_rx_packet_errors; > - uint32_t count_rx_decryption_failures; > - uint32_t count_rx_mic_failures; > - uint32_t count_rx_no_key_failures; > - uint32_t count_tx_multicast_frames; > - uint32_t count_tx_frames_success; > - uint32_t count_tx_frame_failures; > - uint32_t count_tx_frames_retried; > - uint32_t count_tx_frames_multi_retried; > - uint32_t count_rx_frame_duplicates; > - uint32_t count_rts_success; > - uint32_t count_rts_failures; > - uint32_t count_ack_failures; > - uint32_t count_rx_multicast_frames; > - uint32_t count_rx_frames_success; > - uint32_t count_rx_cmacicv_errors; > - uint32_t count_rx_cmac_replays; > - uint32_t count_rx_mgmt_ccmp_replays; > - uint32_t count_rx_bipmic_errors; > - uint32_t count_rx_beacon; > - uint32_t count_miss_beacon; > - uint32_t reserved[15]; > + u32 count_plcp_errors; > + u32 count_fcs_errors; > + u32 count_tx_packets; > + u32 count_rx_packets; > + u32 count_rx_packet_errors; > + u32 count_rx_decryption_failures; > + u32 count_rx_mic_failures; > + u32 count_rx_no_key_failures; > + u32 count_tx_multicast_frames; > + u32 count_tx_frames_success; > + u32 count_tx_frame_failures; > + u32 count_tx_frames_retried; > + u32 count_tx_frames_multi_retried; > + u32 count_rx_frame_duplicates; > + u32 count_rts_success; > + u32 count_rts_failures; > + u32 count_ack_failures; > + u32 count_rx_multicast_frames; > + u32 count_rx_frames_success; > + u32 count_rx_cmacicv_errors; > + u32 count_rx_cmac_replays; > + u32 count_rx_mgmt_ccmp_replays; > + u32 count_rx_bipmic_errors; > + u32 count_rx_beacon; > + u32 count_miss_beacon; > + u32 reserved[15]; > } __packed; > > struct hif_mib_count_table { > - uint32_t count_plcp_errors; > - uint32_t count_fcs_errors; > - uint32_t count_tx_packets; > - uint32_t count_rx_packets; > - uint32_t count_rx_packet_errors; > - uint32_t count_rx_decryption_failures; > - uint32_t count_rx_mic_failures; > - uint32_t count_rx_no_key_failures; > - uint32_t count_tx_multicast_frames; > - uint32_t count_tx_frames_success; > - uint32_t count_tx_frame_failures; > - uint32_t count_tx_frames_retried; > - uint32_t count_tx_frames_multi_retried; > - uint32_t count_rx_frame_duplicates; > - uint32_t count_rts_success; > - uint32_t count_rts_failures; > - uint32_t count_ack_failures; > - uint32_t count_rx_multicast_frames; > - uint32_t count_rx_frames_success; > - uint32_t count_rx_cmacicv_errors; > - uint32_t count_rx_cmac_replays; > - uint32_t count_rx_mgmt_ccmp_replays; > - uint32_t count_rx_bipmic_errors; > + u32 count_plcp_errors; > + u32 count_fcs_errors; > + u32 count_tx_packets; > + u32 count_rx_packets; > + u32 count_rx_packet_errors; > + u32 count_rx_decryption_failures; > + u32 count_rx_mic_failures; > + u32 count_rx_no_key_failures; > + u32 count_tx_multicast_frames; > + u32 count_tx_frames_success; > + u32 count_tx_frame_failures; > + u32 count_tx_frames_retried; > + u32 count_tx_frames_multi_retried; > + u32 count_rx_frame_duplicates; > + u32 count_rts_success; > + u32 count_rts_failures; > + u32 count_ack_failures; > + u32 count_rx_multicast_frames; > + u32 count_rx_frames_success; > + u32 count_rx_cmacicv_errors; > + u32 count_rx_cmac_replays; > + u32 count_rx_mgmt_ccmp_replays; > + u32 count_rx_bipmic_errors; > } __packed; > > struct hif_mib_max_tx_power_level { > - int32_t max_tx_power_level_rf_port1; > - int32_t max_tx_power_level_rf_port2; > + s32 max_tx_power_level_rf_port1; > + s32 max_tx_power_level_rf_port2; > } __packed; > > struct hif_mib_beacon_stats { > - int32_t latest_tbtt_diff; > - uint32_t reserved[4]; > + s32 latest_tbtt_diff; > + u32 reserved[4]; > } __packed; > > struct hif_mib_mac_address { > - uint8_t mac_addr[ETH_ALEN]; > - uint16_t reserved; > + u8 mac_addr[ETH_ALEN]; > + u16 reserved; > } __packed; > > struct hif_mib_dot11_max_transmit_msdu_lifetime { > - uint32_t max_life_time; > + u32 max_life_time; > } __packed; > > struct hif_mib_dot11_max_receive_lifetime { > - uint32_t max_life_time; > + u32 max_life_time; > } __packed; > > struct hif_mib_wep_default_key_id { > - uint8_t wep_default_key_id; > - uint8_t reserved[3]; > + u8 wep_default_key_id; > + u8 reserved[3]; > } __packed; > > struct hif_mib_dot11_rts_threshold { > - uint32_t threshold; > + u32 threshold; > } __packed; > > struct hif_mib_slot_time { > - uint32_t slot_time; > + u32 slot_time; > } __packed; > > struct hif_mib_current_tx_power_level { > - int32_t power_level; > + s32 power_level; > } __packed; > > struct hif_mib_non_erp_protection { > - uint8_t use_cts_to_self:1; > - uint8_t reserved1:7; > - uint8_t reserved2[3]; > + u8 use_cts_to_self:1; > + u8 reserved1:7; > + u8 reserved2[3]; > } __packed; > > enum hif_tx_mode { > @@ -414,45 +414,45 @@ enum hif_tmplt { > #define HIF_API_MAX_TEMPLATE_FRAME_SIZE 700 > > struct hif_mib_template_frame { > - uint8_t frame_type; > - uint8_t init_rate:7; > - uint8_t mode:1; > - uint16_t frame_length; > - uint8_t frame[HIF_API_MAX_TEMPLATE_FRAME_SIZE]; > + u8 frame_type; > + u8 init_rate:7; > + u8 mode:1; > + u16 frame_length; > + u8 frame[HIF_API_MAX_TEMPLATE_FRAME_SIZE]; > } __packed; > > struct hif_mib_beacon_wake_up_period { > - uint8_t wakeup_period_min; > - uint8_t receive_dtim:1; > - uint8_t reserved1:7; > - uint8_t wakeup_period_max; > - uint8_t reserved2; > + u8 wakeup_period_min; > + u8 receive_dtim:1; > + u8 reserved1:7; > + u8 wakeup_period_max; > + u8 reserved2; > } __packed; > > struct hif_mib_rcpi_rssi_threshold { > - uint8_t detection:1; > - uint8_t rcpi_rssi:1; > - uint8_t upperthresh:1; > - uint8_t lowerthresh:1; > - uint8_t reserved:4; > - uint8_t lower_threshold; > - uint8_t upper_threshold; > - uint8_t rolling_average_count; > + u8 detection:1; > + u8 rcpi_rssi:1; > + u8 upperthresh:1; > + u8 lowerthresh:1; > + u8 reserved:4; > + u8 lower_threshold; > + u8 upper_threshold; > + u8 rolling_average_count; > } __packed; > > #define DEFAULT_BA_MAX_RX_BUFFER_SIZE 16 > > struct hif_mib_block_ack_policy { > - uint8_t block_ack_tx_tid_policy; > - uint8_t reserved1; > - uint8_t block_ack_rx_tid_policy; > - uint8_t block_ack_rx_max_buffer_size; > + u8 block_ack_tx_tid_policy; > + u8 reserved1; > + u8 block_ack_rx_tid_policy; > + u8 block_ack_rx_max_buffer_size; > } __packed; > > struct hif_mib_override_int_rate { > - uint8_t internal_tx_rate; > - uint8_t non_erp_internal_tx_rate; > - uint8_t reserved[2]; > + u8 internal_tx_rate; > + u8 non_erp_internal_tx_rate; > + u8 reserved[2]; > } __packed; > > enum hif_mpdu_start_spacing { > @@ -467,92 +467,91 @@ enum hif_mpdu_start_spacing { > }; > > struct hif_mib_set_association_mode { > - uint8_t preambtype_use:1; > - uint8_t mode:1; > - uint8_t rateset:1; > - uint8_t spacing:1; > - uint8_t reserved:4; > - uint8_t preamble_type; > - uint8_t mixed_or_greenfield_type; > - uint8_t mpdu_start_spacing; > - uint32_t basic_rate_set; > + u8 preambtype_use:1; > + u8 mode:1; > + u8 rateset:1; > + u8 spacing:1; > + u8 reserved:4; > + u8 preamble_type; > + u8 mixed_or_greenfield_type; > + u8 mpdu_start_spacing; > + u32 basic_rate_set; > } __packed; > > struct hif_mib_set_uapsd_information { > - uint8_t trig_bckgrnd:1; > - uint8_t trig_be:1; > - uint8_t trig_video:1; > - uint8_t trig_voice:1; > - uint8_t reserved1:4; > - uint8_t deliv_bckgrnd:1; > - uint8_t deliv_be:1; > - uint8_t deliv_video:1; > - uint8_t deliv_voice:1; > - uint8_t reserved2:4; > - uint16_t min_auto_trigger_interval; > - uint16_t max_auto_trigger_interval; > - uint16_t auto_trigger_step; > + u8 trig_bckgrnd:1; > + u8 trig_be:1; > + u8 trig_video:1; > + u8 trig_voice:1; > + u8 reserved1:4; > + u8 deliv_bckgrnd:1; > + u8 deliv_be:1; > + u8 deliv_video:1; > + u8 deliv_voice:1; > + u8 reserved2:4; > + u16 min_auto_trigger_interval; > + u16 max_auto_trigger_interval; > + u16 auto_trigger_step; > } __packed; > > struct hif_mib_tx_rate_retry_policy { > - uint8_t policy_index; > - uint8_t short_retry_count; > - uint8_t long_retry_count; > - uint8_t first_rate_sel:2; > - uint8_t terminate:1; > - uint8_t count_init:1; > - uint8_t reserved1:4; > - uint8_t rate_recovery_count; > - uint8_t reserved2[3]; > - uint8_t rates[12]; > + u8 policy_index; > + u8 short_retry_count; > + u8 long_retry_count; > + u8 first_rate_sel:2; > + u8 terminate:1; > + u8 count_init:1; > + u8 reserved1:4; > + u8 rate_recovery_count; > + u8 reserved2[3]; > + u8 rates[12]; > } __packed; > > #define HIF_MIB_NUM_TX_RATE_RETRY_POLICIES 15 > > struct hif_mib_set_tx_rate_retry_policy { > - uint8_t num_tx_rate_policies; > - uint8_t reserved[3]; > + u8 num_tx_rate_policies; > + u8 reserved[3]; > struct hif_mib_tx_rate_retry_policy tx_rate_retry_policy[]; > } __packed; > > struct hif_mib_protected_mgmt_policy { > - uint8_t pmf_enable:1; > - uint8_t unpmf_allowed:1; > - uint8_t host_enc_auth_frames:1; > - uint8_t reserved1:5; > - uint8_t reserved2[3]; > + u8 pmf_enable:1; > + u8 unpmf_allowed:1; > + u8 host_enc_auth_frames:1; > + u8 reserved1:5; > + u8 reserved2[3]; > } __packed; > > struct hif_mib_set_ht_protection { > - uint8_t dual_cts_prot:1; > - uint8_t reserved1:7; > - uint8_t reserved2[3]; > + u8 dual_cts_prot:1; > + u8 reserved1:7; > + u8 reserved2[3]; > } __packed; > > struct hif_mib_keep_alive_period { > - uint16_t keep_alive_period; > - uint8_t reserved[2]; > + u16 keep_alive_period; > + u8 reserved[2]; > } __packed; > > struct hif_mib_arp_keep_alive_period { > - uint16_t arp_keep_alive_period; > - uint8_t encr_type; > - uint8_t reserved; > - uint8_t sender_ipv4_address[HIF_API_IPV4_ADDRESS_SIZE]; > - uint8_t target_ipv4_address[HIF_API_IPV4_ADDRESS_SIZE]; > + u16 arp_keep_alive_period; > + u8 encr_type; > + u8 reserved; > + u8 sender_ipv4_address[HIF_API_IPV4_ADDRESS_SIZE]; > + u8 target_ipv4_address[HIF_API_IPV4_ADDRESS_SIZE]; > } __packed; > > struct hif_mib_inactivity_timer { > - uint8_t min_active_time; > - uint8_t max_active_time; > - uint16_t reserved; > + u8 min_active_time; > + u8 max_active_time; > + u16 reserved; > } __packed; > > struct hif_mib_interface_protection { > - uint8_t use_cts_prot:1; > - uint8_t reserved1:7; > - uint8_t reserved2[3]; > + u8 use_cts_prot:1; > + u8 reserved1:7; > + u8 reserved2[3]; > } __packed; > > - > #endif > diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/ hif_tx.c > index 2d40225a0fce..2f5dadff0660 100644 > --- a/drivers/staging/wfx/hif_tx.c > +++ b/drivers/staging/wfx/hif_tx.c > @@ -452,7 +452,8 @@ int hif_sl_config(struct wfx_dev *wdev, const unsigned long *bitmap) > 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; > struct hif_msg *hif; > diff --git a/drivers/staging/wfx/hif_tx.h b/drivers/staging/wfx/ hif_tx.h > index 6f2ea2f3a77d..f61ae7b0d41c 100644 > --- a/drivers/staging/wfx/hif_tx.h > +++ b/drivers/staging/wfx/hif_tx.h > @@ -18,7 +18,7 @@ struct wfx_vif; > struct wfx_scan_params { > struct hif_req_start_scan scan_req; > struct hif_ssid_def *ssids; > - uint8_t *ch; > + u8 *ch; > }; > > struct wfx_hif_cmd { > @@ -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_update_ie(struct wfx_vif *wvif, const struct hif_ie_flags *target_frame, > 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_send_pub_keys(struct wfx_dev *wdev, > - const uint8_t *pubkey, const uint8_t *pubkey_hmac); > + const u8 *pubkey, const u8 *pubkey_hmac); > > #endif > diff --git a/drivers/staging/wfx/hif_tx_mib.h b/drivers/staging/wfx/ hif_tx_mib.h > index 3339ad95f732..d1cabd697205 100644 > --- a/drivers/staging/wfx/hif_tx_mib.h > +++ b/drivers/staging/wfx/hif_tx_mib.h > @@ -145,7 +145,7 @@ static inline int hif_set_mfp(struct wfx_vif *wvif, bool capable, bool required) > } > if (!required) > val.unpmf_allowed = 1; > - cpu_to_le32s((uint32_t *) &val); > + cpu_to_le32s((u32 *) &val); > return hif_write_mib(wvif->wdev, wvif->id, > HIF_MIB_ID_PROTECTED_MGMT_POLICY, > &val, sizeof(val)); > diff --git a/drivers/staging/wfx/key.c b/drivers/staging/wfx/key.c > index 6d03abec20e4..caea6d959b0e 100644 > --- a/drivers/staging/wfx/key.c > +++ b/drivers/staging/wfx/key.c > @@ -31,7 +31,7 @@ static void wfx_free_key(struct wfx_dev *wdev, int 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) > { > 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, > 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) > { > 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, > 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) > { > - uint8_t *keybuf = key->key; > + u8 *keybuf = key->key; > > WARN(key->keylen != sizeof(msg->tkip_key_data) > + sizeof(msg->tx_mic_key) > @@ -68,18 +68,20 @@ static uint8_t fill_tkip_pair(struct hif_tkip_pairwise_key *msg, > 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_seq *seq, > enum nl80211_iftype iftype) > { > - uint8_t *keybuf = key->key; > + u8 *keybuf = key->key; > > WARN(key->keylen != sizeof(msg->tkip_key_data) > + 2 * sizeof(msg->rx_mic_key), "inconsistent data"); > msg->key_id = key->keyidx; > - memcpy(msg->rx_sequence_counter, &seq->tkip.iv16, sizeof(seq- >tkip.iv16)); > - memcpy(msg->rx_sequence_counter + sizeof(uint16_t), &seq- >tkip.iv32, sizeof(seq->tkip.iv32)); > + memcpy(msg->rx_sequence_counter, > + &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)); > keybuf += sizeof(msg->tkip_key_data); > if (iftype == NL80211_IFTYPE_AP) > @@ -91,7 +93,7 @@ static uint8_t fill_tkip_group(struct hif_tkip_group_key *msg, > 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) > { > 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, > 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_seq *seq) > { > @@ -112,10 +114,10 @@ static uint8_t fill_ccmp_group(struct hif_aes_group_key *msg, > 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) > { > - uint8_t *keybuf = key->key; > + u8 *keybuf = key->key; > > WARN(key->keylen != sizeof(msg->wapi_key_data) > + sizeof(msg->mic_key_data), "inconsistent data"); > @@ -127,10 +129,10 @@ static uint8_t fill_sms4_pair(struct hif_wapi_pairwise_key *msg, > 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) > { > - uint8_t *keybuf = key->key; > + u8 *keybuf = key->key; > > WARN(key->keylen != sizeof(msg->wapi_key_data) > + sizeof(msg->mic_key_data), "inconsistent data"); > @@ -141,7 +143,7 @@ static uint8_t fill_sms4_group(struct hif_wapi_group_key *msg, > 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_seq *seq) > { > diff --git a/drivers/staging/wfx/secure_link.h b/drivers/staging/wfx/ secure_link.h > index 376d7bc4c0c4..666b26e5308d 100644 > --- a/drivers/staging/wfx/secure_link.h > +++ b/drivers/staging/wfx/secure_link.h > @@ -25,12 +25,14 @@ static inline int wfx_sl_decode(struct wfx_dev *wdev, struct hif_sl_msg *m) > 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; > } > > -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; > } > diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c > index 93f3739b5f3a..43137657209c 100644 > --- a/drivers/staging/wfx/sta.c > +++ b/drivers/staging/wfx/sta.c > @@ -456,7 +456,7 @@ void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, > > /* 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 = RCPI / 2 - 110 > @@ -593,10 +593,10 @@ static void wfx_do_unjoin(struct wfx_vif *wvif) > > 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_size = 4 / sizeof(uint16_t); > - const int akm_suite_size = 4 / sizeof(uint16_t); > - const uint16_t *ptr = NULL; > + const int pairwise_cipher_suite_count_offset = 8 / sizeof(u16); > + const int pairwise_cipher_suite_size = 4 / sizeof(u16); > + const int akm_suite_size = 4 / sizeof(u16); > + const u16 *ptr = NULL; > bool mfpc = false; > bool mfpr = false; > > @@ -606,7 +606,8 @@ static void wfx_set_mfp(struct wfx_vif *wvif, struct cfg80211_bss *bss) > > rcu_read_lock(); > 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) { > ptr += pairwise_cipher_suite_count_offset; > diff --git a/drivers/staging/wfx/sta.h b/drivers/staging/wfx/sta.h > index 307ed0196110..57c46bd4e650 100644 > --- a/drivers/staging/wfx/sta.h > +++ b/drivers/staging/wfx/sta.h > @@ -26,7 +26,7 @@ enum wfx_state { > struct wfx_ht_info { > struct ieee80211_sta_ht_cap ht_cap; > enum nl80211_channel_type channel_type; > - uint16_t operation_mode; > + u16 operation_mode; > }; > > struct wfx_hif_event { > diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h > index d678b5a08873..44e580a07c91 100644 > --- a/drivers/staging/wfx/wfx.h > +++ b/drivers/staging/wfx/wfx.h > @@ -179,11 +179,11 @@ static inline int wvif_count(struct wfx_dev *wdev) > return ret; > } > > -static inline void memreverse(uint8_t *src, uint8_t length) > +static inline void memreverse(u8 *src, u8 length) > { > - uint8_t *lo = src; > - uint8_t *hi = src + length - 1; > - uint8_t swap; > + u8 *lo = src; > + u8 *hi = src + length - 1; > + u8 swap; > > while (lo < hi) { > swap = *lo; > @@ -194,7 +194,7 @@ static inline void memreverse(uint8_t *src, uint8_t length) > > static inline int memzcmp(void *src, unsigned int size) > { > - uint8_t *buf = src; > + u8 *buf = src; > > if (!size) > return 0; > -- > 2.23.0 > Hello Jules, I know that uXX is prefered over uintXX_t. However, I dislike to change 650 lines of code only for this purpose in one batch. It will generate plenty of conflicts with branches currently in development. -- Jérôme Pouiller ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 1/3] staging: wfx: replace uintXX_t to uXX and intXX_t to sXX 2019-11-11 17:04 ` [PATCH v2 1/3] staging: wfx: replace uintXX_t to uXX and intXX_t to sXX Jerome Pouiller @ 2019-11-11 17:48 ` gregkh 0 siblings, 0 replies; 9+ messages in thread From: gregkh @ 2019-11-11 17:48 UTC (permalink / raw) To: Jerome Pouiller; +Cc: Jules Irenge, devel, linux-kernel On Mon, Nov 11, 2019 at 05:04:49PM +0000, Jerome Pouiller wrote: > I know that uXX is prefered over uintXX_t. However, I dislike to change > 650 lines of code only for this purpose in one batch. It will generate > plenty of conflicts with branches currently in development. Now that the code is in the kernel tree, any "branches currently in development" have to deal with what is merged upstream no matter if they are tiny or big patches. That's just the joy of working with upstream, sorry. If you want to do out-of-tree development, that's fine, but you can't also want the code in-tree at the same time. thanks, greg k-h ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2019-11-11 23:16 UTC | newest] Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2019-11-11 13:30 [PATCH v2 1/3] staging: wfx: replace uintXX_t to uXX and intXX_t to sXX Jules Irenge 2019-11-11 13:30 ` [PATCH v2 2/3] staging: wfx: wrap characters Jules Irenge 2019-11-11 15:34 ` Greg KH 2019-11-11 13:30 ` [PATCH v2 3/3] staging: wfx: replace u32 by __le32 Jules Irenge 2019-11-11 14:12 ` Greg KH 2019-11-11 16:58 ` Jerome Pouiller 2019-11-11 23:15 ` Joe Perches 2019-11-11 17:04 ` [PATCH v2 1/3] staging: wfx: replace uintXX_t to uXX and intXX_t to sXX Jerome Pouiller 2019-11-11 17:48 ` gregkh
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).