* [PATCH v2 03/13] ath10k: warn if give WMI command is not supported
From: Bartosz Markowski @ 2013-09-26 9:29 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Bartosz Markowski
In-Reply-To: <1380187792-25626-1-git-send-email-bartosz.markowski@tieto.com>
This will show and make it easier to track the API
differences in the new AP firmware.
Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
---
drivers/net/wireless/ath/ath10k/wmi.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index cfb2082..fe55360 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -390,6 +390,11 @@ static int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb,
{
int ret = -EINVAL;
+ if (cmd_id == WMI_CMD_UNDEFINED) {
+ ath10k_warn("command not supported by given firmware\n");
+ return ret;
+ }
+
wait_event_timeout(ar->wmi.tx_credits_wq, ({
/* try to send pending beacons first. they take priority */
ath10k_wmi_tx_beacons_nowait(ar);
--
1.7.10
^ permalink raw reply related
* [PATCH v2 02/13] ath10k: add wmi_10x_<cmd/event> definitions
From: Bartosz Markowski @ 2013-09-26 9:29 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Bartosz Markowski
In-Reply-To: <1380187792-25626-1-git-send-email-bartosz.markowski@tieto.com>
Introduce the cmd and events definitions for 10.X FW API
and make up the wmi_10x_cmd_map. This is the core of
host-firmware WMI interface for 10.X FW branch.
Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
---
drivers/net/wireless/ath/ath10k/wmi.c | 126 ++++++++++++++++++-
drivers/net/wireless/ath/ath10k/wmi.h | 215 ++++++++++++++++++++++++++++++++-
2 files changed, 338 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index 1296dbe..cfb2082 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -143,7 +143,127 @@ static struct wmi_cmd_map wmi_cmd_map = {
.gpio_output_cmdid = WMI_GPIO_OUTPUT_CMDID,
};
-/* TODO: 10.X WMI cmd track */
+/* 10.X WMI cmd track */
+static struct wmi_cmd_map wmi_10x_cmd_map = {
+ .init_cmdid = WMI_10X_INIT_CMDID,
+ .start_scan_cmdid = WMI_10X_START_SCAN_CMDID,
+ .stop_scan_cmdid = WMI_10X_STOP_SCAN_CMDID,
+ .scan_chan_list_cmdid = WMI_10X_SCAN_CHAN_LIST_CMDID,
+ .scan_sch_prio_tbl_cmdid = WMI_CMD_UNDEFINED,
+ .pdev_set_regdomain_cmdid = WMI_10X_PDEV_SET_REGDOMAIN_CMDID,
+ .pdev_set_channel_cmdid = WMI_10X_PDEV_SET_CHANNEL_CMDID,
+ .pdev_set_param_cmdid = WMI_10X_PDEV_SET_PARAM_CMDID,
+ .pdev_pktlog_enable_cmdid = WMI_10X_PDEV_PKTLOG_ENABLE_CMDID,
+ .pdev_pktlog_disable_cmdid = WMI_10X_PDEV_PKTLOG_DISABLE_CMDID,
+ .pdev_set_wmm_params_cmdid = WMI_10X_PDEV_SET_WMM_PARAMS_CMDID,
+ .pdev_set_ht_cap_ie_cmdid = WMI_10X_PDEV_SET_HT_CAP_IE_CMDID,
+ .pdev_set_vht_cap_ie_cmdid = WMI_10X_PDEV_SET_VHT_CAP_IE_CMDID,
+ .pdev_set_dscp_tid_map_cmdid = WMI_10X_PDEV_SET_DSCP_TID_MAP_CMDID,
+ .pdev_set_quiet_mode_cmdid = WMI_10X_PDEV_SET_QUIET_MODE_CMDID,
+ .pdev_green_ap_ps_enable_cmdid = WMI_10X_PDEV_GREEN_AP_PS_ENABLE_CMDID,
+ .pdev_get_tpc_config_cmdid = WMI_10X_PDEV_GET_TPC_CONFIG_CMDID,
+ .pdev_set_base_macaddr_cmdid = WMI_10X_PDEV_SET_BASE_MACADDR_CMDID,
+ .vdev_create_cmdid = WMI_10X_VDEV_CREATE_CMDID,
+ .vdev_delete_cmdid = WMI_10X_VDEV_DELETE_CMDID,
+ .vdev_start_request_cmdid = WMI_10X_VDEV_START_REQUEST_CMDID,
+ .vdev_restart_request_cmdid = WMI_10X_VDEV_RESTART_REQUEST_CMDID,
+ .vdev_up_cmdid = WMI_10X_VDEV_UP_CMDID,
+ .vdev_stop_cmdid = WMI_10X_VDEV_STOP_CMDID,
+ .vdev_down_cmdid = WMI_10X_VDEV_DOWN_CMDID,
+ .vdev_set_param_cmdid = WMI_10X_VDEV_SET_PARAM_CMDID,
+ .vdev_install_key_cmdid = WMI_10X_VDEV_INSTALL_KEY_CMDID,
+ .peer_create_cmdid = WMI_10X_PEER_CREATE_CMDID,
+ .peer_delete_cmdid = WMI_10X_PEER_DELETE_CMDID,
+ .peer_flush_tids_cmdid = WMI_10X_PEER_FLUSH_TIDS_CMDID,
+ .peer_set_param_cmdid = WMI_10X_PEER_SET_PARAM_CMDID,
+ .peer_assoc_cmdid = WMI_10X_PEER_ASSOC_CMDID,
+ .peer_add_wds_entry_cmdid = WMI_10X_PEER_ADD_WDS_ENTRY_CMDID,
+ .peer_remove_wds_entry_cmdid = WMI_10X_PEER_REMOVE_WDS_ENTRY_CMDID,
+ .peer_mcast_group_cmdid = WMI_10X_PEER_MCAST_GROUP_CMDID,
+ .bcn_tx_cmdid = WMI_10X_BCN_TX_CMDID,
+ .pdev_send_bcn_cmdid = WMI_10X_PDEV_SEND_BCN_CMDID,
+ .bcn_tmpl_cmdid = WMI_CMD_UNDEFINED,
+ .bcn_filter_rx_cmdid = WMI_10X_BCN_FILTER_RX_CMDID,
+ .prb_req_filter_rx_cmdid = WMI_10X_PRB_REQ_FILTER_RX_CMDID,
+ .mgmt_tx_cmdid = WMI_10X_MGMT_TX_CMDID,
+ .prb_tmpl_cmdid = WMI_CMD_UNDEFINED,
+ .addba_clear_resp_cmdid = WMI_10X_ADDBA_CLEAR_RESP_CMDID,
+ .addba_send_cmdid = WMI_10X_ADDBA_SEND_CMDID,
+ .addba_status_cmdid = WMI_10X_ADDBA_STATUS_CMDID,
+ .delba_send_cmdid = WMI_10X_DELBA_SEND_CMDID,
+ .addba_set_resp_cmdid = WMI_10X_ADDBA_SET_RESP_CMDID,
+ .send_singleamsdu_cmdid = WMI_10X_SEND_SINGLEAMSDU_CMDID,
+ .sta_powersave_mode_cmdid = WMI_10X_STA_POWERSAVE_MODE_CMDID,
+ .sta_powersave_param_cmdid = WMI_10X_STA_POWERSAVE_PARAM_CMDID,
+ .sta_mimo_ps_mode_cmdid = WMI_10X_STA_MIMO_PS_MODE_CMDID,
+ .pdev_dfs_enable_cmdid = WMI_10X_PDEV_DFS_ENABLE_CMDID,
+ .pdev_dfs_disable_cmdid = WMI_10X_PDEV_DFS_DISABLE_CMDID,
+ .roam_scan_mode = WMI_10X_ROAM_SCAN_MODE,
+ .roam_scan_rssi_threshold = WMI_10X_ROAM_SCAN_RSSI_THRESHOLD,
+ .roam_scan_period = WMI_10X_ROAM_SCAN_PERIOD,
+ .roam_scan_rssi_change_threshold =
+ WMI_10X_ROAM_SCAN_RSSI_CHANGE_THRESHOLD,
+ .roam_ap_profile = WMI_10X_ROAM_AP_PROFILE,
+ .ofl_scan_add_ap_profile = WMI_10X_OFL_SCAN_ADD_AP_PROFILE,
+ .ofl_scan_remove_ap_profile = WMI_10X_OFL_SCAN_REMOVE_AP_PROFILE,
+ .ofl_scan_period = WMI_10X_OFL_SCAN_PERIOD,
+ .p2p_dev_set_device_info = WMI_10X_P2P_DEV_SET_DEVICE_INFO,
+ .p2p_dev_set_discoverability = WMI_10X_P2P_DEV_SET_DISCOVERABILITY,
+ .p2p_go_set_beacon_ie = WMI_10X_P2P_GO_SET_BEACON_IE,
+ .p2p_go_set_probe_resp_ie = WMI_10X_P2P_GO_SET_PROBE_RESP_IE,
+ .p2p_set_vendor_ie_data_cmdid = WMI_CMD_UNDEFINED,
+ .ap_ps_peer_param_cmdid = WMI_CMD_UNDEFINED,
+ .ap_ps_peer_uapsd_coex_cmdid = WMI_CMD_UNDEFINED,
+ .peer_rate_retry_sched_cmdid = WMI_10X_PEER_RATE_RETRY_SCHED_CMDID,
+ .wlan_profile_trigger_cmdid = WMI_10X_WLAN_PROFILE_TRIGGER_CMDID,
+ .wlan_profile_set_hist_intvl_cmdid =
+ WMI_10X_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
+ .wlan_profile_get_profile_data_cmdid =
+ WMI_10X_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
+ .wlan_profile_enable_profile_id_cmdid =
+ WMI_10X_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
+ .wlan_profile_list_profile_id_cmdid =
+ WMI_10X_WLAN_PROFILE_LIST_PROFILE_ID_CMDID,
+ .pdev_suspend_cmdid = WMI_10X_PDEV_SUSPEND_CMDID,
+ .pdev_resume_cmdid = WMI_10X_PDEV_RESUME_CMDID,
+ .add_bcn_filter_cmdid = WMI_10X_ADD_BCN_FILTER_CMDID,
+ .rmv_bcn_filter_cmdid = WMI_10X_RMV_BCN_FILTER_CMDID,
+ .wow_add_wake_pattern_cmdid = WMI_10X_WOW_ADD_WAKE_PATTERN_CMDID,
+ .wow_del_wake_pattern_cmdid = WMI_10X_WOW_DEL_WAKE_PATTERN_CMDID,
+ .wow_enable_disable_wake_event_cmdid =
+ WMI_10X_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID,
+ .wow_enable_cmdid = WMI_10X_WOW_ENABLE_CMDID,
+ .wow_hostwakeup_from_sleep_cmdid =
+ WMI_10X_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID,
+ .rtt_measreq_cmdid = WMI_10X_RTT_MEASREQ_CMDID,
+ .rtt_tsf_cmdid = WMI_10X_RTT_TSF_CMDID,
+ .vdev_spectral_scan_configure_cmdid =
+ WMI_10X_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID,
+ .vdev_spectral_scan_enable_cmdid =
+ WMI_10X_VDEV_SPECTRAL_SCAN_ENABLE_CMDID,
+ .request_stats_cmdid = WMI_10X_REQUEST_STATS_CMDID,
+ .set_arp_ns_offload_cmdid = WMI_CMD_UNDEFINED,
+ .network_list_offload_config_cmdid = WMI_CMD_UNDEFINED,
+ .gtk_offload_cmdid = WMI_CMD_UNDEFINED,
+ .csa_offload_enable_cmdid = WMI_CMD_UNDEFINED,
+ .csa_offload_chanswitch_cmdid = WMI_CMD_UNDEFINED,
+ .chatter_set_mode_cmdid = WMI_CMD_UNDEFINED,
+ .peer_tid_addba_cmdid = WMI_CMD_UNDEFINED,
+ .peer_tid_delba_cmdid = WMI_CMD_UNDEFINED,
+ .sta_dtim_ps_method_cmdid = WMI_CMD_UNDEFINED,
+ .sta_uapsd_auto_trig_cmdid = WMI_CMD_UNDEFINED,
+ .sta_keepalive_cmd = WMI_CMD_UNDEFINED,
+ .echo_cmdid = WMI_10X_ECHO_CMDID,
+ .pdev_utf_cmdid = WMI_10X_PDEV_UTF_CMDID,
+ .dbglog_cfg_cmdid = WMI_10X_DBGLOG_CFG_CMDID,
+ .pdev_qvit_cmdid = WMI_10X_PDEV_QVIT_CMDID,
+ .pdev_ftm_intg_cmdid = WMI_CMD_UNDEFINED,
+ .vdev_set_keepalive_cmdid = WMI_CMD_UNDEFINED,
+ .vdev_get_keepalive_cmdid = WMI_CMD_UNDEFINED,
+ .force_fw_hang_cmdid = WMI_CMD_UNDEFINED,
+ .gpio_config_cmdid = WMI_10X_GPIO_CONFIG_CMDID,
+ .gpio_output_cmdid = WMI_10X_GPIO_OUTPUT_CMDID,
+};
int ath10k_wmi_wait_for_service_ready(struct ath10k *ar)
{
@@ -1307,13 +1427,15 @@ static void ath10k_wmi_process_rx(struct ath10k *ar, struct sk_buff *skb)
/* WMI Initialization functions */
int ath10k_wmi_attach(struct ath10k *ar)
{
- int ret = 0;
+ int ret;
if (test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features)) {
ath10k_warn("Firmware 10.X is not yet supported\n");
+ ar->wmi.cmd = &wmi_10x_cmd_map;
ret = -ENOTSUPP;
} else {
ar->wmi.cmd = &wmi_cmd_map;
+ ret = 0;
}
init_completion(&ar->wmi.service_ready);
diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h
index b8b446a..d8414ab 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.h
+++ b/drivers/net/wireless/ath/ath10k/wmi.h
@@ -359,7 +359,9 @@ enum wmi_cmd_group {
#define WMI_CMD_GRP(grp_id) (((grp_id) << 12) | 0x1)
#define WMI_EVT_GRP_START_ID(grp_id) (((grp_id) << 12) | 0x1)
-/* Command IDs and commande events. */
+#define WMI_CMD_UNDEFINED 0
+
+/* Command IDs and command events for MAIN FW. */
enum wmi_cmd_id {
WMI_INIT_CMDID = 0x1,
@@ -600,6 +602,217 @@ enum wmi_event_id {
WMI_GPIO_INPUT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_GPIO),
};
+/* Command IDs and command events for 10.X firmware */
+enum wmi_10x_cmd_id {
+ WMI_10X_START_CMDID = 0x9000,
+ WMI_10X_END_CMDID = 0x9FFF,
+
+ /* initialize the wlan sub system */
+ WMI_10X_INIT_CMDID,
+
+ /* Scan specific commands */
+
+ WMI_10X_START_SCAN_CMDID = WMI_10X_START_CMDID,
+ WMI_10X_STOP_SCAN_CMDID,
+ WMI_10X_SCAN_CHAN_LIST_CMDID,
+ WMI_10X_ECHO_CMDID,
+
+ /* PDEV(physical device) specific commands */
+ WMI_10X_PDEV_SET_REGDOMAIN_CMDID,
+ WMI_10X_PDEV_SET_CHANNEL_CMDID,
+ WMI_10X_PDEV_SET_PARAM_CMDID,
+ WMI_10X_PDEV_PKTLOG_ENABLE_CMDID,
+ WMI_10X_PDEV_PKTLOG_DISABLE_CMDID,
+ WMI_10X_PDEV_SET_WMM_PARAMS_CMDID,
+ WMI_10X_PDEV_SET_HT_CAP_IE_CMDID,
+ WMI_10X_PDEV_SET_VHT_CAP_IE_CMDID,
+ WMI_10X_PDEV_SET_BASE_MACADDR_CMDID,
+ WMI_10X_PDEV_SET_DSCP_TID_MAP_CMDID,
+ WMI_10X_PDEV_SET_QUIET_MODE_CMDID,
+ WMI_10X_PDEV_GREEN_AP_PS_ENABLE_CMDID,
+ WMI_10X_PDEV_GET_TPC_CONFIG_CMDID,
+
+ /* VDEV(virtual device) specific commands */
+ WMI_10X_VDEV_CREATE_CMDID,
+ WMI_10X_VDEV_DELETE_CMDID,
+ WMI_10X_VDEV_START_REQUEST_CMDID,
+ WMI_10X_VDEV_RESTART_REQUEST_CMDID,
+ WMI_10X_VDEV_UP_CMDID,
+ WMI_10X_VDEV_STOP_CMDID,
+ WMI_10X_VDEV_DOWN_CMDID,
+ WMI_10X_VDEV_STANDBY_RESPONSE_CMDID,
+ WMI_10X_VDEV_RESUME_RESPONSE_CMDID,
+ WMI_10X_VDEV_SET_PARAM_CMDID,
+ WMI_10X_VDEV_INSTALL_KEY_CMDID,
+
+ /* peer specific commands */
+ WMI_10X_PEER_CREATE_CMDID,
+ WMI_10X_PEER_DELETE_CMDID,
+ WMI_10X_PEER_FLUSH_TIDS_CMDID,
+ WMI_10X_PEER_SET_PARAM_CMDID,
+ WMI_10X_PEER_ASSOC_CMDID,
+ WMI_10X_PEER_ADD_WDS_ENTRY_CMDID,
+ WMI_10X_PEER_REMOVE_WDS_ENTRY_CMDID,
+ WMI_10X_PEER_MCAST_GROUP_CMDID,
+
+ /* beacon/management specific commands */
+
+ WMI_10X_BCN_TX_CMDID,
+ WMI_10X_BCN_PRB_TMPL_CMDID,
+ WMI_10X_BCN_FILTER_RX_CMDID,
+ WMI_10X_PRB_REQ_FILTER_RX_CMDID,
+ WMI_10X_MGMT_TX_CMDID,
+
+ /* commands to directly control ba negotiation directly from host. */
+ WMI_10X_ADDBA_CLEAR_RESP_CMDID,
+ WMI_10X_ADDBA_SEND_CMDID,
+ WMI_10X_ADDBA_STATUS_CMDID,
+ WMI_10X_DELBA_SEND_CMDID,
+ WMI_10X_ADDBA_SET_RESP_CMDID,
+ WMI_10X_SEND_SINGLEAMSDU_CMDID,
+
+ /* Station power save specific config */
+ WMI_10X_STA_POWERSAVE_MODE_CMDID,
+ WMI_10X_STA_POWERSAVE_PARAM_CMDID,
+ WMI_10X_STA_MIMO_PS_MODE_CMDID,
+
+ /* set debug log config */
+ WMI_10X_DBGLOG_CFG_CMDID,
+
+ /* DFS-specific commands */
+ WMI_10X_PDEV_DFS_ENABLE_CMDID,
+ WMI_10X_PDEV_DFS_DISABLE_CMDID,
+
+ /* QVIT specific command id */
+ WMI_10X_PDEV_QVIT_CMDID,
+
+ /* Offload Scan and Roaming related commands */
+ WMI_10X_ROAM_SCAN_MODE,
+ WMI_10X_ROAM_SCAN_RSSI_THRESHOLD,
+ WMI_10X_ROAM_SCAN_PERIOD,
+ WMI_10X_ROAM_SCAN_RSSI_CHANGE_THRESHOLD,
+ WMI_10X_ROAM_AP_PROFILE,
+ WMI_10X_OFL_SCAN_ADD_AP_PROFILE,
+ WMI_10X_OFL_SCAN_REMOVE_AP_PROFILE,
+ WMI_10X_OFL_SCAN_PERIOD,
+
+ /* P2P specific commands */
+ WMI_10X_P2P_DEV_SET_DEVICE_INFO,
+ WMI_10X_P2P_DEV_SET_DISCOVERABILITY,
+ WMI_10X_P2P_GO_SET_BEACON_IE,
+ WMI_10X_P2P_GO_SET_PROBE_RESP_IE,
+
+ /* AP power save specific config */
+ WMI_10X_AP_PS_PEER_PARAM_CMDID,
+ WMI_10X_AP_PS_PEER_UAPSD_COEX_CMDID,
+
+ /* Rate-control specific commands */
+ WMI_10X_PEER_RATE_RETRY_SCHED_CMDID,
+
+ /* WLAN Profiling commands. */
+ WMI_10X_WLAN_PROFILE_TRIGGER_CMDID,
+ WMI_10X_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
+ WMI_10X_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
+ WMI_10X_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
+ WMI_10X_WLAN_PROFILE_LIST_PROFILE_ID_CMDID,
+
+ /* Suspend resume command Ids */
+ WMI_10X_PDEV_SUSPEND_CMDID,
+ WMI_10X_PDEV_RESUME_CMDID,
+
+ /* Beacon filter commands */
+ WMI_10X_ADD_BCN_FILTER_CMDID,
+ WMI_10X_RMV_BCN_FILTER_CMDID,
+
+ /* WOW Specific WMI commands*/
+ WMI_10X_WOW_ADD_WAKE_PATTERN_CMDID,
+ WMI_10X_WOW_DEL_WAKE_PATTERN_CMDID,
+ WMI_10X_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID,
+ WMI_10X_WOW_ENABLE_CMDID,
+ WMI_10X_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID,
+
+ /* RTT measurement related cmd */
+ WMI_10X_RTT_MEASREQ_CMDID,
+ WMI_10X_RTT_TSF_CMDID,
+
+ /* transmit beacon by value */
+ WMI_10X_PDEV_SEND_BCN_CMDID,
+
+ /* F/W stats */
+ WMI_10X_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID,
+ WMI_10X_VDEV_SPECTRAL_SCAN_ENABLE_CMDID,
+ WMI_10X_REQUEST_STATS_CMDID,
+
+ /* GPIO Configuration */
+ WMI_10X_GPIO_CONFIG_CMDID,
+ WMI_10X_GPIO_OUTPUT_CMDID,
+
+ WMI_10X_PDEV_UTF_CMDID = WMI_10X_END_CMDID - 1,
+};
+
+enum wmi_10x_event_id {
+ WMI_10X_SERVICE_READY_EVENTID = 0x8000,
+ WMI_10X_READY_EVENTID,
+ WMI_10X_START_EVENTID = 0x9000,
+ WMI_10X_END_EVENTID = 0x9FFF,
+
+ /* Scan specific events */
+ WMI_10X_SCAN_EVENTID = WMI_10X_START_EVENTID,
+ WMI_10X_ECHO_EVENTID,
+ WMI_10X_DEBUG_MESG_EVENTID,
+ WMI_10X_UPDATE_STATS_EVENTID,
+
+ /* Instantaneous RSSI event */
+ WMI_10X_INST_RSSI_STATS_EVENTID,
+
+ /* VDEV specific events */
+ WMI_10X_VDEV_START_RESP_EVENTID,
+ WMI_10X_VDEV_STANDBY_REQ_EVENTID,
+ WMI_10X_VDEV_RESUME_REQ_EVENTID,
+ WMI_10X_VDEV_STOPPED_EVENTID,
+
+ /* peer specific events */
+ WMI_10X_PEER_STA_KICKOUT_EVENTID,
+
+ /* beacon/mgmt specific events */
+ WMI_10X_HOST_SWBA_EVENTID,
+ WMI_10X_TBTTOFFSET_UPDATE_EVENTID,
+ WMI_10X_MGMT_RX_EVENTID,
+
+ /* Channel stats event */
+ WMI_10X_CHAN_INFO_EVENTID,
+
+ /* PHY Error specific WMI event */
+ WMI_10X_PHYERR_EVENTID,
+
+ /* Roam event to trigger roaming on host */
+ WMI_10X_ROAM_EVENTID,
+
+ /* matching AP found from list of profiles */
+ WMI_10X_PROFILE_MATCH,
+
+ /* debug print message used for tracing FW code while debugging */
+ WMI_10X_DEBUG_PRINT_EVENTID,
+ /* VI spoecific event */
+ WMI_10X_PDEV_QVIT_EVENTID,
+ /* FW code profile data in response to profile request */
+ WMI_10X_WLAN_PROFILE_DATA_EVENTID,
+
+ /*RTT related event ID*/
+ WMI_10X_RTT_MEASUREMENT_REPORT_EVENTID,
+ WMI_10X_TSF_MEASUREMENT_REPORT_EVENTID,
+ WMI_10X_RTT_ERROR_REPORT_EVENTID,
+
+ WMI_10X_WOW_WAKEUP_HOST_EVENTID,
+ WMI_10X_DCS_INTERFERENCE_EVENTID,
+
+ /* TPC config for the current operating channel */
+ WMI_10X_PDEV_TPC_CONFIG_EVENTID,
+
+ WMI_10X_GPIO_INPUT_EVENTID,
+ WMI_10X_PDEV_UTF_EVENTID = WMI_10X_END_EVENTID-1,
+};
+
enum wmi_phy_mode {
MODE_11A = 0, /* 11a Mode */
MODE_11G = 1, /* 11b/g Mode */
--
1.7.10
^ permalink raw reply related
* [PATCH v2 01/13] ath10k: introduce dynamic WMI structures
From: Bartosz Markowski @ 2013-09-26 9:29 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Bartosz Markowski
In-Reply-To: <1380187792-25626-1-git-send-email-bartosz.markowski@tieto.com>
This is the initial framework to implement dynamic
WMI API in order to support new firmware (from so
called 10.X branch)
The realization is to have a static WMI cmd map for
each of the firmwares, registered upom wmi init.
This patch creates such map for MAIN FW, updates
wmi_cmd_send() calls to take as a parameter
the map value instead of direct WMI enum.
As soon as complete 10.X API will be on place,
we will introduce the FW IE mechanics to dynamicaly
identify which FW is being used and based on that
we will use correct map, API, structures, etc.
Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
---
drivers/net/wireless/ath/ath10k/core.h | 4 +
drivers/net/wireless/ath/ath10k/wmi.c | 230 ++++++++++++++++++++++++++------
drivers/net/wireless/ath/ath10k/wmi.h | 112 ++++++++++++++++
3 files changed, 305 insertions(+), 41 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index 292ad45..acfee7c 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -107,6 +107,7 @@ struct ath10k_wmi {
struct completion service_ready;
struct completion unified_ready;
wait_queue_head_t tx_credits_wq;
+ struct wmi_cmd_map *cmd;
};
struct ath10k_peer_stat {
@@ -268,6 +269,9 @@ enum ath10k_fw_features {
/* wmi_mgmt_rx_hdr contains extra RSSI information */
ATH10K_FW_FEATURE_EXT_WMI_MGMT_RX = 0,
+ /* firmware from 10X branch */
+ ATH10K_FW_FEATURE_WMI_10X = 1,
+
/* keep last */
ATH10K_FW_FEATURE_COUNT,
};
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index 6803ead..1296dbe 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -23,6 +23,128 @@
#include "wmi.h"
#include "mac.h"
+/* MAIN WMI cmd track */
+static struct wmi_cmd_map wmi_cmd_map = {
+ .init_cmdid = WMI_INIT_CMDID,
+ .start_scan_cmdid = WMI_START_SCAN_CMDID,
+ .stop_scan_cmdid = WMI_STOP_SCAN_CMDID,
+ .scan_chan_list_cmdid = WMI_SCAN_CHAN_LIST_CMDID,
+ .scan_sch_prio_tbl_cmdid = WMI_SCAN_SCH_PRIO_TBL_CMDID,
+ .pdev_set_regdomain_cmdid = WMI_PDEV_SET_REGDOMAIN_CMDID,
+ .pdev_set_channel_cmdid = WMI_PDEV_SET_CHANNEL_CMDID,
+ .pdev_set_param_cmdid = WMI_PDEV_SET_PARAM_CMDID,
+ .pdev_pktlog_enable_cmdid = WMI_PDEV_PKTLOG_ENABLE_CMDID,
+ .pdev_pktlog_disable_cmdid = WMI_PDEV_PKTLOG_DISABLE_CMDID,
+ .pdev_set_wmm_params_cmdid = WMI_PDEV_SET_WMM_PARAMS_CMDID,
+ .pdev_set_ht_cap_ie_cmdid = WMI_PDEV_SET_HT_CAP_IE_CMDID,
+ .pdev_set_vht_cap_ie_cmdid = WMI_PDEV_SET_VHT_CAP_IE_CMDID,
+ .pdev_set_dscp_tid_map_cmdid = WMI_PDEV_SET_DSCP_TID_MAP_CMDID,
+ .pdev_set_quiet_mode_cmdid = WMI_PDEV_SET_QUIET_MODE_CMDID,
+ .pdev_green_ap_ps_enable_cmdid = WMI_PDEV_GREEN_AP_PS_ENABLE_CMDID,
+ .pdev_get_tpc_config_cmdid = WMI_PDEV_GET_TPC_CONFIG_CMDID,
+ .pdev_set_base_macaddr_cmdid = WMI_PDEV_SET_BASE_MACADDR_CMDID,
+ .vdev_create_cmdid = WMI_VDEV_CREATE_CMDID,
+ .vdev_delete_cmdid = WMI_VDEV_DELETE_CMDID,
+ .vdev_start_request_cmdid = WMI_VDEV_START_REQUEST_CMDID,
+ .vdev_restart_request_cmdid = WMI_VDEV_RESTART_REQUEST_CMDID,
+ .vdev_up_cmdid = WMI_VDEV_UP_CMDID,
+ .vdev_stop_cmdid = WMI_VDEV_STOP_CMDID,
+ .vdev_down_cmdid = WMI_VDEV_DOWN_CMDID,
+ .vdev_set_param_cmdid = WMI_VDEV_SET_PARAM_CMDID,
+ .vdev_install_key_cmdid = WMI_VDEV_INSTALL_KEY_CMDID,
+ .peer_create_cmdid = WMI_PEER_CREATE_CMDID,
+ .peer_delete_cmdid = WMI_PEER_DELETE_CMDID,
+ .peer_flush_tids_cmdid = WMI_PEER_FLUSH_TIDS_CMDID,
+ .peer_set_param_cmdid = WMI_PEER_SET_PARAM_CMDID,
+ .peer_assoc_cmdid = WMI_PEER_ASSOC_CMDID,
+ .peer_add_wds_entry_cmdid = WMI_PEER_ADD_WDS_ENTRY_CMDID,
+ .peer_remove_wds_entry_cmdid = WMI_PEER_REMOVE_WDS_ENTRY_CMDID,
+ .peer_mcast_group_cmdid = WMI_PEER_MCAST_GROUP_CMDID,
+ .bcn_tx_cmdid = WMI_BCN_TX_CMDID,
+ .pdev_send_bcn_cmdid = WMI_PDEV_SEND_BCN_CMDID,
+ .bcn_tmpl_cmdid = WMI_BCN_TMPL_CMDID,
+ .bcn_filter_rx_cmdid = WMI_BCN_FILTER_RX_CMDID,
+ .prb_req_filter_rx_cmdid = WMI_PRB_REQ_FILTER_RX_CMDID,
+ .mgmt_tx_cmdid = WMI_MGMT_TX_CMDID,
+ .prb_tmpl_cmdid = WMI_PRB_TMPL_CMDID,
+ .addba_clear_resp_cmdid = WMI_ADDBA_CLEAR_RESP_CMDID,
+ .addba_send_cmdid = WMI_ADDBA_SEND_CMDID,
+ .addba_status_cmdid = WMI_ADDBA_STATUS_CMDID,
+ .delba_send_cmdid = WMI_DELBA_SEND_CMDID,
+ .addba_set_resp_cmdid = WMI_ADDBA_SET_RESP_CMDID,
+ .send_singleamsdu_cmdid = WMI_SEND_SINGLEAMSDU_CMDID,
+ .sta_powersave_mode_cmdid = WMI_STA_POWERSAVE_MODE_CMDID,
+ .sta_powersave_param_cmdid = WMI_STA_POWERSAVE_PARAM_CMDID,
+ .sta_mimo_ps_mode_cmdid = WMI_STA_MIMO_PS_MODE_CMDID,
+ .pdev_dfs_enable_cmdid = WMI_PDEV_DFS_ENABLE_CMDID,
+ .pdev_dfs_disable_cmdid = WMI_PDEV_DFS_DISABLE_CMDID,
+ .roam_scan_mode = WMI_ROAM_SCAN_MODE,
+ .roam_scan_rssi_threshold = WMI_ROAM_SCAN_RSSI_THRESHOLD,
+ .roam_scan_period = WMI_ROAM_SCAN_PERIOD,
+ .roam_scan_rssi_change_threshold = WMI_ROAM_SCAN_RSSI_CHANGE_THRESHOLD,
+ .roam_ap_profile = WMI_ROAM_AP_PROFILE,
+ .ofl_scan_add_ap_profile = WMI_ROAM_AP_PROFILE,
+ .ofl_scan_remove_ap_profile = WMI_OFL_SCAN_REMOVE_AP_PROFILE,
+ .ofl_scan_period = WMI_OFL_SCAN_PERIOD,
+ .p2p_dev_set_device_info = WMI_P2P_DEV_SET_DEVICE_INFO,
+ .p2p_dev_set_discoverability = WMI_P2P_DEV_SET_DISCOVERABILITY,
+ .p2p_go_set_beacon_ie = WMI_P2P_GO_SET_BEACON_IE,
+ .p2p_go_set_probe_resp_ie = WMI_P2P_GO_SET_PROBE_RESP_IE,
+ .p2p_set_vendor_ie_data_cmdid = WMI_P2P_SET_VENDOR_IE_DATA_CMDID,
+ .ap_ps_peer_param_cmdid = WMI_AP_PS_PEER_PARAM_CMDID,
+ .ap_ps_peer_uapsd_coex_cmdid = WMI_AP_PS_PEER_UAPSD_COEX_CMDID,
+ .peer_rate_retry_sched_cmdid = WMI_PEER_RATE_RETRY_SCHED_CMDID,
+ .wlan_profile_trigger_cmdid = WMI_WLAN_PROFILE_TRIGGER_CMDID,
+ .wlan_profile_set_hist_intvl_cmdid =
+ WMI_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
+ .wlan_profile_get_profile_data_cmdid =
+ WMI_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
+ .wlan_profile_enable_profile_id_cmdid =
+ WMI_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
+ .wlan_profile_list_profile_id_cmdid =
+ WMI_WLAN_PROFILE_LIST_PROFILE_ID_CMDID,
+ .pdev_suspend_cmdid = WMI_PDEV_SUSPEND_CMDID,
+ .pdev_resume_cmdid = WMI_PDEV_RESUME_CMDID,
+ .add_bcn_filter_cmdid = WMI_ADD_BCN_FILTER_CMDID,
+ .rmv_bcn_filter_cmdid = WMI_RMV_BCN_FILTER_CMDID,
+ .wow_add_wake_pattern_cmdid = WMI_WOW_ADD_WAKE_PATTERN_CMDID,
+ .wow_del_wake_pattern_cmdid = WMI_WOW_DEL_WAKE_PATTERN_CMDID,
+ .wow_enable_disable_wake_event_cmdid =
+ WMI_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID,
+ .wow_enable_cmdid = WMI_WOW_ENABLE_CMDID,
+ .wow_hostwakeup_from_sleep_cmdid = WMI_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID,
+ .rtt_measreq_cmdid = WMI_RTT_MEASREQ_CMDID,
+ .rtt_tsf_cmdid = WMI_RTT_TSF_CMDID,
+ .vdev_spectral_scan_configure_cmdid =
+ WMI_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID,
+ .vdev_spectral_scan_enable_cmdid = WMI_VDEV_SPECTRAL_SCAN_ENABLE_CMDID,
+ .request_stats_cmdid = WMI_REQUEST_STATS_CMDID,
+ .set_arp_ns_offload_cmdid = WMI_SET_ARP_NS_OFFLOAD_CMDID,
+ .network_list_offload_config_cmdid =
+ WMI_NETWORK_LIST_OFFLOAD_CONFIG_CMDID,
+ .gtk_offload_cmdid = WMI_GTK_OFFLOAD_CMDID,
+ .csa_offload_enable_cmdid = WMI_CSA_OFFLOAD_ENABLE_CMDID,
+ .csa_offload_chanswitch_cmdid = WMI_CSA_OFFLOAD_CHANSWITCH_CMDID,
+ .chatter_set_mode_cmdid = WMI_CHATTER_SET_MODE_CMDID,
+ .peer_tid_addba_cmdid = WMI_PEER_TID_ADDBA_CMDID,
+ .peer_tid_delba_cmdid = WMI_PEER_TID_DELBA_CMDID,
+ .sta_dtim_ps_method_cmdid = WMI_STA_DTIM_PS_METHOD_CMDID,
+ .sta_uapsd_auto_trig_cmdid = WMI_STA_UAPSD_AUTO_TRIG_CMDID,
+ .sta_keepalive_cmd = WMI_STA_KEEPALIVE_CMD,
+ .echo_cmdid = WMI_ECHO_CMDID,
+ .pdev_utf_cmdid = WMI_PDEV_UTF_CMDID,
+ .dbglog_cfg_cmdid = WMI_DBGLOG_CFG_CMDID,
+ .pdev_qvit_cmdid = WMI_PDEV_QVIT_CMDID,
+ .pdev_ftm_intg_cmdid = WMI_PDEV_FTM_INTG_CMDID,
+ .vdev_set_keepalive_cmdid = WMI_VDEV_SET_KEEPALIVE_CMDID,
+ .vdev_get_keepalive_cmdid = WMI_VDEV_GET_KEEPALIVE_CMDID,
+ .force_fw_hang_cmdid = WMI_FORCE_FW_HANG_CMDID,
+ .gpio_config_cmdid = WMI_GPIO_CONFIG_CMDID,
+ .gpio_output_cmdid = WMI_GPIO_OUTPUT_CMDID,
+};
+
+/* TODO: 10.X WMI cmd track */
+
int ath10k_wmi_wait_for_service_ready(struct ath10k *ar)
{
int ret;
@@ -64,7 +186,7 @@ static void ath10k_wmi_htc_tx_complete(struct ath10k *ar, struct sk_buff *skb)
}
static int ath10k_wmi_cmd_send_nowait(struct ath10k *ar, struct sk_buff *skb,
- enum wmi_cmd_id cmd_id)
+ u32 cmd_id)
{
struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(skb);
struct wmi_cmd_hdr *cmd_hdr;
@@ -144,7 +266,7 @@ static void ath10k_wmi_op_ep_tx_credits(struct ath10k *ar)
}
static int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb,
- enum wmi_cmd_id cmd_id)
+ u32 cmd_id)
{
int ret = -EINVAL;
@@ -1055,7 +1177,7 @@ static int ath10k_wmi_ready_event_rx(struct ath10k *ar, struct sk_buff *skb)
return 0;
}
-static void ath10k_wmi_process_rx(struct ath10k *ar, struct sk_buff *skb)
+static void ath10k_wmi_main_process_rx(struct ath10k *ar, struct sk_buff *skb)
{
struct wmi_cmd_hdr *cmd_hdr;
enum wmi_event_id id;
@@ -1174,14 +1296,31 @@ static void ath10k_wmi_process_rx(struct ath10k *ar, struct sk_buff *skb)
dev_kfree_skb(skb);
}
+static void ath10k_wmi_process_rx(struct ath10k *ar, struct sk_buff *skb)
+{
+ if (test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features))
+ ath10k_warn("Firmware 10.X is not yet supported\n");
+ else
+ ath10k_wmi_main_process_rx(ar, skb);
+}
+
/* WMI Initialization functions */
int ath10k_wmi_attach(struct ath10k *ar)
{
+ int ret = 0;
+
+ if (test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features)) {
+ ath10k_warn("Firmware 10.X is not yet supported\n");
+ ret = -ENOTSUPP;
+ } else {
+ ar->wmi.cmd = &wmi_cmd_map;
+ }
+
init_completion(&ar->wmi.service_ready);
init_completion(&ar->wmi.unified_ready);
init_waitqueue_head(&ar->wmi.tx_credits_wq);
- return 0;
+ return ret;
}
void ath10k_wmi_detach(struct ath10k *ar)
@@ -1237,7 +1376,8 @@ int ath10k_wmi_pdev_set_regdomain(struct ath10k *ar, u16 rd, u16 rd2g,
"wmi pdev regdomain rd %x rd2g %x rd5g %x ctl2g %x ctl5g %x\n",
rd, rd2g, rd5g, ctl2g, ctl5g);
- return ath10k_wmi_cmd_send(ar, skb, WMI_PDEV_SET_REGDOMAIN_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb,
+ ar->wmi.cmd->pdev_set_regdomain_cmdid);
}
int ath10k_wmi_pdev_set_channel(struct ath10k *ar,
@@ -1267,7 +1407,8 @@ int ath10k_wmi_pdev_set_channel(struct ath10k *ar,
"wmi set channel mode %d freq %d\n",
arg->mode, arg->freq);
- return ath10k_wmi_cmd_send(ar, skb, WMI_PDEV_SET_CHANNEL_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb,
+ ar->wmi.cmd->pdev_set_channel_cmdid);
}
int ath10k_wmi_pdev_suspend_target(struct ath10k *ar)
@@ -1282,7 +1423,7 @@ int ath10k_wmi_pdev_suspend_target(struct ath10k *ar)
cmd = (struct wmi_pdev_suspend_cmd *)skb->data;
cmd->suspend_opt = WMI_PDEV_SUSPEND;
- return ath10k_wmi_cmd_send(ar, skb, WMI_PDEV_SUSPEND_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->pdev_suspend_cmdid);
}
int ath10k_wmi_pdev_resume_target(struct ath10k *ar)
@@ -1293,7 +1434,7 @@ int ath10k_wmi_pdev_resume_target(struct ath10k *ar)
if (skb == NULL)
return -ENOMEM;
- return ath10k_wmi_cmd_send(ar, skb, WMI_PDEV_RESUME_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->pdev_resume_cmdid);
}
int ath10k_wmi_pdev_set_param(struct ath10k *ar, enum wmi_pdev_param id,
@@ -1312,7 +1453,7 @@ int ath10k_wmi_pdev_set_param(struct ath10k *ar, enum wmi_pdev_param id,
ath10k_dbg(ATH10K_DBG_WMI, "wmi pdev set param %d value %d\n",
id, value);
- return ath10k_wmi_cmd_send(ar, skb, WMI_PDEV_SET_PARAM_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->pdev_set_param_cmdid);
}
int ath10k_wmi_cmd_init(struct ath10k *ar)
@@ -1382,7 +1523,7 @@ int ath10k_wmi_cmd_init(struct ath10k *ar)
memcpy(&cmd->resource_config, &config, sizeof(config));
ath10k_dbg(ATH10K_DBG_WMI, "wmi init\n");
- return ath10k_wmi_cmd_send(ar, buf, WMI_INIT_CMDID);
+ return ath10k_wmi_cmd_send(ar, buf, ar->wmi.cmd->init_cmdid);
}
static int ath10k_wmi_start_scan_calc_len(const struct wmi_start_scan_arg *arg)
@@ -1543,7 +1684,7 @@ int ath10k_wmi_start_scan(struct ath10k *ar,
}
ath10k_dbg(ATH10K_DBG_WMI, "wmi start scan\n");
- return ath10k_wmi_cmd_send(ar, skb, WMI_START_SCAN_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->start_scan_cmdid);
}
void ath10k_wmi_start_scan_init(struct ath10k *ar,
@@ -1603,7 +1744,7 @@ int ath10k_wmi_stop_scan(struct ath10k *ar, const struct wmi_stop_scan_arg *arg)
ath10k_dbg(ATH10K_DBG_WMI,
"wmi stop scan reqid %d req_type %d vdev/scan_id %d\n",
arg->req_id, arg->req_type, arg->u.scan_id);
- return ath10k_wmi_cmd_send(ar, skb, WMI_STOP_SCAN_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->stop_scan_cmdid);
}
int ath10k_wmi_vdev_create(struct ath10k *ar, u32 vdev_id,
@@ -1628,7 +1769,7 @@ int ath10k_wmi_vdev_create(struct ath10k *ar, u32 vdev_id,
"WMI vdev create: id %d type %d subtype %d macaddr %pM\n",
vdev_id, type, subtype, macaddr);
- return ath10k_wmi_cmd_send(ar, skb, WMI_VDEV_CREATE_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->vdev_create_cmdid);
}
int ath10k_wmi_vdev_delete(struct ath10k *ar, u32 vdev_id)
@@ -1646,20 +1787,20 @@ int ath10k_wmi_vdev_delete(struct ath10k *ar, u32 vdev_id)
ath10k_dbg(ATH10K_DBG_WMI,
"WMI vdev delete id %d\n", vdev_id);
- return ath10k_wmi_cmd_send(ar, skb, WMI_VDEV_DELETE_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->vdev_delete_cmdid);
}
static int ath10k_wmi_vdev_start_restart(struct ath10k *ar,
const struct wmi_vdev_start_request_arg *arg,
- enum wmi_cmd_id cmd_id)
+ u32 cmd_id)
{
struct wmi_vdev_start_request_cmd *cmd;
struct sk_buff *skb;
const char *cmdname;
u32 flags = 0;
- if (cmd_id != WMI_VDEV_START_REQUEST_CMDID &&
- cmd_id != WMI_VDEV_RESTART_REQUEST_CMDID)
+ if (cmd_id != ar->wmi.cmd->vdev_start_request_cmdid &&
+ cmd_id != ar->wmi.cmd->vdev_restart_request_cmdid)
return -EINVAL;
if (WARN_ON(arg->ssid && arg->ssid_len == 0))
return -EINVAL;
@@ -1668,9 +1809,9 @@ static int ath10k_wmi_vdev_start_restart(struct ath10k *ar,
if (WARN_ON(arg->ssid_len > sizeof(cmd->ssid.ssid)))
return -EINVAL;
- if (cmd_id == WMI_VDEV_START_REQUEST_CMDID)
+ if (cmd_id == ar->wmi.cmd->vdev_start_request_cmdid)
cmdname = "start";
- else if (cmd_id == WMI_VDEV_RESTART_REQUEST_CMDID)
+ else if (cmd_id == ar->wmi.cmd->vdev_restart_request_cmdid)
cmdname = "restart";
else
return -EINVAL; /* should not happen, we already check cmd_id */
@@ -1721,15 +1862,17 @@ static int ath10k_wmi_vdev_start_restart(struct ath10k *ar,
int ath10k_wmi_vdev_start(struct ath10k *ar,
const struct wmi_vdev_start_request_arg *arg)
{
- return ath10k_wmi_vdev_start_restart(ar, arg,
- WMI_VDEV_START_REQUEST_CMDID);
+ u32 cmd_id = ar->wmi.cmd->vdev_start_request_cmdid;
+
+ return ath10k_wmi_vdev_start_restart(ar, arg, cmd_id);
}
int ath10k_wmi_vdev_restart(struct ath10k *ar,
const struct wmi_vdev_start_request_arg *arg)
{
- return ath10k_wmi_vdev_start_restart(ar, arg,
- WMI_VDEV_RESTART_REQUEST_CMDID);
+ u32 cmd_id = ar->wmi.cmd->vdev_restart_request_cmdid;
+
+ return ath10k_wmi_vdev_start_restart(ar, arg, cmd_id);
}
int ath10k_wmi_vdev_stop(struct ath10k *ar, u32 vdev_id)
@@ -1746,7 +1889,7 @@ int ath10k_wmi_vdev_stop(struct ath10k *ar, u32 vdev_id)
ath10k_dbg(ATH10K_DBG_WMI, "wmi vdev stop id 0x%x\n", vdev_id);
- return ath10k_wmi_cmd_send(ar, skb, WMI_VDEV_STOP_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->vdev_stop_cmdid);
}
int ath10k_wmi_vdev_up(struct ath10k *ar, u32 vdev_id, u32 aid, const u8 *bssid)
@@ -1767,7 +1910,7 @@ int ath10k_wmi_vdev_up(struct ath10k *ar, u32 vdev_id, u32 aid, const u8 *bssid)
"wmi mgmt vdev up id 0x%x assoc id %d bssid %pM\n",
vdev_id, aid, bssid);
- return ath10k_wmi_cmd_send(ar, skb, WMI_VDEV_UP_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->vdev_up_cmdid);
}
int ath10k_wmi_vdev_down(struct ath10k *ar, u32 vdev_id)
@@ -1785,7 +1928,7 @@ int ath10k_wmi_vdev_down(struct ath10k *ar, u32 vdev_id)
ath10k_dbg(ATH10K_DBG_WMI,
"wmi mgmt vdev down id 0x%x\n", vdev_id);
- return ath10k_wmi_cmd_send(ar, skb, WMI_VDEV_DOWN_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->vdev_down_cmdid);
}
int ath10k_wmi_vdev_set_param(struct ath10k *ar, u32 vdev_id,
@@ -1807,7 +1950,7 @@ int ath10k_wmi_vdev_set_param(struct ath10k *ar, u32 vdev_id,
"wmi vdev id 0x%x set param %d value %d\n",
vdev_id, param_id, param_value);
- return ath10k_wmi_cmd_send(ar, skb, WMI_VDEV_SET_PARAM_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->vdev_set_param_cmdid);
}
int ath10k_wmi_vdev_install_key(struct ath10k *ar,
@@ -1842,7 +1985,8 @@ int ath10k_wmi_vdev_install_key(struct ath10k *ar,
ath10k_dbg(ATH10K_DBG_WMI,
"wmi vdev install key idx %d cipher %d len %d\n",
arg->key_idx, arg->key_cipher, arg->key_len);
- return ath10k_wmi_cmd_send(ar, skb, WMI_VDEV_INSTALL_KEY_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb,
+ ar->wmi.cmd->vdev_install_key_cmdid);
}
int ath10k_wmi_peer_create(struct ath10k *ar, u32 vdev_id,
@@ -1862,7 +2006,7 @@ int ath10k_wmi_peer_create(struct ath10k *ar, u32 vdev_id,
ath10k_dbg(ATH10K_DBG_WMI,
"wmi peer create vdev_id %d peer_addr %pM\n",
vdev_id, peer_addr);
- return ath10k_wmi_cmd_send(ar, skb, WMI_PEER_CREATE_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->peer_create_cmdid);
}
int ath10k_wmi_peer_delete(struct ath10k *ar, u32 vdev_id,
@@ -1882,7 +2026,7 @@ int ath10k_wmi_peer_delete(struct ath10k *ar, u32 vdev_id,
ath10k_dbg(ATH10K_DBG_WMI,
"wmi peer delete vdev_id %d peer_addr %pM\n",
vdev_id, peer_addr);
- return ath10k_wmi_cmd_send(ar, skb, WMI_PEER_DELETE_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->peer_delete_cmdid);
}
int ath10k_wmi_peer_flush(struct ath10k *ar, u32 vdev_id,
@@ -1903,7 +2047,7 @@ int ath10k_wmi_peer_flush(struct ath10k *ar, u32 vdev_id,
ath10k_dbg(ATH10K_DBG_WMI,
"wmi peer flush vdev_id %d peer_addr %pM tids %08x\n",
vdev_id, peer_addr, tid_bitmap);
- return ath10k_wmi_cmd_send(ar, skb, WMI_PEER_FLUSH_TIDS_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->peer_flush_tids_cmdid);
}
int ath10k_wmi_peer_set_param(struct ath10k *ar, u32 vdev_id,
@@ -1927,7 +2071,7 @@ int ath10k_wmi_peer_set_param(struct ath10k *ar, u32 vdev_id,
"wmi vdev %d peer 0x%pM set param %d value %d\n",
vdev_id, peer_addr, param_id, param_value);
- return ath10k_wmi_cmd_send(ar, skb, WMI_PEER_SET_PARAM_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->peer_set_param_cmdid);
}
int ath10k_wmi_set_psmode(struct ath10k *ar, u32 vdev_id,
@@ -1948,7 +2092,8 @@ int ath10k_wmi_set_psmode(struct ath10k *ar, u32 vdev_id,
"wmi set powersave id 0x%x mode %d\n",
vdev_id, psmode);
- return ath10k_wmi_cmd_send(ar, skb, WMI_STA_POWERSAVE_MODE_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb,
+ ar->wmi.cmd->sta_powersave_mode_cmdid);
}
int ath10k_wmi_set_sta_ps_param(struct ath10k *ar, u32 vdev_id,
@@ -1970,7 +2115,8 @@ int ath10k_wmi_set_sta_ps_param(struct ath10k *ar, u32 vdev_id,
ath10k_dbg(ATH10K_DBG_WMI,
"wmi sta ps param vdev_id 0x%x param %d value %d\n",
vdev_id, param_id, value);
- return ath10k_wmi_cmd_send(ar, skb, WMI_STA_POWERSAVE_PARAM_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb,
+ ar->wmi.cmd->sta_powersave_param_cmdid);
}
int ath10k_wmi_set_ap_ps_param(struct ath10k *ar, u32 vdev_id, const u8 *mac,
@@ -1996,7 +2142,8 @@ int ath10k_wmi_set_ap_ps_param(struct ath10k *ar, u32 vdev_id, const u8 *mac,
"wmi ap ps param vdev_id 0x%X param %d value %d mac_addr %pM\n",
vdev_id, param_id, value, mac);
- return ath10k_wmi_cmd_send(ar, skb, WMI_AP_PS_PEER_PARAM_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb,
+ ar->wmi.cmd->ap_ps_peer_param_cmdid);
}
int ath10k_wmi_scan_chan_list(struct ath10k *ar,
@@ -2049,7 +2196,7 @@ int ath10k_wmi_scan_chan_list(struct ath10k *ar,
ci->flags |= __cpu_to_le32(flags);
}
- return ath10k_wmi_cmd_send(ar, skb, WMI_SCAN_CHAN_LIST_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->scan_chan_list_cmdid);
}
int ath10k_wmi_peer_assoc(struct ath10k *ar,
@@ -2108,7 +2255,7 @@ int ath10k_wmi_peer_assoc(struct ath10k *ar,
ath10k_dbg(ATH10K_DBG_WMI,
"wmi peer assoc vdev %d addr %pM\n",
arg->vdev_id, arg->addr);
- return ath10k_wmi_cmd_send(ar, skb, WMI_PEER_ASSOC_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->peer_assoc_cmdid);
}
int ath10k_wmi_beacon_send_nowait(struct ath10k *ar,
@@ -2128,7 +2275,7 @@ int ath10k_wmi_beacon_send_nowait(struct ath10k *ar,
cmd->hdr.bcn_len = __cpu_to_le32(arg->bcn_len);
memcpy(cmd->bcn, arg->bcn, arg->bcn_len);
- return ath10k_wmi_cmd_send_nowait(ar, skb, WMI_BCN_TX_CMDID);
+ return ath10k_wmi_cmd_send_nowait(ar, skb, ar->wmi.cmd->bcn_tx_cmdid);
}
static void ath10k_wmi_pdev_set_wmm_param(struct wmi_wmm_params *params,
@@ -2159,7 +2306,8 @@ int ath10k_wmi_pdev_set_wmm_params(struct ath10k *ar,
ath10k_wmi_pdev_set_wmm_param(&cmd->ac_vo, &arg->ac_vo);
ath10k_dbg(ATH10K_DBG_WMI, "wmi pdev set wmm params\n");
- return ath10k_wmi_cmd_send(ar, skb, WMI_PDEV_SET_WMM_PARAMS_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb,
+ ar->wmi.cmd->pdev_set_wmm_params_cmdid);
}
int ath10k_wmi_request_stats(struct ath10k *ar, enum wmi_stats_id stats_id)
@@ -2175,7 +2323,7 @@ int ath10k_wmi_request_stats(struct ath10k *ar, enum wmi_stats_id stats_id)
cmd->stats_id = __cpu_to_le32(stats_id);
ath10k_dbg(ATH10K_DBG_WMI, "wmi request stats %d\n", (int)stats_id);
- return ath10k_wmi_cmd_send(ar, skb, WMI_REQUEST_STATS_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->request_stats_cmdid);
}
int ath10k_wmi_force_fw_hang(struct ath10k *ar,
@@ -2194,5 +2342,5 @@ int ath10k_wmi_force_fw_hang(struct ath10k *ar,
ath10k_dbg(ATH10K_DBG_WMI, "wmi force fw hang %d delay %d\n",
type, delay_ms);
- return ath10k_wmi_cmd_send(ar, skb, WMI_FORCE_FW_HANG_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->force_fw_hang_cmdid);
}
diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h
index 2c52c23..b8b446a 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.h
+++ b/drivers/net/wireless/ath/ath10k/wmi.h
@@ -208,6 +208,118 @@ struct wmi_mac_addr {
(c_macaddr)[5] = (((pwmi_mac_addr)->word1) >> 8) & 0xff; \
} while (0)
+struct wmi_cmd_map {
+ u32 init_cmdid;
+ u32 start_scan_cmdid;
+ u32 stop_scan_cmdid;
+ u32 scan_chan_list_cmdid;
+ u32 scan_sch_prio_tbl_cmdid;
+ u32 pdev_set_regdomain_cmdid;
+ u32 pdev_set_channel_cmdid;
+ u32 pdev_set_param_cmdid;
+ u32 pdev_pktlog_enable_cmdid;
+ u32 pdev_pktlog_disable_cmdid;
+ u32 pdev_set_wmm_params_cmdid;
+ u32 pdev_set_ht_cap_ie_cmdid;
+ u32 pdev_set_vht_cap_ie_cmdid;
+ u32 pdev_set_dscp_tid_map_cmdid;
+ u32 pdev_set_quiet_mode_cmdid;
+ u32 pdev_green_ap_ps_enable_cmdid;
+ u32 pdev_get_tpc_config_cmdid;
+ u32 pdev_set_base_macaddr_cmdid;
+ u32 vdev_create_cmdid;
+ u32 vdev_delete_cmdid;
+ u32 vdev_start_request_cmdid;
+ u32 vdev_restart_request_cmdid;
+ u32 vdev_up_cmdid;
+ u32 vdev_stop_cmdid;
+ u32 vdev_down_cmdid;
+ u32 vdev_set_param_cmdid;
+ u32 vdev_install_key_cmdid;
+ u32 peer_create_cmdid;
+ u32 peer_delete_cmdid;
+ u32 peer_flush_tids_cmdid;
+ u32 peer_set_param_cmdid;
+ u32 peer_assoc_cmdid;
+ u32 peer_add_wds_entry_cmdid;
+ u32 peer_remove_wds_entry_cmdid;
+ u32 peer_mcast_group_cmdid;
+ u32 bcn_tx_cmdid;
+ u32 pdev_send_bcn_cmdid;
+ u32 bcn_tmpl_cmdid;
+ u32 bcn_filter_rx_cmdid;
+ u32 prb_req_filter_rx_cmdid;
+ u32 mgmt_tx_cmdid;
+ u32 prb_tmpl_cmdid;
+ u32 addba_clear_resp_cmdid;
+ u32 addba_send_cmdid;
+ u32 addba_status_cmdid;
+ u32 delba_send_cmdid;
+ u32 addba_set_resp_cmdid;
+ u32 send_singleamsdu_cmdid;
+ u32 sta_powersave_mode_cmdid;
+ u32 sta_powersave_param_cmdid;
+ u32 sta_mimo_ps_mode_cmdid;
+ u32 pdev_dfs_enable_cmdid;
+ u32 pdev_dfs_disable_cmdid;
+ u32 roam_scan_mode;
+ u32 roam_scan_rssi_threshold;
+ u32 roam_scan_period;
+ u32 roam_scan_rssi_change_threshold;
+ u32 roam_ap_profile;
+ u32 ofl_scan_add_ap_profile;
+ u32 ofl_scan_remove_ap_profile;
+ u32 ofl_scan_period;
+ u32 p2p_dev_set_device_info;
+ u32 p2p_dev_set_discoverability;
+ u32 p2p_go_set_beacon_ie;
+ u32 p2p_go_set_probe_resp_ie;
+ u32 p2p_set_vendor_ie_data_cmdid;
+ u32 ap_ps_peer_param_cmdid;
+ u32 ap_ps_peer_uapsd_coex_cmdid;
+ u32 peer_rate_retry_sched_cmdid;
+ u32 wlan_profile_trigger_cmdid;
+ u32 wlan_profile_set_hist_intvl_cmdid;
+ u32 wlan_profile_get_profile_data_cmdid;
+ u32 wlan_profile_enable_profile_id_cmdid;
+ u32 wlan_profile_list_profile_id_cmdid;
+ u32 pdev_suspend_cmdid;
+ u32 pdev_resume_cmdid;
+ u32 add_bcn_filter_cmdid;
+ u32 rmv_bcn_filter_cmdid;
+ u32 wow_add_wake_pattern_cmdid;
+ u32 wow_del_wake_pattern_cmdid;
+ u32 wow_enable_disable_wake_event_cmdid;
+ u32 wow_enable_cmdid;
+ u32 wow_hostwakeup_from_sleep_cmdid;
+ u32 rtt_measreq_cmdid;
+ u32 rtt_tsf_cmdid;
+ u32 vdev_spectral_scan_configure_cmdid;
+ u32 vdev_spectral_scan_enable_cmdid;
+ u32 request_stats_cmdid;
+ u32 set_arp_ns_offload_cmdid;
+ u32 network_list_offload_config_cmdid;
+ u32 gtk_offload_cmdid;
+ u32 csa_offload_enable_cmdid;
+ u32 csa_offload_chanswitch_cmdid;
+ u32 chatter_set_mode_cmdid;
+ u32 peer_tid_addba_cmdid;
+ u32 peer_tid_delba_cmdid;
+ u32 sta_dtim_ps_method_cmdid;
+ u32 sta_uapsd_auto_trig_cmdid;
+ u32 sta_keepalive_cmd;
+ u32 echo_cmdid;
+ u32 pdev_utf_cmdid;
+ u32 dbglog_cfg_cmdid;
+ u32 pdev_qvit_cmdid;
+ u32 pdev_ftm_intg_cmdid;
+ u32 vdev_set_keepalive_cmdid;
+ u32 vdev_get_keepalive_cmdid;
+ u32 force_fw_hang_cmdid;
+ u32 gpio_config_cmdid;
+ u32 gpio_output_cmdid;
+};
+
/*
* wmi command groups.
*/
--
1.7.10
^ permalink raw reply related
* [PATCH v2 00/13] ath10k: dual-firmware support (MAIN and 10.X)
From: Bartosz Markowski @ 2013-09-26 9:29 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Bartosz Markowski
This patch-set adds framework for dynamic support of 10.X FW branch.
The major changes covered by this work:
* dynamic WMI structures
* WMI cmd/event definitions from 10.x FW track
* memory host chunks feature
* management frames path over WMI for 10.x
* WMI RX events handling for MAIN and 10.X split
* target config split (LARGE AP feature for 10.x)
* scan start sctructure split
* dynamic VDEV and PDEV parameters structures
Changes in v2
(review comments from Kalle and Michal):
* WMI cmd, pdev and vdev params names trimmed
* ath10k_wmi_cmd_init() exposed only
* few 'if' statements simplifications
* 10.x mgmt frames over WMI - 'BUG: scheduling while atomic' fixed
Bartosz Markowski (13):
ath10k: introduce dynamic WMI structures
ath10k: add wmi_10x_<cmd/event> definitions
ath10k: warn if give WMI command is not supported
ath10k: implement WMI events handling frame for both firmwares
ath10k: split ath10k_wmi_service_ready_event_rx
ath10k: drop the fw versioning sanity check
ath10k: implement host memory chunks
ath10k: bring back the WMI path for mgmt frames
ath10k: split wmi_cmd_init path
ath10k: add TARGET values for 10.x firmware
ath10k: introduce dynamic vdev parameters
ath10k: introduce dynamic pdev parameters
ath10k: handle FW API differences for scan structures
drivers/net/wireless/ath/ath10k/core.c | 28 +-
drivers/net/wireless/ath/ath10k/core.h | 28 +-
drivers/net/wireless/ath/ath10k/htt_tx.c | 4 +-
drivers/net/wireless/ath/ath10k/hw.h | 37 +-
drivers/net/wireless/ath/ath10k/mac.c | 133 +++-
drivers/net/wireless/ath/ath10k/mac.h | 2 +
drivers/net/wireless/ath/ath10k/wmi.c | 1085 ++++++++++++++++++++++++++++--
drivers/net/wireless/ath/ath10k/wmi.h | 968 +++++++++++++++++++++++++-
8 files changed, 2158 insertions(+), 127 deletions(-)
--
1.7.10
^ permalink raw reply
* Re: [PATCH 01/13] ath10k: introduce dynamic WMI structures
From: Kalle Valo @ 2013-09-26 9:07 UTC (permalink / raw)
To: Michal Kazior; +Cc: Bartosz Markowski, ath10k, linux-wireless
In-Reply-To: <CA+BoTQk98WwdqyVtyHy9A1Z5kWgmkC6sHVjgaQNbrRLfm8YSiA@mail.gmail.com>
Michal Kazior <michal.kazior@tieto.com> writes:
> On 26 September 2013 10:54, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
>> Bartosz Markowski <bartosz.markowski@tieto.com> writes:
>>
>>> @@ -1293,7 +1438,8 @@ int ath10k_wmi_pdev_resume_target(struct ath10k *ar)
>>> if (skb == NULL)
>>> return -ENOMEM;
>>>
>>> - return ath10k_wmi_cmd_send(ar, skb, WMI_PDEV_RESUME_CMDID);
>>> + return ath10k_wmi_cmd_send(ar, skb,
>>> + ar->wmi.cmd->wmi_pdev_resume_cmdid);
>>> }
>>
>> I was thinking of adding a macro WMI_PDEV_RESUME_CMDID(ar) for all
>> dynamic wmi ids, that way it would look as closely as possible with the
>> original code. But I'm not sure if that makes sense anymore. Thoughts?
>
> Seems like an unnecessary indirection to me. You still need to have
> the mapping structure, unless you want to use macro concatenation (##)
> instead.
Yeah, there's no real benefit from the macro.
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH 07/13] ath10k: implement host memory chunks
From: Kalle Valo @ 2013-09-26 9:04 UTC (permalink / raw)
To: Bartosz Markowski; +Cc: ath10k, linux-wireless
In-Reply-To: <1380101891-18312-8-git-send-email-bartosz.markowski@tieto.com>
Bartosz Markowski <bartosz.markowski@tieto.com> writes:
> 10.X firmware can request a memory pool from host to offload
> it's own resources. This is a feature designed especially
> for AP mode where the target has to deal with large number
> of peers.
>
> So we allocate and map a consistent DMA memory which FW can
> use to store e.g. peer rate contol maps.
>
> Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
[...]
> + if (num_unit_info) {
> + if (num_unit_info & NUM_UNITS_IS_NUM_PEERS)
> + /* number of units to allocate is number of
> + * peers, 1 extra for self peer on target */
> + /* this needs to be tied, host and target
> + * can get out of sync */
> + num_units = TARGET_NUM_PEERS + 1;
> + if (num_unit_info & NUM_UNITS_IS_NUM_VDEVS)
> + num_units = TARGET_NUM_VDEVS + 1;
> + }
The outer if test looks useless. I think this can be simplified to just:
if (num_unit_info & NUM_UNITS_IS_NUM_PEERS)
....
else if (num_unit_info & NUM_UNITS_IS_NUM_VDEVS)
...
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH 01/13] ath10k: introduce dynamic WMI structures
From: Michal Kazior @ 2013-09-26 9:03 UTC (permalink / raw)
To: Kalle Valo; +Cc: Bartosz Markowski, ath10k, linux-wireless
In-Reply-To: <87ob7grmhv.fsf@kamboji.qca.qualcomm.com>
On 26 September 2013 10:54, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
> Bartosz Markowski <bartosz.markowski@tieto.com> writes:
>
>> This is the initial framework to implement dynamic
>> WMI API in order to support new firmware (from so
>> called 10.X branch)
>>
>> The realization is to have a static WMI cmd map for
>> each of the firmwares, registered upom wmi init.
>>
>> This patch creates such map for MAIN FW, updates
>> wmi_cmd_send() calls to take as a parameter
>> the map value instead of direct WMI enum.
>>
>> As soon as complete 10.X API will be on place,
>> we will introduce the FW IE mechanics to dynamicaly
>> identify which FW is being used and based on that
>> we will use correct map, API, structures, etc.
>>
>> Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
>> ---
>
> [...]
>
>> @@ -1293,7 +1438,8 @@ int ath10k_wmi_pdev_resume_target(struct ath10k *ar)
>> if (skb == NULL)
>> return -ENOMEM;
>>
>> - return ath10k_wmi_cmd_send(ar, skb, WMI_PDEV_RESUME_CMDID);
>> + return ath10k_wmi_cmd_send(ar, skb,
>> + ar->wmi.cmd->wmi_pdev_resume_cmdid);
>> }
>
> I was thinking of adding a macro WMI_PDEV_RESUME_CMDID(ar) for all
> dynamic wmi ids, that way it would look as closely as possible with the
> original code. But I'm not sure if that makes sense anymore. Thoughts?
Seems like an unnecessary indirection to me. You still need to have
the mapping structure, unless you want to use macro concatenation (##)
instead.
Michał.
^ permalink raw reply
* Re: [PATCH 01/13] ath10k: introduce dynamic WMI structures
From: Kalle Valo @ 2013-09-26 8:54 UTC (permalink / raw)
To: Bartosz Markowski; +Cc: ath10k, linux-wireless
In-Reply-To: <1380101891-18312-2-git-send-email-bartosz.markowski@tieto.com>
Bartosz Markowski <bartosz.markowski@tieto.com> writes:
> This is the initial framework to implement dynamic
> WMI API in order to support new firmware (from so
> called 10.X branch)
>
> The realization is to have a static WMI cmd map for
> each of the firmwares, registered upom wmi init.
>
> This patch creates such map for MAIN FW, updates
> wmi_cmd_send() calls to take as a parameter
> the map value instead of direct WMI enum.
>
> As soon as complete 10.X API will be on place,
> we will introduce the FW IE mechanics to dynamicaly
> identify which FW is being used and based on that
> we will use correct map, API, structures, etc.
>
> Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
> ---
[...]
> @@ -1293,7 +1438,8 @@ int ath10k_wmi_pdev_resume_target(struct ath10k *ar)
> if (skb == NULL)
> return -ENOMEM;
>
> - return ath10k_wmi_cmd_send(ar, skb, WMI_PDEV_RESUME_CMDID);
> + return ath10k_wmi_cmd_send(ar, skb,
> + ar->wmi.cmd->wmi_pdev_resume_cmdid);
> }
I was thinking of adding a macro WMI_PDEV_RESUME_CMDID(ar) for all
dynamic wmi ids, that way it would look as closely as possible with the
original code. But I'm not sure if that makes sense anymore. Thoughts?
--
Kalle Valo
^ permalink raw reply
* Re: bcma 3.12-rc1 scheduling while atomic
From: Daniel Borkmann @ 2013-09-26 8:17 UTC (permalink / raw)
To: Arend van Spriel
Cc: Dan Williams, linux-wireless, Hauke Mehrtens, John W. Linville
In-Reply-To: <5243E72A.4040108@broadcom.com>
On 09/26/2013 09:50 AM, Arend van Spriel wrote:
> On 09/25/2013 11:02 PM, Dan Williams wrote:
>> static int brcms_ops_start(struct ieee80211_hw *hw)
>> {
>> ...
>> spin_lock_bh(&wl->lock);
>> ...
>> err = brcms_up(wl);
>> <eventually calls usleep() from bcma_pcie_mdio_set_phy()>
>> ...
>> spin_unlock_bh(&wl->lock);
>> ...
>> }
>
> Hi Dan,
>
> I submitted two patches to John yesterday to address this.
>
> http://mid.gmane.org/1380103864-10447-3-git-send-email-arend@broadcom.com
> http://mid.gmane.org/1380103864-10447-4-git-send-email-arend@broadcom.com
Awesome, thanks !
> Regards,
> Arend
>
>> [ 7.607842] BUG: scheduling while atomic: NetworkManager/523/0x00000200
>> [ 7.607846] Modules linked in: arc4 brcmsmac cordic brcmutil b43 mac80211 nls_utf8 hfsplus snd_hda_codec_hdmi snd_hda_codec_cirrus cfg80211 i915 snd_hda_intel snd_hda_codec snd_hwdep ssb snd_seq snd_seq_device mmc_core snd_pcm joydev iTCO_wdt snd_page_alloc iTCO_vendor_support snd_timer uvcvideo x86_pkg_temp_thermal videobuf2_vmalloc videobuf2_memops videobuf2_core videodev snd coretemp kvm_intel kvm btusb bluetooth applesmc input_polldev crc32_pclmul crc32c_intel i2c_algo_bit media drm_kms_helper ghash_clmulni_intel soundcore drm rfkill microcode pcspkr bcm5974 lpc_ich mfd_core bcma i2c_i801 mei_me shpchp mei video apple_bl i2c_core
>> [ 7.607889] CPU: 0 PID: 523 Comm: NetworkManager Not tainted 3.12.0-rc1+ #3
>> [ 7.607891] Hardware name: Apple Inc. MacBookAir5,1/Mac-66F35F19FE2A0D05, BIOS MBA51.88Z.00EF.B02.1211271028 11/27/2012
>> [ 7.607893] ffff88026f214280 ffff880257751498 ffffffff81659c85 ffff8802577515d0
>> [ 7.607896] ffff8802577514a8 ffffffff81655f39 ffff880257751508 ffffffff8165e8a6
>> [ 7.607899] ffff880257751fd8 0000000000014280 ffff880257751fd8 0000000000014280
>> [ 7.607902] Call Trace:
>> [ 7.607910] [<ffffffff81659c85>] dump_stack+0x45/0x56
>> [ 7.607914] [<ffffffff81655f39>] __schedule_bug+0x4d/0x5b
>> [ 7.607918] [<ffffffff8165e8a6>] __schedule+0x746/0x750
>> [ 7.607922] [<ffffffff8165e8d9>] schedule+0x29/0x70
>> [ 7.607926] [<ffffffff8165dd0c>] schedule_hrtimeout_range_clock+0x12c/0x170
>> [ 7.607930] [<ffffffff8108cb00>] ? hrtimer_get_res+0x50/0x50
>> [ 7.607933] [<ffffffff8165dc8c>] ? schedule_hrtimeout_range_clock+0xac/0x170
>> [ 7.607936] [<ffffffff8165dd63>] schedule_hrtimeout_range+0x13/0x20
>> [ 7.607941] [<ffffffff81073bf0>] usleep_range+0x40/0x50
>> [ 7.607948] [<ffffffffa00603df>] bcma_pcie_mdio_set_phy.isra.3+0x4f/0x80 [bcma]
>> [ 7.607954] [<ffffffffa00605c7>] bcma_pcie_mdio_write.isra.5+0xc7/0xd0 [bcma]
>> [ 7.607960] [<ffffffffa00606aa>] bcma_pcie_mdio_writeread.isra.6.constprop.13+0x1a/0x30 [bcma]
>> [ 7.607965] [<ffffffffa00606fa>] bcma_core_pci_power_save+0x3a/0x70 [bcma]
>> [ 7.607971] [<ffffffffa0060869>] bcma_core_pci_up+0x29/0x60 [bcma]
>> [ 7.607981] [<ffffffffa05b55df>] brcms_c_up+0xff/0x440 [brcmsmac]
>> [ 7.607987] [<ffffffffa05ab242>] brcms_ops_start+0xf2/0x360 [brcmsmac]
>> [ 7.607999] [<ffffffffa042be3a>] ? cfg80211_netdev_notifier_call+0x40a/0x600 [cfg80211]
>> [ 7.608005] [<ffffffff815c9f48>] ? inetdev_event+0x38/0x510
>> [ 7.608019] [<ffffffffa04cda71>] ieee80211_do_open+0x2e1/0xd80 [mac80211]
>> [ 7.608022] [<ffffffff8166466c>] ? notifier_call_chain+0x4c/0x70
>> [ 7.608032] [<ffffffffa04ce579>] ieee80211_open+0x69/0x70 [mac80211]
>> [ 7.608036] [<ffffffff8155f14f>] __dev_open+0xbf/0x140
>> [ 7.608040] [<ffffffff8155f412>] __dev_change_flags+0x92/0x170
>> [ 7.608043] [<ffffffff8155f59d>] dev_change_flags+0x1d/0x60
>> [ 7.608047] [<ffffffff8156ca69>] do_setlink+0x339/0xa00
>> [ 7.608051] [<ffffffff8131f020>] ? __nla_put+0x20/0x30
>> [ 7.608063] [<ffffffffa044544c>] ? nl80211_send_wiphy+0x3fc/0x2470 [cfg80211]
>> [ 7.608066] [<ffffffff8131edd2>] ? nla_parse+0x32/0xe0
>> [ 7.608070] [<ffffffff8156dd94>] rtnl_newlink+0x394/0x5e0
>> [ 7.608075] [<ffffffff8129e63e>] ? selinux_capable+0x2e/0x40
>> [ 7.608079] [<ffffffff8156a769>] rtnetlink_rcv_msg+0x99/0x260
>> [ 7.608082] [<ffffffff8129b8c5>] ? sock_has_perm+0x75/0x90
>> [ 7.608085] [<ffffffff8156a6d0>] ? rtnetlink_rcv+0x30/0x30
>> [ 7.608089] [<ffffffff81589709>] netlink_rcv_skb+0xa9/0xc0
>> [ 7.608093] [<ffffffff8156a6c8>] rtnetlink_rcv+0x28/0x30
>> [ 7.608097] [<ffffffff81588d5d>] netlink_unicast+0xdd/0x190
>> [ 7.608100] [<ffffffff8158910f>] netlink_sendmsg+0x2ff/0x740
>> [ 7.608104] [<ffffffff81585d02>] ? netlink_seq_next+0x142/0x150
>> [ 7.608107] [<ffffffff8158707c>] ? netlink_recvmsg+0x1ec/0x390
>> [ 7.608112] [<ffffffff81544b9b>] sock_sendmsg+0x8b/0xc0
>> [ 7.608116] [<ffffffff8154488e>] ? move_addr_to_kernel.part.16+0x1e/0x60
>> [ 7.608120] [<ffffffff81545401>] ? move_addr_to_kernel+0x21/0x30
>> [ 7.608123] [<ffffffff815453cc>] ___sys_sendmsg+0x36c/0x380
>> [ 7.608127] [<ffffffff81544d95>] ? SYSC_sendto+0x175/0x1c0
>> [ 7.608131] [<ffffffff81545ad2>] __sys_sendmsg+0x42/0x80
>> [ 7.608134] [<ffffffff81545b22>] SyS_sendmsg+0x12/0x20
>> [ 7.608138] [<ffffffff81668c29>] system_call_fastpath+0x16/0x1b
>>
>>
>
>
^ permalink raw reply
* Re: [PATCH 09/13] ath10k: split wmi_cmd_init path
From: Kalle Valo @ 2013-09-26 8:15 UTC (permalink / raw)
To: Bartosz Markowski; +Cc: ath10k, linux-wireless
In-Reply-To: <1380101891-18312-10-git-send-email-bartosz.markowski@tieto.com>
Bartosz Markowski <bartosz.markowski@tieto.com> writes:
> Due to API differences in initialization structures for
> main and 10.x firmwares we need to split the wmi_init_cmd
> and wmi_resource_config structures.
>
> This will be usefull also when setting the correct TARGET values,
> like: number of peers, vdevs, pdevs etc.
>
> Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
> ---
> drivers/net/wireless/ath/ath10k/core.c | 6 +-
> drivers/net/wireless/ath/ath10k/wmi.c | 91 +++++++++++++++
> drivers/net/wireless/ath/ath10k/wmi.h | 196 ++++++++++++++++++++++++++++++++
> 3 files changed, 292 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
> index 31860a6..3a56715 100644
> --- a/drivers/net/wireless/ath/ath10k/core.c
> +++ b/drivers/net/wireless/ath/ath10k/core.c
> @@ -595,7 +595,11 @@ int ath10k_core_start(struct ath10k *ar)
>
> ath10k_info("firmware %s booted\n", ar->hw->wiphy->fw_version);
>
> - status = ath10k_wmi_cmd_init(ar);
> + if (test_bit(ATH10K_FW_FEATURE_10X, ar->fw_features))
> + status = ath10k_wmi_10x_cmd_init(ar);
> + else
> + status = ath10k_wmi_cmd_init(ar);
It's better to hide the feature check inside ath10k_wmi_cmd_init() and
then that function can just call ath10k_wmi_10x_cmd_init() or
ath10k_wmi_main_cmd_init() (or whatever naming would be approriate
here). So we only expose ath10k_wmi_cmd_init() outside of wmi.c.
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH 01/13] ath10k: introduce dynamic WMI structures
From: Kalle Valo @ 2013-09-26 8:12 UTC (permalink / raw)
To: Bartosz Markowski; +Cc: ath10k, linux-wireless
In-Reply-To: <1380101891-18312-2-git-send-email-bartosz.markowski@tieto.com>
Bartosz Markowski <bartosz.markowski@tieto.com> writes:
> This is the initial framework to implement dynamic
> WMI API in order to support new firmware (from so
> called 10.X branch)
>
> The realization is to have a static WMI cmd map for
> each of the firmwares, registered upom wmi init.
>
> This patch creates such map for MAIN FW, updates
> wmi_cmd_send() calls to take as a parameter
> the map value instead of direct WMI enum.
>
> As soon as complete 10.X API will be on place,
> we will introduce the FW IE mechanics to dynamicaly
> identify which FW is being used and based on that
> we will use correct map, API, structures, etc.
>
> Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
[...]
> @@ -268,6 +269,9 @@ enum ath10k_fw_features {
> /* wmi_mgmt_rx_hdr contains extra RSSI information */
> ATH10K_FW_FEATURE_EXT_WMI_MGMT_RX = 0,
>
> + /* firmware from 10X branch */
> + ATH10K_FW_FEATURE_10X = 1,
> +
As this feature bit seems to be only used related the WMI code, I think
it's better to rename it to ATH10K_FW_FEATURE_WMI_10X. Better to keep
the scope of feature bits as small as practically possible. That way
it's easier to disable features when the firmware interface changes.
--
Kalle Valo
^ permalink raw reply
* Re: bcma 3.12-rc1 scheduling while atomic
From: Arend van Spriel @ 2013-09-26 7:50 UTC (permalink / raw)
To: Dan Williams, linux-wireless
Cc: Daniel Borkmann, Hauke Mehrtens, John W. Linville
In-Reply-To: <1380142945.23272.42.camel@dcbw.foobar.com>
On 09/25/2013 11:02 PM, Dan Williams wrote:
> static int brcms_ops_start(struct ieee80211_hw *hw)
> {
> ...
> spin_lock_bh(&wl->lock);
> ...
> err = brcms_up(wl);
> <eventually calls usleep() from bcma_pcie_mdio_set_phy()>
> ...
> spin_unlock_bh(&wl->lock);
> ...
> }
Hi Dan,
I submitted two patches to John yesterday to address this.
http://mid.gmane.org/1380103864-10447-3-git-send-email-arend@broadcom.com
http://mid.gmane.org/1380103864-10447-4-git-send-email-arend@broadcom.com
Regards,
Arend
> [ 7.607842] BUG: scheduling while atomic: NetworkManager/523/0x00000200
> [ 7.607846] Modules linked in: arc4 brcmsmac cordic brcmutil b43 mac80211 nls_utf8 hfsplus snd_hda_codec_hdmi snd_hda_codec_cirrus cfg80211 i915 snd_hda_intel snd_hda_codec snd_hwdep ssb snd_seq snd_seq_device mmc_core snd_pcm joydev iTCO_wdt snd_page_alloc iTCO_vendor_support snd_timer uvcvideo x86_pkg_temp_thermal videobuf2_vmalloc videobuf2_memops videobuf2_core videodev snd coretemp kvm_intel kvm btusb bluetooth applesmc input_polldev crc32_pclmul crc32c_intel i2c_algo_bit media drm_kms_helper ghash_clmulni_intel soundcore drm rfkill microcode pcspkr bcm5974 lpc_ich mfd_core bcma i2c_i801 mei_me shpchp mei video apple_bl i2c_core
> [ 7.607889] CPU: 0 PID: 523 Comm: NetworkManager Not tainted 3.12.0-rc1+ #3
> [ 7.607891] Hardware name: Apple Inc. MacBookAir5,1/Mac-66F35F19FE2A0D05, BIOS MBA51.88Z.00EF.B02.1211271028 11/27/2012
> [ 7.607893] ffff88026f214280 ffff880257751498 ffffffff81659c85 ffff8802577515d0
> [ 7.607896] ffff8802577514a8 ffffffff81655f39 ffff880257751508 ffffffff8165e8a6
> [ 7.607899] ffff880257751fd8 0000000000014280 ffff880257751fd8 0000000000014280
> [ 7.607902] Call Trace:
> [ 7.607910] [<ffffffff81659c85>] dump_stack+0x45/0x56
> [ 7.607914] [<ffffffff81655f39>] __schedule_bug+0x4d/0x5b
> [ 7.607918] [<ffffffff8165e8a6>] __schedule+0x746/0x750
> [ 7.607922] [<ffffffff8165e8d9>] schedule+0x29/0x70
> [ 7.607926] [<ffffffff8165dd0c>] schedule_hrtimeout_range_clock+0x12c/0x170
> [ 7.607930] [<ffffffff8108cb00>] ? hrtimer_get_res+0x50/0x50
> [ 7.607933] [<ffffffff8165dc8c>] ? schedule_hrtimeout_range_clock+0xac/0x170
> [ 7.607936] [<ffffffff8165dd63>] schedule_hrtimeout_range+0x13/0x20
> [ 7.607941] [<ffffffff81073bf0>] usleep_range+0x40/0x50
> [ 7.607948] [<ffffffffa00603df>] bcma_pcie_mdio_set_phy.isra.3+0x4f/0x80 [bcma]
> [ 7.607954] [<ffffffffa00605c7>] bcma_pcie_mdio_write.isra.5+0xc7/0xd0 [bcma]
> [ 7.607960] [<ffffffffa00606aa>] bcma_pcie_mdio_writeread.isra.6.constprop.13+0x1a/0x30 [bcma]
> [ 7.607965] [<ffffffffa00606fa>] bcma_core_pci_power_save+0x3a/0x70 [bcma]
> [ 7.607971] [<ffffffffa0060869>] bcma_core_pci_up+0x29/0x60 [bcma]
> [ 7.607981] [<ffffffffa05b55df>] brcms_c_up+0xff/0x440 [brcmsmac]
> [ 7.607987] [<ffffffffa05ab242>] brcms_ops_start+0xf2/0x360 [brcmsmac]
> [ 7.607999] [<ffffffffa042be3a>] ? cfg80211_netdev_notifier_call+0x40a/0x600 [cfg80211]
> [ 7.608005] [<ffffffff815c9f48>] ? inetdev_event+0x38/0x510
> [ 7.608019] [<ffffffffa04cda71>] ieee80211_do_open+0x2e1/0xd80 [mac80211]
> [ 7.608022] [<ffffffff8166466c>] ? notifier_call_chain+0x4c/0x70
> [ 7.608032] [<ffffffffa04ce579>] ieee80211_open+0x69/0x70 [mac80211]
> [ 7.608036] [<ffffffff8155f14f>] __dev_open+0xbf/0x140
> [ 7.608040] [<ffffffff8155f412>] __dev_change_flags+0x92/0x170
> [ 7.608043] [<ffffffff8155f59d>] dev_change_flags+0x1d/0x60
> [ 7.608047] [<ffffffff8156ca69>] do_setlink+0x339/0xa00
> [ 7.608051] [<ffffffff8131f020>] ? __nla_put+0x20/0x30
> [ 7.608063] [<ffffffffa044544c>] ? nl80211_send_wiphy+0x3fc/0x2470 [cfg80211]
> [ 7.608066] [<ffffffff8131edd2>] ? nla_parse+0x32/0xe0
> [ 7.608070] [<ffffffff8156dd94>] rtnl_newlink+0x394/0x5e0
> [ 7.608075] [<ffffffff8129e63e>] ? selinux_capable+0x2e/0x40
> [ 7.608079] [<ffffffff8156a769>] rtnetlink_rcv_msg+0x99/0x260
> [ 7.608082] [<ffffffff8129b8c5>] ? sock_has_perm+0x75/0x90
> [ 7.608085] [<ffffffff8156a6d0>] ? rtnetlink_rcv+0x30/0x30
> [ 7.608089] [<ffffffff81589709>] netlink_rcv_skb+0xa9/0xc0
> [ 7.608093] [<ffffffff8156a6c8>] rtnetlink_rcv+0x28/0x30
> [ 7.608097] [<ffffffff81588d5d>] netlink_unicast+0xdd/0x190
> [ 7.608100] [<ffffffff8158910f>] netlink_sendmsg+0x2ff/0x740
> [ 7.608104] [<ffffffff81585d02>] ? netlink_seq_next+0x142/0x150
> [ 7.608107] [<ffffffff8158707c>] ? netlink_recvmsg+0x1ec/0x390
> [ 7.608112] [<ffffffff81544b9b>] sock_sendmsg+0x8b/0xc0
> [ 7.608116] [<ffffffff8154488e>] ? move_addr_to_kernel.part.16+0x1e/0x60
> [ 7.608120] [<ffffffff81545401>] ? move_addr_to_kernel+0x21/0x30
> [ 7.608123] [<ffffffff815453cc>] ___sys_sendmsg+0x36c/0x380
> [ 7.608127] [<ffffffff81544d95>] ? SYSC_sendto+0x175/0x1c0
> [ 7.608131] [<ffffffff81545ad2>] __sys_sendmsg+0x42/0x80
> [ 7.608134] [<ffffffff81545b22>] SyS_sendmsg+0x12/0x20
> [ 7.608138] [<ffffffff81668c29>] system_call_fastpath+0x16/0x1b
>
>
^ permalink raw reply
* Re: [PATCH 0/5] ath10k: improve RX performance
From: Michal Kazior @ 2013-09-26 7:45 UTC (permalink / raw)
To: Kalle Valo; +Cc: ath10k, linux-wireless
In-Reply-To: <87a9j0t5ep.fsf@kamboji.qca.qualcomm.com>
On 26 September 2013 09:21, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
> Michal Kazior <michal.kazior@tieto.com> writes:
>
>> This patchset gives clear RX performance
>> improvement on AP135. Throughput is at least
>> doubled (300mbps -> 600mbps, UDP RX, 2x2).
>>
>> This contains a workaround for
>> retransmission/duplication recovery.
>>
>> There's a pending patch for mac80211 that will
>> allow proper individiual A-MSDU subframe
>> reporting.
>>
>> Changes since RFC:
>> * comments fixes (Kalle)
>> * one patch extracted/split (Kalle)
>> * commit message adjustments
>>
>>
>> Michal Kazior (5):
>> ath10k: report A-MSDU subframes individually
>> ath10k: document decap modes
>> ath10k: cleanup RX decap handling
>> ath10k: fix Native Wifi decap mode RX
>> ath10k: align RX frames properly
>
> All five applies, thanks.
>
> There were few long lines, I fixed those myself. Can you please double
> check that I didn't break anything?
>
> Kalle
>
> For patch 1 I did:
>
> (...)
Looks good. Thanks!
Michał.
^ permalink raw reply
* [PATCH] cfg80211: Provision to pass probe response ie along with remain on channel request
From: Sreenath Sharma @ 2013-09-26 7:34 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, j
The probe response ie should be set in driver before the listen state
for a listen only P2P device. Right now probe response ie is set using
driver specific private command implementations. This commit enhances the
remain_on_channel command handler to pass probe response ie along with
rest of the arguments.
Another approach is the addition of a new nl80211 command specific to pass
ies to driver. This will give more flexibilty to upper layer.
Signed-off-by: Sreenath Sharma <sreenats@broadcom.com>
---
include/net/cfg80211.h | 24 +++++++++++++++++++++---
net/wireless/nl80211.c | 42 ++++++++++++++++++++++++++++++++++--------
net/wireless/rdev-ops.h | 11 +++++------
3 files changed, 60 insertions(+), 17 deletions(-)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index d530c54..71f7d84 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1425,6 +1425,26 @@ struct cfg80211_sched_scan_request {
};
/**
+ * struct cfg80211_roc_request - remain on channel request description
+ *
+ * @chandef: defines the channel to remain on
+ * @duration: duration in milliseconds that the driver intents to remain on the
+ * channel
+ * @ie: optional information element(s) to add into Probe Response or %NULL
+ * @ie_len: length of ie in octets
+ * @cookie: the request cookie to be filled by the driver
+ */
+struct cfg80211_roc_request {
+ struct cfg80211_chan_def chandef;
+ unsigned int duration;
+ const u8 *ie;
+ size_t ie_len;
+
+ /* keep last */
+ u64 *cookie;
+};
+
+/**
* enum cfg80211_signal_type - signal type
*
* @CFG80211_SIGNAL_TYPE_NONE: no signal strength information available
@@ -2313,9 +2333,7 @@ struct cfg80211_ops {
int (*remain_on_channel)(struct wiphy *wiphy,
struct wireless_dev *wdev,
- struct ieee80211_channel *chan,
- unsigned int duration,
- u64 *cookie);
+ struct cfg80211_roc_request *request);
int (*cancel_remain_on_channel)(struct wiphy *wiphy,
struct wireless_dev *wdev,
u64 cookie);
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index af8d84a..c0db346 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -7093,12 +7093,13 @@ static int nl80211_remain_on_channel(struct sk_buff *skb,
{
struct cfg80211_registered_device *rdev = info->user_ptr[0];
struct wireless_dev *wdev = info->user_ptr[1];
+ struct cfg80211_roc_request *request;
struct cfg80211_chan_def chandef;
struct sk_buff *msg;
void *hdr;
- u64 cookie;
u32 duration;
int err;
+ size_t ie_len;
if (!info->attrs[NL80211_ATTR_WIPHY_FREQ] ||
!info->attrs[NL80211_ATTR_DURATION])
@@ -7122,24 +7123,47 @@ static int nl80211_remain_on_channel(struct sk_buff *skb,
if (err)
return err;
- msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
- if (!msg)
+ if (info->attrs[NL80211_ATTR_IE])
+ ie_len = nla_len(info->attrs[NL80211_ATTR_IE]);
+ else
+ ie_len = 0;
+ if (ie_len > rdev->wiphy.max_scan_ie_len)
+ return -EINVAL;
+ request = kzalloc(sizeof(*request)
+ + sizeof(*request->cookie)
+ + ie_len, GFP_KERNEL);
+ if (!request)
return -ENOMEM;
+ memcpy(&request->chandef, &chandef, sizeof(request->chandef));
+ request->duration = duration;
+ if (ie_len) {
+ request->ie_len = ie_len;
+ request->ie = (void *)(request) + sizeof(*request);
+ memcpy((void *)request->ie,
+ nla_data(info->attrs[NL80211_ATTR_IE]),
+ request->ie_len);
+ request->cookie = (void *)(request->ie) + request->ie_len;
+ } else
+ request->cookie = (void *)(request) + sizeof(*request);
+ msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
+ if (!msg) {
+ err = -ENOMEM;
+ goto free_buf;
+ }
hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0,
NL80211_CMD_REMAIN_ON_CHANNEL);
- if (!hdr) {
- err = -ENOBUFS;
+ if (IS_ERR(hdr)) {
+ err = PTR_ERR(hdr);
goto free_msg;
}
- err = rdev_remain_on_channel(rdev, wdev, chandef.chan,
- duration, &cookie);
+ err = rdev_remain_on_channel(rdev, wdev, request);
if (err)
goto free_msg;
- if (nla_put_u64(msg, NL80211_ATTR_COOKIE, cookie))
+ if (nla_put_u64(msg, NL80211_ATTR_COOKIE, *request->cookie))
goto nla_put_failure;
genlmsg_end(msg, hdr);
@@ -7150,6 +7174,8 @@ static int nl80211_remain_on_channel(struct sk_buff *skb,
err = -ENOBUFS;
free_msg:
nlmsg_free(msg);
+ free_buf:
+ kfree(request);
return err;
}
diff --git a/net/wireless/rdev-ops.h b/net/wireless/rdev-ops.h
index 37ce9fd..e521116 100644
--- a/net/wireless/rdev-ops.h
+++ b/net/wireless/rdev-ops.h
@@ -600,14 +600,13 @@ static inline int rdev_flush_pmksa(struct cfg80211_registered_device *rdev,
static inline int
rdev_remain_on_channel(struct cfg80211_registered_device *rdev,
struct wireless_dev *wdev,
- struct ieee80211_channel *chan,
- unsigned int duration, u64 *cookie)
+ struct cfg80211_roc_request *request)
{
int ret;
- trace_rdev_remain_on_channel(&rdev->wiphy, wdev, chan, duration);
- ret = rdev->ops->remain_on_channel(&rdev->wiphy, wdev, chan,
- duration, cookie);
- trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie);
+ trace_rdev_remain_on_channel(&rdev->wiphy, wdev, request->chandef.chan,
+ request->duration);
+ ret = rdev->ops->remain_on_channel(&rdev->wiphy, wdev, request);
+ trace_rdev_return_int_cookie(&rdev->wiphy, ret, *request->cookie);
return ret;
}
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH 05/11] brcm80211: Remove extern from function prototypes
From: Arend van Spriel @ 2013-09-26 7:32 UTC (permalink / raw)
To: Joe Perches, netdev
Cc: David S. Miller, Brett Rudley, Franky (Zhenhui) Lin,
Hante Meuleman, John W. Linville, linux-wireless,
brcm80211-dev-list, linux-kernel
In-Reply-To: <9bd91f3c00bd8dd54339499a9253b31c6bac7c7b.1380137609.git.joe@perches.com>
On 09/25/2013 09:37 PM, Joe Perches wrote:
> There are a mix of function prototypes with and without extern
> in the kernel sources. Standardize on not using extern for
> function prototypes.
>
> Function prototypes don't need to be written with extern.
> extern is assumed by the compiler. Its use is as unnecessary as
> using auto to declare automatic/local variables in a block.
Acked-by: Arend van Spriel <arend@broadcom.com>
> Signed-off-by: Joe Perches <joe@perches.com>
As a side note, I submitted a patch to the wireless tree yesterday
adding a function prototype and I decided to ignore the checkpatch
warning and follow the convention in the header file (for now). So that
patch is going to collide with this one.
Regards,
Arend
> ---
> drivers/net/wireless/brcm80211/brcmfmac/dhd.h | 30 +-
> drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h | 27 +-
> .../net/wireless/brcm80211/brcmfmac/dhd_proto.h | 12 +-
> .../net/wireless/brcm80211/brcmfmac/sdio_chip.h | 23 +-
> .../net/wireless/brcm80211/brcmfmac/sdio_host.h | 92 +++--
> drivers/net/wireless/brcm80211/brcmsmac/aiutils.h | 18 +-
> drivers/net/wireless/brcm80211/brcmsmac/ampdu.h | 22 +-
> drivers/net/wireless/brcm80211/brcmsmac/antsel.h | 14 +-
> drivers/net/wireless/brcm80211/brcmsmac/channel.h | 20 +-
> .../net/wireless/brcm80211/brcmsmac/mac80211_if.h | 38 +--
> drivers/net/wireless/brcm80211/brcmsmac/main.h | 110 +++---
> .../net/wireless/brcm80211/brcmsmac/phy/phy_hal.h | 219 ++++++------
> .../net/wireless/brcm80211/brcmsmac/phy/phy_int.h | 371 ++++++++++-----------
> drivers/net/wireless/brcm80211/brcmsmac/phy_shim.h | 91 +++--
> drivers/net/wireless/brcm80211/brcmsmac/pmu.h | 4 +-
> drivers/net/wireless/brcm80211/brcmsmac/pub.h | 145 ++++----
> drivers/net/wireless/brcm80211/brcmsmac/rate.h | 48 ++-
> drivers/net/wireless/brcm80211/brcmsmac/stf.h | 31 +-
> .../net/wireless/brcm80211/brcmsmac/ucode_loader.h | 16 +-
> drivers/net/wireless/brcm80211/include/brcmu_d11.h | 2 +-
> .../net/wireless/brcm80211/include/brcmu_utils.h | 44 ++-
> 21 files changed, 644 insertions(+), 733 deletions(-)
>
> diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd.h b/drivers/net/wireless/brcm80211/brcmfmac/dhd.h
> index 2eb9e64..34af9d1 100644
> --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd.h
> +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd.h
> @@ -632,29 +632,29 @@ struct brcmf_skb_reorder_data {
> u8 *reorder;
> };
>
> -extern int brcmf_netdev_wait_pend8021x(struct net_device *ndev);
> +int brcmf_netdev_wait_pend8021x(struct net_device *ndev);
>
> /* Return pointer to interface name */
> -extern char *brcmf_ifname(struct brcmf_pub *drvr, int idx);
> +char *brcmf_ifname(struct brcmf_pub *drvr, int idx);
>
> /* Query dongle */
> -extern int brcmf_proto_cdc_query_dcmd(struct brcmf_pub *drvr, int ifidx,
> - uint cmd, void *buf, uint len);
> -extern int brcmf_proto_cdc_set_dcmd(struct brcmf_pub *drvr, int ifidx, uint cmd,
> - void *buf, uint len);
> +int brcmf_proto_cdc_query_dcmd(struct brcmf_pub *drvr, int ifidx, uint cmd,
> + void *buf, uint len);
> +int brcmf_proto_cdc_set_dcmd(struct brcmf_pub *drvr, int ifidx, uint cmd,
> + void *buf, uint len);
>
> /* Remove any protocol-specific data header. */
> -extern int brcmf_proto_hdrpull(struct brcmf_pub *drvr, bool do_fws, u8 *ifidx,
> - struct sk_buff *rxp);
> +int brcmf_proto_hdrpull(struct brcmf_pub *drvr, bool do_fws, u8 *ifidx,
> + struct sk_buff *rxp);
>
> -extern int brcmf_net_attach(struct brcmf_if *ifp, bool rtnl_locked);
> -extern struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bssidx,
> - s32 ifidx, char *name, u8 *mac_addr);
> -extern void brcmf_del_if(struct brcmf_pub *drvr, s32 bssidx);
> +int brcmf_net_attach(struct brcmf_if *ifp, bool rtnl_locked);
> +struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bssidx, s32 ifidx,
> + char *name, u8 *mac_addr);
> +void brcmf_del_if(struct brcmf_pub *drvr, s32 bssidx);
> void brcmf_txflowblock_if(struct brcmf_if *ifp,
> enum brcmf_netif_stop_reason reason, bool state);
> -extern u32 brcmf_get_chip_info(struct brcmf_if *ifp);
> -extern void brcmf_txfinalize(struct brcmf_pub *drvr, struct sk_buff *txp,
> - bool success);
> +u32 brcmf_get_chip_info(struct brcmf_if *ifp);
> +void brcmf_txfinalize(struct brcmf_pub *drvr, struct sk_buff *txp,
> + bool success);
>
> #endif /* _BRCMF_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h b/drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h
> index f7c1985..5bc0276 100644
> --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h
> +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h
> @@ -132,34 +132,33 @@ struct pktq *brcmf_bus_gettxq(struct brcmf_bus *bus)
> * interface functions from common layer
> */
>
> -extern bool brcmf_c_prec_enq(struct device *dev, struct pktq *q,
> - struct sk_buff *pkt, int prec);
> +bool brcmf_c_prec_enq(struct device *dev, struct pktq *q, struct sk_buff *pkt,
> + int prec);
>
> /* Receive frame for delivery to OS. Callee disposes of rxp. */
> -extern void brcmf_rx_frames(struct device *dev, struct sk_buff_head *rxlist);
> +void brcmf_rx_frames(struct device *dev, struct sk_buff_head *rxlist);
>
> /* Indication from bus module regarding presence/insertion of dongle. */
> -extern int brcmf_attach(uint bus_hdrlen, struct device *dev);
> +int brcmf_attach(uint bus_hdrlen, struct device *dev);
> /* Indication from bus module regarding removal/absence of dongle */
> -extern void brcmf_detach(struct device *dev);
> +void brcmf_detach(struct device *dev);
> /* Indication from bus module that dongle should be reset */
> -extern void brcmf_dev_reset(struct device *dev);
> +void brcmf_dev_reset(struct device *dev);
> /* Indication from bus module to change flow-control state */
> -extern void brcmf_txflowblock(struct device *dev, bool state);
> +void brcmf_txflowblock(struct device *dev, bool state);
>
> /* Notify the bus has transferred the tx packet to firmware */
> -extern void brcmf_txcomplete(struct device *dev, struct sk_buff *txp,
> - bool success);
> +void brcmf_txcomplete(struct device *dev, struct sk_buff *txp, bool success);
>
> -extern int brcmf_bus_start(struct device *dev);
> +int brcmf_bus_start(struct device *dev);
>
> #ifdef CONFIG_BRCMFMAC_SDIO
> -extern void brcmf_sdio_exit(void);
> -extern void brcmf_sdio_init(void);
> +void brcmf_sdio_exit(void);
> +void brcmf_sdio_init(void);
> #endif
> #ifdef CONFIG_BRCMFMAC_USB
> -extern void brcmf_usb_exit(void);
> -extern void brcmf_usb_init(void);
> +void brcmf_usb_exit(void);
> +void brcmf_usb_init(void);
> #endif
>
> #endif /* _BRCMF_BUS_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_proto.h b/drivers/net/wireless/brcm80211/brcmfmac/dhd_proto.h
> index ef91798..53c6e71 100644
> --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_proto.h
> +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_proto.h
> @@ -22,21 +22,21 @@
> */
>
> /* Linkage, sets prot link and updates hdrlen in pub */
> -extern int brcmf_proto_attach(struct brcmf_pub *drvr);
> +int brcmf_proto_attach(struct brcmf_pub *drvr);
>
> /* Unlink, frees allocated protocol memory (including brcmf_proto) */
> -extern void brcmf_proto_detach(struct brcmf_pub *drvr);
> +void brcmf_proto_detach(struct brcmf_pub *drvr);
>
> /* Stop protocol: sync w/dongle state. */
> -extern void brcmf_proto_stop(struct brcmf_pub *drvr);
> +void brcmf_proto_stop(struct brcmf_pub *drvr);
>
> /* Add any protocol-specific data header.
> * Caller must reserve prot_hdrlen prepend space.
> */
> -extern void brcmf_proto_hdrpush(struct brcmf_pub *, int ifidx, u8 offset,
> - struct sk_buff *txp);
> +void brcmf_proto_hdrpush(struct brcmf_pub *, int ifidx, u8 offset,
> + struct sk_buff *txp);
>
> /* Sets dongle media info (drv_version, mac address). */
> -extern int brcmf_c_preinit_dcmds(struct brcmf_if *ifp);
> +int brcmf_c_preinit_dcmds(struct brcmf_if *ifp);
>
> #endif /* _BRCMF_PROTO_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.h b/drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.h
> index 83c041f..f0780ee 100644
> --- a/drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.h
> +++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.h
> @@ -215,17 +215,16 @@ struct sdpcmd_regs {
> u16 PAD[0x80];
> };
>
> -extern int brcmf_sdio_chip_attach(struct brcmf_sdio_dev *sdiodev,
> - struct chip_info **ci_ptr, u32 regs);
> -extern void brcmf_sdio_chip_detach(struct chip_info **ci_ptr);
> -extern void brcmf_sdio_chip_drivestrengthinit(struct brcmf_sdio_dev *sdiodev,
> - struct chip_info *ci,
> - u32 drivestrength);
> -extern u8 brcmf_sdio_chip_getinfidx(struct chip_info *ci, u16 coreid);
> -extern void brcmf_sdio_chip_enter_download(struct brcmf_sdio_dev *sdiodev,
> - struct chip_info *ci);
> -extern bool brcmf_sdio_chip_exit_download(struct brcmf_sdio_dev *sdiodev,
> - struct chip_info *ci, char *nvram_dat,
> - uint nvram_sz);
> +int brcmf_sdio_chip_attach(struct brcmf_sdio_dev *sdiodev,
> + struct chip_info **ci_ptr, u32 regs);
> +void brcmf_sdio_chip_detach(struct chip_info **ci_ptr);
> +void brcmf_sdio_chip_drivestrengthinit(struct brcmf_sdio_dev *sdiodev,
> + struct chip_info *ci, u32 drivestrength);
> +u8 brcmf_sdio_chip_getinfidx(struct chip_info *ci, u16 coreid);
> +void brcmf_sdio_chip_enter_download(struct brcmf_sdio_dev *sdiodev,
> + struct chip_info *ci);
> +bool brcmf_sdio_chip_exit_download(struct brcmf_sdio_dev *sdiodev,
> + struct chip_info *ci, char *nvram_dat,
> + uint nvram_sz);
>
> #endif /* _BRCMFMAC_SDIO_CHIP_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmfmac/sdio_host.h b/drivers/net/wireless/brcm80211/brcmfmac/sdio_host.h
> index 2b5407f..c9b06b4 100644
> --- a/drivers/net/wireless/brcm80211/brcmfmac/sdio_host.h
> +++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio_host.h
> @@ -181,18 +181,18 @@ struct brcmf_sdio_dev {
> };
>
> /* Register/deregister interrupt handler. */
> -extern int brcmf_sdio_intr_register(struct brcmf_sdio_dev *sdiodev);
> -extern int brcmf_sdio_intr_unregister(struct brcmf_sdio_dev *sdiodev);
> +int brcmf_sdio_intr_register(struct brcmf_sdio_dev *sdiodev);
> +int brcmf_sdio_intr_unregister(struct brcmf_sdio_dev *sdiodev);
>
> /* sdio device register access interface */
> -extern u8 brcmf_sdio_regrb(struct brcmf_sdio_dev *sdiodev, u32 addr, int *ret);
> -extern u32 brcmf_sdio_regrl(struct brcmf_sdio_dev *sdiodev, u32 addr, int *ret);
> -extern void brcmf_sdio_regwb(struct brcmf_sdio_dev *sdiodev, u32 addr,
> - u8 data, int *ret);
> -extern void brcmf_sdio_regwl(struct brcmf_sdio_dev *sdiodev, u32 addr,
> - u32 data, int *ret);
> -extern int brcmf_sdio_regrw_helper(struct brcmf_sdio_dev *sdiodev, u32 addr,
> - void *data, bool write);
> +u8 brcmf_sdio_regrb(struct brcmf_sdio_dev *sdiodev, u32 addr, int *ret);
> +u32 brcmf_sdio_regrl(struct brcmf_sdio_dev *sdiodev, u32 addr, int *ret);
> +void brcmf_sdio_regwb(struct brcmf_sdio_dev *sdiodev, u32 addr, u8 data,
> + int *ret);
> +void brcmf_sdio_regwl(struct brcmf_sdio_dev *sdiodev, u32 addr, u32 data,
> + int *ret);
> +int brcmf_sdio_regrw_helper(struct brcmf_sdio_dev *sdiodev, u32 addr,
> + void *data, bool write);
>
> /* Buffer transfer to/from device (client) core via cmd53.
> * fn: function number
> @@ -206,22 +206,17 @@ extern int brcmf_sdio_regrw_helper(struct brcmf_sdio_dev *sdiodev, u32 addr,
> * Returns 0 or error code.
> * NOTE: Async operation is not currently supported.
> */
> -extern int
> -brcmf_sdcard_send_pkt(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
> - uint flags, struct sk_buff_head *pktq);
> -extern int
> -brcmf_sdcard_send_buf(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
> - uint flags, u8 *buf, uint nbytes);
> -
> -extern int
> -brcmf_sdcard_recv_pkt(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
> - uint flags, struct sk_buff *pkt);
> -extern int
> -brcmf_sdcard_recv_buf(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
> - uint flags, u8 *buf, uint nbytes);
> -extern int
> -brcmf_sdcard_recv_chain(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
> - uint flags, struct sk_buff_head *pktq);
> +int brcmf_sdcard_send_pkt(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
> + uint flags, struct sk_buff_head *pktq);
> +int brcmf_sdcard_send_buf(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
> + uint flags, u8 *buf, uint nbytes);
> +
> +int brcmf_sdcard_recv_pkt(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
> + uint flags, struct sk_buff *pkt);
> +int brcmf_sdcard_recv_buf(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
> + uint flags, u8 *buf, uint nbytes);
> +int brcmf_sdcard_recv_chain(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
> + uint flags, struct sk_buff_head *pktq);
>
> /* Flags bits */
>
> @@ -237,46 +232,43 @@ brcmf_sdcard_recv_chain(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
> * nbytes: number of bytes to transfer to/from buf
> * Returns 0 or error code.
> */
> -extern int brcmf_sdcard_rwdata(struct brcmf_sdio_dev *sdiodev, uint rw,
> - u32 addr, u8 *buf, uint nbytes);
> -extern int brcmf_sdio_ramrw(struct brcmf_sdio_dev *sdiodev, bool write,
> - u32 address, u8 *data, uint size);
> +int brcmf_sdcard_rwdata(struct brcmf_sdio_dev *sdiodev, uint rw, u32 addr,
> + u8 *buf, uint nbytes);
> +int brcmf_sdio_ramrw(struct brcmf_sdio_dev *sdiodev, bool write, u32 address,
> + u8 *data, uint size);
>
> /* Issue an abort to the specified function */
> -extern int brcmf_sdcard_abort(struct brcmf_sdio_dev *sdiodev, uint fn);
> +int brcmf_sdcard_abort(struct brcmf_sdio_dev *sdiodev, uint fn);
>
> /* platform specific/high level functions */
> -extern int brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev);
> -extern int brcmf_sdio_remove(struct brcmf_sdio_dev *sdiodev);
> +int brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev);
> +int brcmf_sdio_remove(struct brcmf_sdio_dev *sdiodev);
>
> /* attach, return handler on success, NULL if failed.
> * The handler shall be provided by all subsequent calls. No local cache
> * cfghdl points to the starting address of pci device mapped memory
> */
> -extern int brcmf_sdioh_attach(struct brcmf_sdio_dev *sdiodev);
> -extern void brcmf_sdioh_detach(struct brcmf_sdio_dev *sdiodev);
> +int brcmf_sdioh_attach(struct brcmf_sdio_dev *sdiodev);
> +void brcmf_sdioh_detach(struct brcmf_sdio_dev *sdiodev);
>
> /* read or write one byte using cmd52 */
> -extern int brcmf_sdioh_request_byte(struct brcmf_sdio_dev *sdiodev, uint rw,
> - uint fnc, uint addr, u8 *byte);
> +int brcmf_sdioh_request_byte(struct brcmf_sdio_dev *sdiodev, uint rw, uint fnc,
> + uint addr, u8 *byte);
>
> /* read or write 2/4 bytes using cmd53 */
> -extern int
> -brcmf_sdioh_request_word(struct brcmf_sdio_dev *sdiodev,
> - uint rw, uint fnc, uint addr,
> - u32 *word, uint nbyte);
> +int brcmf_sdioh_request_word(struct brcmf_sdio_dev *sdiodev, uint rw, uint fnc,
> + uint addr, u32 *word, uint nbyte);
>
> /* Watchdog timer interface for pm ops */
> -extern void brcmf_sdio_wdtmr_enable(struct brcmf_sdio_dev *sdiodev,
> - bool enable);
> +void brcmf_sdio_wdtmr_enable(struct brcmf_sdio_dev *sdiodev, bool enable);
>
> -extern void *brcmf_sdbrcm_probe(u32 regsva, struct brcmf_sdio_dev *sdiodev);
> -extern void brcmf_sdbrcm_disconnect(void *ptr);
> -extern void brcmf_sdbrcm_isr(void *arg);
> +void *brcmf_sdbrcm_probe(u32 regsva, struct brcmf_sdio_dev *sdiodev);
> +void brcmf_sdbrcm_disconnect(void *ptr);
> +void brcmf_sdbrcm_isr(void *arg);
>
> -extern void brcmf_sdbrcm_wd_timer(struct brcmf_sdio *bus, uint wdtick);
> +void brcmf_sdbrcm_wd_timer(struct brcmf_sdio *bus, uint wdtick);
>
> -extern void brcmf_pm_resume_wait(struct brcmf_sdio_dev *sdiodev,
> - wait_queue_head_t *wq);
> -extern bool brcmf_pm_resume_error(struct brcmf_sdio_dev *sdiodev);
> +void brcmf_pm_resume_wait(struct brcmf_sdio_dev *sdiodev,
> + wait_queue_head_t *wq);
> +bool brcmf_pm_resume_error(struct brcmf_sdio_dev *sdiodev);
> #endif /* _BRCM_SDH_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h
> index a8a267b..2d08c15 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h
> @@ -172,19 +172,19 @@ struct si_info {
>
>
> /* AMBA Interconnect exported externs */
> -extern u32 ai_core_cflags(struct bcma_device *core, u32 mask, u32 val);
> +u32 ai_core_cflags(struct bcma_device *core, u32 mask, u32 val);
>
> /* === exported functions === */
> -extern struct si_pub *ai_attach(struct bcma_bus *pbus);
> -extern void ai_detach(struct si_pub *sih);
> -extern uint ai_cc_reg(struct si_pub *sih, uint regoff, u32 mask, u32 val);
> -extern void ai_clkctl_init(struct si_pub *sih);
> -extern u16 ai_clkctl_fast_pwrup_delay(struct si_pub *sih);
> -extern bool ai_clkctl_cc(struct si_pub *sih, enum bcma_clkmode mode);
> -extern bool ai_deviceremoved(struct si_pub *sih);
> +struct si_pub *ai_attach(struct bcma_bus *pbus);
> +void ai_detach(struct si_pub *sih);
> +uint ai_cc_reg(struct si_pub *sih, uint regoff, u32 mask, u32 val);
> +void ai_clkctl_init(struct si_pub *sih);
> +u16 ai_clkctl_fast_pwrup_delay(struct si_pub *sih);
> +bool ai_clkctl_cc(struct si_pub *sih, enum bcma_clkmode mode);
> +bool ai_deviceremoved(struct si_pub *sih);
>
> /* Enable Ex-PA for 4313 */
> -extern void ai_epa_4313war(struct si_pub *sih);
> +void ai_epa_4313war(struct si_pub *sih);
>
> static inline u32 ai_get_cccaps(struct si_pub *sih)
> {
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/ampdu.h b/drivers/net/wireless/brcm80211/brcmsmac/ampdu.h
> index 73d01e5..03bdcf2 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/ampdu.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/ampdu.h
> @@ -37,17 +37,17 @@ struct brcms_ampdu_session {
> u16 dma_len;
> };
>
> -extern void brcms_c_ampdu_reset_session(struct brcms_ampdu_session *session,
> - struct brcms_c_info *wlc);
> -extern int brcms_c_ampdu_add_frame(struct brcms_ampdu_session *session,
> - struct sk_buff *p);
> -extern void brcms_c_ampdu_finalize(struct brcms_ampdu_session *session);
> +void brcms_c_ampdu_reset_session(struct brcms_ampdu_session *session,
> + struct brcms_c_info *wlc);
> +int brcms_c_ampdu_add_frame(struct brcms_ampdu_session *session,
> + struct sk_buff *p);
> +void brcms_c_ampdu_finalize(struct brcms_ampdu_session *session);
>
> -extern struct ampdu_info *brcms_c_ampdu_attach(struct brcms_c_info *wlc);
> -extern void brcms_c_ampdu_detach(struct ampdu_info *ampdu);
> -extern void brcms_c_ampdu_dotxstatus(struct ampdu_info *ampdu, struct scb *scb,
> - struct sk_buff *p, struct tx_status *txs);
> -extern void brcms_c_ampdu_macaddr_upd(struct brcms_c_info *wlc);
> -extern void brcms_c_ampdu_shm_upd(struct ampdu_info *ampdu);
> +struct ampdu_info *brcms_c_ampdu_attach(struct brcms_c_info *wlc);
> +void brcms_c_ampdu_detach(struct ampdu_info *ampdu);
> +void brcms_c_ampdu_dotxstatus(struct ampdu_info *ampdu, struct scb *scb,
> + struct sk_buff *p, struct tx_status *txs);
> +void brcms_c_ampdu_macaddr_upd(struct brcms_c_info *wlc);
> +void brcms_c_ampdu_shm_upd(struct ampdu_info *ampdu);
>
> #endif /* _BRCM_AMPDU_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/antsel.h b/drivers/net/wireless/brcm80211/brcmsmac/antsel.h
> index 97ea388..a3d487a 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/antsel.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/antsel.h
> @@ -17,13 +17,11 @@
> #ifndef _BRCM_ANTSEL_H_
> #define _BRCM_ANTSEL_H_
>
> -extern struct antsel_info *brcms_c_antsel_attach(struct brcms_c_info *wlc);
> -extern void brcms_c_antsel_detach(struct antsel_info *asi);
> -extern void brcms_c_antsel_init(struct antsel_info *asi);
> -extern void brcms_c_antsel_antcfg_get(struct antsel_info *asi, bool usedef,
> - bool sel,
> - u8 id, u8 fbid, u8 *antcfg,
> - u8 *fbantcfg);
> -extern u8 brcms_c_antsel_antsel2id(struct antsel_info *asi, u16 antsel);
> +struct antsel_info *brcms_c_antsel_attach(struct brcms_c_info *wlc);
> +void brcms_c_antsel_detach(struct antsel_info *asi);
> +void brcms_c_antsel_init(struct antsel_info *asi);
> +void brcms_c_antsel_antcfg_get(struct antsel_info *asi, bool usedef, bool sel,
> + u8 id, u8 fbid, u8 *antcfg, u8 *fbantcfg);
> +u8 brcms_c_antsel_antsel2id(struct antsel_info *asi, u16 antsel);
>
> #endif /* _BRCM_ANTSEL_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/channel.h b/drivers/net/wireless/brcm80211/brcmsmac/channel.h
> index 006483a..39dd3a5 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/channel.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/channel.h
> @@ -32,20 +32,16 @@
>
> #define BRCMS_DFS_EU (BRCMS_DFS_TPC | BRCMS_RADAR_TYPE_EU) /* Flag for DFS EU */
>
> -extern struct brcms_cm_info *
> -brcms_c_channel_mgr_attach(struct brcms_c_info *wlc);
> +struct brcms_cm_info *brcms_c_channel_mgr_attach(struct brcms_c_info *wlc);
>
> -extern void brcms_c_channel_mgr_detach(struct brcms_cm_info *wlc_cm);
> +void brcms_c_channel_mgr_detach(struct brcms_cm_info *wlc_cm);
>
> -extern bool brcms_c_valid_chanspec_db(struct brcms_cm_info *wlc_cm,
> - u16 chspec);
> +bool brcms_c_valid_chanspec_db(struct brcms_cm_info *wlc_cm, u16 chspec);
>
> -extern void brcms_c_channel_reg_limits(struct brcms_cm_info *wlc_cm,
> - u16 chanspec,
> - struct txpwr_limits *txpwr);
> -extern void brcms_c_channel_set_chanspec(struct brcms_cm_info *wlc_cm,
> - u16 chanspec,
> - u8 local_constraint_qdbm);
> -extern void brcms_c_regd_init(struct brcms_c_info *wlc);
> +void brcms_c_channel_reg_limits(struct brcms_cm_info *wlc_cm, u16 chanspec,
> + struct txpwr_limits *txpwr);
> +void brcms_c_channel_set_chanspec(struct brcms_cm_info *wlc_cm, u16 chanspec,
> + u8 local_constraint_qdbm);
> +void brcms_c_regd_init(struct brcms_c_info *wlc);
>
> #endif /* _WLC_CHANNEL_H */
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.h b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.h
> index 4090032..198053d 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.h
> @@ -88,26 +88,26 @@ struct brcms_info {
> };
>
> /* misc callbacks */
> -extern void brcms_init(struct brcms_info *wl);
> -extern uint brcms_reset(struct brcms_info *wl);
> -extern void brcms_intrson(struct brcms_info *wl);
> -extern u32 brcms_intrsoff(struct brcms_info *wl);
> -extern void brcms_intrsrestore(struct brcms_info *wl, u32 macintmask);
> -extern int brcms_up(struct brcms_info *wl);
> -extern void brcms_down(struct brcms_info *wl);
> -extern void brcms_txflowcontrol(struct brcms_info *wl, struct brcms_if *wlif,
> - bool state, int prio);
> -extern bool brcms_rfkill_set_hw_state(struct brcms_info *wl);
> +void brcms_init(struct brcms_info *wl);
> +uint brcms_reset(struct brcms_info *wl);
> +void brcms_intrson(struct brcms_info *wl);
> +u32 brcms_intrsoff(struct brcms_info *wl);
> +void brcms_intrsrestore(struct brcms_info *wl, u32 macintmask);
> +int brcms_up(struct brcms_info *wl);
> +void brcms_down(struct brcms_info *wl);
> +void brcms_txflowcontrol(struct brcms_info *wl, struct brcms_if *wlif,
> + bool state, int prio);
> +bool brcms_rfkill_set_hw_state(struct brcms_info *wl);
>
> /* timer functions */
> -extern struct brcms_timer *brcms_init_timer(struct brcms_info *wl,
> - void (*fn) (void *arg), void *arg,
> - const char *name);
> -extern void brcms_free_timer(struct brcms_timer *timer);
> -extern void brcms_add_timer(struct brcms_timer *timer, uint ms, int periodic);
> -extern bool brcms_del_timer(struct brcms_timer *timer);
> -extern void brcms_dpc(unsigned long data);
> -extern void brcms_timer(struct brcms_timer *t);
> -extern void brcms_fatal_error(struct brcms_info *wl);
> +struct brcms_timer *brcms_init_timer(struct brcms_info *wl,
> + void (*fn) (void *arg), void *arg,
> + const char *name);
> +void brcms_free_timer(struct brcms_timer *timer);
> +void brcms_add_timer(struct brcms_timer *timer, uint ms, int periodic);
> +bool brcms_del_timer(struct brcms_timer *timer);
> +void brcms_dpc(unsigned long data);
> +void brcms_timer(struct brcms_timer *t);
> +void brcms_fatal_error(struct brcms_info *wl);
>
> #endif /* _BRCM_MAC80211_IF_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.h b/drivers/net/wireless/brcm80211/brcmsmac/main.h
> index b5d7a38..c4d135c 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/main.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/main.h
> @@ -616,66 +616,54 @@ struct brcms_bss_cfg {
> struct brcms_bss_info *current_bss;
> };
>
> -extern int brcms_c_txfifo(struct brcms_c_info *wlc, uint fifo,
> - struct sk_buff *p);
> -extern int brcms_b_xmtfifo_sz_get(struct brcms_hardware *wlc_hw, uint fifo,
> - uint *blocks);
> -
> -extern int brcms_c_set_gmode(struct brcms_c_info *wlc, u8 gmode, bool config);
> -extern void brcms_c_mac_promisc(struct brcms_c_info *wlc, uint filter_flags);
> -extern u16 brcms_c_calc_lsig_len(struct brcms_c_info *wlc, u32 ratespec,
> - uint mac_len);
> -extern u32 brcms_c_rspec_to_rts_rspec(struct brcms_c_info *wlc,
> - u32 rspec,
> - bool use_rspec, u16 mimo_ctlchbw);
> -extern u16 brcms_c_compute_rtscts_dur(struct brcms_c_info *wlc, bool cts_only,
> - u32 rts_rate,
> - u32 frame_rate,
> - u8 rts_preamble_type,
> - u8 frame_preamble_type, uint frame_len,
> - bool ba);
> -extern void brcms_c_inval_dma_pkts(struct brcms_hardware *hw,
> - struct ieee80211_sta *sta,
> - void (*dma_callback_fn));
> -extern void brcms_c_update_probe_resp(struct brcms_c_info *wlc, bool suspend);
> -extern int brcms_c_set_nmode(struct brcms_c_info *wlc);
> -extern void brcms_c_beacon_phytxctl_txant_upd(struct brcms_c_info *wlc,
> - u32 bcn_rate);
> -extern void brcms_b_antsel_type_set(struct brcms_hardware *wlc_hw,
> - u8 antsel_type);
> -extern void brcms_b_set_chanspec(struct brcms_hardware *wlc_hw,
> - u16 chanspec,
> - bool mute, struct txpwr_limits *txpwr);
> -extern void brcms_b_write_shm(struct brcms_hardware *wlc_hw, uint offset,
> - u16 v);
> -extern u16 brcms_b_read_shm(struct brcms_hardware *wlc_hw, uint offset);
> -extern void brcms_b_mhf(struct brcms_hardware *wlc_hw, u8 idx, u16 mask,
> - u16 val, int bands);
> -extern void brcms_b_corereset(struct brcms_hardware *wlc_hw, u32 flags);
> -extern void brcms_b_mctrl(struct brcms_hardware *wlc_hw, u32 mask, u32 val);
> -extern void brcms_b_phy_reset(struct brcms_hardware *wlc_hw);
> -extern void brcms_b_bw_set(struct brcms_hardware *wlc_hw, u16 bw);
> -extern void brcms_b_core_phypll_reset(struct brcms_hardware *wlc_hw);
> -extern void brcms_c_ucode_wake_override_set(struct brcms_hardware *wlc_hw,
> - u32 override_bit);
> -extern void brcms_c_ucode_wake_override_clear(struct brcms_hardware *wlc_hw,
> - u32 override_bit);
> -extern void brcms_b_write_template_ram(struct brcms_hardware *wlc_hw,
> - int offset, int len, void *buf);
> -extern u16 brcms_b_rate_shm_offset(struct brcms_hardware *wlc_hw, u8 rate);
> -extern void brcms_b_copyto_objmem(struct brcms_hardware *wlc_hw,
> - uint offset, const void *buf, int len,
> - u32 sel);
> -extern void brcms_b_copyfrom_objmem(struct brcms_hardware *wlc_hw, uint offset,
> - void *buf, int len, u32 sel);
> -extern void brcms_b_switch_macfreq(struct brcms_hardware *wlc_hw, u8 spurmode);
> -extern u16 brcms_b_get_txant(struct brcms_hardware *wlc_hw);
> -extern void brcms_b_phyclk_fgc(struct brcms_hardware *wlc_hw, bool clk);
> -extern void brcms_b_macphyclk_set(struct brcms_hardware *wlc_hw, bool clk);
> -extern void brcms_b_core_phypll_ctl(struct brcms_hardware *wlc_hw, bool on);
> -extern void brcms_b_txant_set(struct brcms_hardware *wlc_hw, u16 phytxant);
> -extern void brcms_b_band_stf_ss_set(struct brcms_hardware *wlc_hw,
> - u8 stf_mode);
> -extern void brcms_c_init_scb(struct scb *scb);
> +int brcms_c_txfifo(struct brcms_c_info *wlc, uint fifo, struct sk_buff *p);
> +int brcms_b_xmtfifo_sz_get(struct brcms_hardware *wlc_hw, uint fifo,
> + uint *blocks);
> +
> +int brcms_c_set_gmode(struct brcms_c_info *wlc, u8 gmode, bool config);
> +void brcms_c_mac_promisc(struct brcms_c_info *wlc, uint filter_flags);
> +u16 brcms_c_calc_lsig_len(struct brcms_c_info *wlc, u32 ratespec, uint mac_len);
> +u32 brcms_c_rspec_to_rts_rspec(struct brcms_c_info *wlc, u32 rspec,
> + bool use_rspec, u16 mimo_ctlchbw);
> +u16 brcms_c_compute_rtscts_dur(struct brcms_c_info *wlc, bool cts_only,
> + u32 rts_rate, u32 frame_rate,
> + u8 rts_preamble_type, u8 frame_preamble_type,
> + uint frame_len, bool ba);
> +void brcms_c_inval_dma_pkts(struct brcms_hardware *hw,
> + struct ieee80211_sta *sta, void (*dma_callback_fn));
> +void brcms_c_update_probe_resp(struct brcms_c_info *wlc, bool suspend);
> +int brcms_c_set_nmode(struct brcms_c_info *wlc);
> +void brcms_c_beacon_phytxctl_txant_upd(struct brcms_c_info *wlc, u32 bcn_rate);
> +void brcms_b_antsel_type_set(struct brcms_hardware *wlc_hw, u8 antsel_type);
> +void brcms_b_set_chanspec(struct brcms_hardware *wlc_hw, u16 chanspec,
> + bool mute, struct txpwr_limits *txpwr);
> +void brcms_b_write_shm(struct brcms_hardware *wlc_hw, uint offset, u16 v);
> +u16 brcms_b_read_shm(struct brcms_hardware *wlc_hw, uint offset);
> +void brcms_b_mhf(struct brcms_hardware *wlc_hw, u8 idx, u16 mask, u16 val,
> + int bands);
> +void brcms_b_corereset(struct brcms_hardware *wlc_hw, u32 flags);
> +void brcms_b_mctrl(struct brcms_hardware *wlc_hw, u32 mask, u32 val);
> +void brcms_b_phy_reset(struct brcms_hardware *wlc_hw);
> +void brcms_b_bw_set(struct brcms_hardware *wlc_hw, u16 bw);
> +void brcms_b_core_phypll_reset(struct brcms_hardware *wlc_hw);
> +void brcms_c_ucode_wake_override_set(struct brcms_hardware *wlc_hw,
> + u32 override_bit);
> +void brcms_c_ucode_wake_override_clear(struct brcms_hardware *wlc_hw,
> + u32 override_bit);
> +void brcms_b_write_template_ram(struct brcms_hardware *wlc_hw, int offset,
> + int len, void *buf);
> +u16 brcms_b_rate_shm_offset(struct brcms_hardware *wlc_hw, u8 rate);
> +void brcms_b_copyto_objmem(struct brcms_hardware *wlc_hw, uint offset,
> + const void *buf, int len, u32 sel);
> +void brcms_b_copyfrom_objmem(struct brcms_hardware *wlc_hw, uint offset,
> + void *buf, int len, u32 sel);
> +void brcms_b_switch_macfreq(struct brcms_hardware *wlc_hw, u8 spurmode);
> +u16 brcms_b_get_txant(struct brcms_hardware *wlc_hw);
> +void brcms_b_phyclk_fgc(struct brcms_hardware *wlc_hw, bool clk);
> +void brcms_b_macphyclk_set(struct brcms_hardware *wlc_hw, bool clk);
> +void brcms_b_core_phypll_ctl(struct brcms_hardware *wlc_hw, bool on);
> +void brcms_b_txant_set(struct brcms_hardware *wlc_hw, u16 phytxant);
> +void brcms_b_band_stf_ss_set(struct brcms_hardware *wlc_hw, u8 stf_mode);
> +void brcms_c_init_scb(struct scb *scb);
>
> #endif /* _BRCM_MAIN_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_hal.h b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_hal.h
> index e34a71e..4d3734f 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_hal.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_hal.h
> @@ -179,121 +179,106 @@ struct shared_phy_params {
> };
>
>
> -extern struct shared_phy *wlc_phy_shared_attach(struct shared_phy_params *shp);
> -extern struct brcms_phy_pub *wlc_phy_attach(struct shared_phy *sh,
> - struct bcma_device *d11core,
> - int bandtype, struct wiphy *wiphy);
> -extern void wlc_phy_detach(struct brcms_phy_pub *ppi);
> -
> -extern bool wlc_phy_get_phyversion(struct brcms_phy_pub *pih, u16 *phytype,
> - u16 *phyrev, u16 *radioid,
> - u16 *radiover);
> -extern bool wlc_phy_get_encore(struct brcms_phy_pub *pih);
> -extern u32 wlc_phy_get_coreflags(struct brcms_phy_pub *pih);
> -
> -extern void wlc_phy_hw_clk_state_upd(struct brcms_phy_pub *ppi, bool newstate);
> -extern void wlc_phy_hw_state_upd(struct brcms_phy_pub *ppi, bool newstate);
> -extern void wlc_phy_init(struct brcms_phy_pub *ppi, u16 chanspec);
> -extern void wlc_phy_watchdog(struct brcms_phy_pub *ppi);
> -extern int wlc_phy_down(struct brcms_phy_pub *ppi);
> -extern u32 wlc_phy_clk_bwbits(struct brcms_phy_pub *pih);
> -extern void wlc_phy_cal_init(struct brcms_phy_pub *ppi);
> -extern void wlc_phy_antsel_init(struct brcms_phy_pub *ppi, bool lut_init);
> -
> -extern void wlc_phy_chanspec_set(struct brcms_phy_pub *ppi,
> - u16 chanspec);
> -extern u16 wlc_phy_chanspec_get(struct brcms_phy_pub *ppi);
> -extern void wlc_phy_chanspec_radio_set(struct brcms_phy_pub *ppi,
> - u16 newch);
> -extern u16 wlc_phy_bw_state_get(struct brcms_phy_pub *ppi);
> -extern void wlc_phy_bw_state_set(struct brcms_phy_pub *ppi, u16 bw);
> -
> -extern int wlc_phy_rssi_compute(struct brcms_phy_pub *pih,
> - struct d11rxhdr *rxh);
> -extern void wlc_phy_por_inform(struct brcms_phy_pub *ppi);
> -extern void wlc_phy_noise_sample_intr(struct brcms_phy_pub *ppi);
> -extern bool wlc_phy_bist_check_phy(struct brcms_phy_pub *ppi);
> -
> -extern void wlc_phy_set_deaf(struct brcms_phy_pub *ppi, bool user_flag);
> -
> -extern void wlc_phy_switch_radio(struct brcms_phy_pub *ppi, bool on);
> -extern void wlc_phy_anacore(struct brcms_phy_pub *ppi, bool on);
> -
> -
> -extern void wlc_phy_BSSinit(struct brcms_phy_pub *ppi, bool bonlyap, int rssi);
> -
> -extern void wlc_phy_chanspec_ch14_widefilter_set(struct brcms_phy_pub *ppi,
> - bool wide_filter);
> -extern void wlc_phy_chanspec_band_validch(struct brcms_phy_pub *ppi, uint band,
> - struct brcms_chanvec *channels);
> -extern u16 wlc_phy_chanspec_band_firstch(struct brcms_phy_pub *ppi,
> - uint band);
> -
> -extern void wlc_phy_txpower_sromlimit(struct brcms_phy_pub *ppi, uint chan,
> - u8 *_min_, u8 *_max_, int rate);
> -extern void wlc_phy_txpower_sromlimit_max_get(struct brcms_phy_pub *ppi,
> - uint chan, u8 *_max_, u8 *_min_);
> -extern void wlc_phy_txpower_boardlimit_band(struct brcms_phy_pub *ppi,
> - uint band, s32 *, s32 *, u32 *);
> -extern void wlc_phy_txpower_limit_set(struct brcms_phy_pub *ppi,
> - struct txpwr_limits *,
> - u16 chanspec);
> -extern int wlc_phy_txpower_get(struct brcms_phy_pub *ppi, uint *qdbm,
> - bool *override);
> -extern int wlc_phy_txpower_set(struct brcms_phy_pub *ppi, uint qdbm,
> - bool override);
> -extern void wlc_phy_txpower_target_set(struct brcms_phy_pub *ppi,
> - struct txpwr_limits *);
> -extern bool wlc_phy_txpower_hw_ctrl_get(struct brcms_phy_pub *ppi);
> -extern void wlc_phy_txpower_hw_ctrl_set(struct brcms_phy_pub *ppi,
> - bool hwpwrctrl);
> -extern u8 wlc_phy_txpower_get_target_min(struct brcms_phy_pub *ppi);
> -extern u8 wlc_phy_txpower_get_target_max(struct brcms_phy_pub *ppi);
> -extern bool wlc_phy_txpower_ipa_ison(struct brcms_phy_pub *pih);
> -
> -extern void wlc_phy_stf_chain_init(struct brcms_phy_pub *pih, u8 txchain,
> - u8 rxchain);
> -extern void wlc_phy_stf_chain_set(struct brcms_phy_pub *pih, u8 txchain,
> - u8 rxchain);
> -extern void wlc_phy_stf_chain_get(struct brcms_phy_pub *pih, u8 *txchain,
> - u8 *rxchain);
> -extern u8 wlc_phy_stf_chain_active_get(struct brcms_phy_pub *pih);
> -extern s8 wlc_phy_stf_ssmode_get(struct brcms_phy_pub *pih,
> - u16 chanspec);
> -extern void wlc_phy_ldpc_override_set(struct brcms_phy_pub *ppi, bool val);
> -
> -extern void wlc_phy_cal_perical(struct brcms_phy_pub *ppi, u8 reason);
> -extern void wlc_phy_noise_sample_request_external(struct brcms_phy_pub *ppi);
> -extern void wlc_phy_edcrs_lock(struct brcms_phy_pub *pih, bool lock);
> -extern void wlc_phy_cal_papd_recal(struct brcms_phy_pub *ppi);
> -
> -extern void wlc_phy_ant_rxdiv_set(struct brcms_phy_pub *ppi, u8 val);
> -extern void wlc_phy_clear_tssi(struct brcms_phy_pub *ppi);
> -extern void wlc_phy_hold_upd(struct brcms_phy_pub *ppi, u32 id, bool val);
> -extern void wlc_phy_mute_upd(struct brcms_phy_pub *ppi, bool val, u32 flags);
> -
> -extern void wlc_phy_antsel_type_set(struct brcms_phy_pub *ppi, u8 antsel_type);
> -
> -extern void wlc_phy_txpower_get_current(struct brcms_phy_pub *ppi,
> - struct tx_power *power, uint channel);
> -
> -extern void wlc_phy_initcal_enable(struct brcms_phy_pub *pih, bool initcal);
> -extern bool wlc_phy_test_ison(struct brcms_phy_pub *ppi);
> -extern void wlc_phy_txpwr_percent_set(struct brcms_phy_pub *ppi,
> - u8 txpwr_percent);
> -extern void wlc_phy_ofdm_rateset_war(struct brcms_phy_pub *pih, bool war);
> -extern void wlc_phy_bf_preempt_enable(struct brcms_phy_pub *pih,
> - bool bf_preempt);
> -extern void wlc_phy_machwcap_set(struct brcms_phy_pub *ppi, u32 machwcap);
> -
> -extern void wlc_phy_runbist_config(struct brcms_phy_pub *ppi, bool start_end);
> -
> -extern void wlc_phy_freqtrack_start(struct brcms_phy_pub *ppi);
> -extern void wlc_phy_freqtrack_end(struct brcms_phy_pub *ppi);
> -
> -extern const u8 *wlc_phy_get_ofdm_rate_lookup(void);
> -
> -extern s8 wlc_phy_get_tx_power_offset_by_mcs(struct brcms_phy_pub *ppi,
> - u8 mcs_offset);
> -extern s8 wlc_phy_get_tx_power_offset(struct brcms_phy_pub *ppi, u8 tbl_offset);
> +struct shared_phy *wlc_phy_shared_attach(struct shared_phy_params *shp);
> +struct brcms_phy_pub *wlc_phy_attach(struct shared_phy *sh,
> + struct bcma_device *d11core, int bandtype,
> + struct wiphy *wiphy);
> +void wlc_phy_detach(struct brcms_phy_pub *ppi);
> +
> +bool wlc_phy_get_phyversion(struct brcms_phy_pub *pih, u16 *phytype,
> + u16 *phyrev, u16 *radioid, u16 *radiover);
> +bool wlc_phy_get_encore(struct brcms_phy_pub *pih);
> +u32 wlc_phy_get_coreflags(struct brcms_phy_pub *pih);
> +
> +void wlc_phy_hw_clk_state_upd(struct brcms_phy_pub *ppi, bool newstate);
> +void wlc_phy_hw_state_upd(struct brcms_phy_pub *ppi, bool newstate);
> +void wlc_phy_init(struct brcms_phy_pub *ppi, u16 chanspec);
> +void wlc_phy_watchdog(struct brcms_phy_pub *ppi);
> +int wlc_phy_down(struct brcms_phy_pub *ppi);
> +u32 wlc_phy_clk_bwbits(struct brcms_phy_pub *pih);
> +void wlc_phy_cal_init(struct brcms_phy_pub *ppi);
> +void wlc_phy_antsel_init(struct brcms_phy_pub *ppi, bool lut_init);
> +
> +void wlc_phy_chanspec_set(struct brcms_phy_pub *ppi, u16 chanspec);
> +u16 wlc_phy_chanspec_get(struct brcms_phy_pub *ppi);
> +void wlc_phy_chanspec_radio_set(struct brcms_phy_pub *ppi, u16 newch);
> +u16 wlc_phy_bw_state_get(struct brcms_phy_pub *ppi);
> +void wlc_phy_bw_state_set(struct brcms_phy_pub *ppi, u16 bw);
> +
> +int wlc_phy_rssi_compute(struct brcms_phy_pub *pih, struct d11rxhdr *rxh);
> +void wlc_phy_por_inform(struct brcms_phy_pub *ppi);
> +void wlc_phy_noise_sample_intr(struct brcms_phy_pub *ppi);
> +bool wlc_phy_bist_check_phy(struct brcms_phy_pub *ppi);
> +
> +void wlc_phy_set_deaf(struct brcms_phy_pub *ppi, bool user_flag);
> +
> +void wlc_phy_switch_radio(struct brcms_phy_pub *ppi, bool on);
> +void wlc_phy_anacore(struct brcms_phy_pub *ppi, bool on);
> +
> +
> +void wlc_phy_BSSinit(struct brcms_phy_pub *ppi, bool bonlyap, int rssi);
> +
> +void wlc_phy_chanspec_ch14_widefilter_set(struct brcms_phy_pub *ppi,
> + bool wide_filter);
> +void wlc_phy_chanspec_band_validch(struct brcms_phy_pub *ppi, uint band,
> + struct brcms_chanvec *channels);
> +u16 wlc_phy_chanspec_band_firstch(struct brcms_phy_pub *ppi, uint band);
> +
> +void wlc_phy_txpower_sromlimit(struct brcms_phy_pub *ppi, uint chan, u8 *_min_,
> + u8 *_max_, int rate);
> +void wlc_phy_txpower_sromlimit_max_get(struct brcms_phy_pub *ppi, uint chan,
> + u8 *_max_, u8 *_min_);
> +void wlc_phy_txpower_boardlimit_band(struct brcms_phy_pub *ppi, uint band,
> + s32 *, s32 *, u32 *);
> +void wlc_phy_txpower_limit_set(struct brcms_phy_pub *ppi, struct txpwr_limits *,
> + u16 chanspec);
> +int wlc_phy_txpower_get(struct brcms_phy_pub *ppi, uint *qdbm, bool *override);
> +int wlc_phy_txpower_set(struct brcms_phy_pub *ppi, uint qdbm, bool override);
> +void wlc_phy_txpower_target_set(struct brcms_phy_pub *ppi,
> + struct txpwr_limits *);
> +bool wlc_phy_txpower_hw_ctrl_get(struct brcms_phy_pub *ppi);
> +void wlc_phy_txpower_hw_ctrl_set(struct brcms_phy_pub *ppi, bool hwpwrctrl);
> +u8 wlc_phy_txpower_get_target_min(struct brcms_phy_pub *ppi);
> +u8 wlc_phy_txpower_get_target_max(struct brcms_phy_pub *ppi);
> +bool wlc_phy_txpower_ipa_ison(struct brcms_phy_pub *pih);
> +
> +void wlc_phy_stf_chain_init(struct brcms_phy_pub *pih, u8 txchain, u8 rxchain);
> +void wlc_phy_stf_chain_set(struct brcms_phy_pub *pih, u8 txchain, u8 rxchain);
> +void wlc_phy_stf_chain_get(struct brcms_phy_pub *pih, u8 *txchain, u8 *rxchain);
> +u8 wlc_phy_stf_chain_active_get(struct brcms_phy_pub *pih);
> +s8 wlc_phy_stf_ssmode_get(struct brcms_phy_pub *pih, u16 chanspec);
> +void wlc_phy_ldpc_override_set(struct brcms_phy_pub *ppi, bool val);
> +
> +void wlc_phy_cal_perical(struct brcms_phy_pub *ppi, u8 reason);
> +void wlc_phy_noise_sample_request_external(struct brcms_phy_pub *ppi);
> +void wlc_phy_edcrs_lock(struct brcms_phy_pub *pih, bool lock);
> +void wlc_phy_cal_papd_recal(struct brcms_phy_pub *ppi);
> +
> +void wlc_phy_ant_rxdiv_set(struct brcms_phy_pub *ppi, u8 val);
> +void wlc_phy_clear_tssi(struct brcms_phy_pub *ppi);
> +void wlc_phy_hold_upd(struct brcms_phy_pub *ppi, u32 id, bool val);
> +void wlc_phy_mute_upd(struct brcms_phy_pub *ppi, bool val, u32 flags);
> +
> +void wlc_phy_antsel_type_set(struct brcms_phy_pub *ppi, u8 antsel_type);
> +
> +void wlc_phy_txpower_get_current(struct brcms_phy_pub *ppi,
> + struct tx_power *power, uint channel);
> +
> +void wlc_phy_initcal_enable(struct brcms_phy_pub *pih, bool initcal);
> +bool wlc_phy_test_ison(struct brcms_phy_pub *ppi);
> +void wlc_phy_txpwr_percent_set(struct brcms_phy_pub *ppi, u8 txpwr_percent);
> +void wlc_phy_ofdm_rateset_war(struct brcms_phy_pub *pih, bool war);
> +void wlc_phy_bf_preempt_enable(struct brcms_phy_pub *pih, bool bf_preempt);
> +void wlc_phy_machwcap_set(struct brcms_phy_pub *ppi, u32 machwcap);
> +
> +void wlc_phy_runbist_config(struct brcms_phy_pub *ppi, bool start_end);
> +
> +void wlc_phy_freqtrack_start(struct brcms_phy_pub *ppi);
> +void wlc_phy_freqtrack_end(struct brcms_phy_pub *ppi);
> +
> +const u8 *wlc_phy_get_ofdm_rate_lookup(void);
> +
> +s8 wlc_phy_get_tx_power_offset_by_mcs(struct brcms_phy_pub *ppi,
> + u8 mcs_offset);
> +s8 wlc_phy_get_tx_power_offset(struct brcms_phy_pub *ppi, u8 tbl_offset);
> #endif /* _BRCM_PHY_HAL_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_int.h b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_int.h
> index 1dc767c..4960f7d 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_int.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_int.h
> @@ -910,113 +910,103 @@ struct lcnphy_radio_regs {
> u8 do_init_g;
> };
>
> -extern u16 read_phy_reg(struct brcms_phy *pi, u16 addr);
> -extern void write_phy_reg(struct brcms_phy *pi, u16 addr, u16 val);
> -extern void and_phy_reg(struct brcms_phy *pi, u16 addr, u16 val);
> -extern void or_phy_reg(struct brcms_phy *pi, u16 addr, u16 val);
> -extern void mod_phy_reg(struct brcms_phy *pi, u16 addr, u16 mask, u16 val);
> -
> -extern u16 read_radio_reg(struct brcms_phy *pi, u16 addr);
> -extern void or_radio_reg(struct brcms_phy *pi, u16 addr, u16 val);
> -extern void and_radio_reg(struct brcms_phy *pi, u16 addr, u16 val);
> -extern void mod_radio_reg(struct brcms_phy *pi, u16 addr, u16 mask,
> - u16 val);
> -extern void xor_radio_reg(struct brcms_phy *pi, u16 addr, u16 mask);
> -
> -extern void write_radio_reg(struct brcms_phy *pi, u16 addr, u16 val);
> -
> -extern void wlc_phyreg_enter(struct brcms_phy_pub *pih);
> -extern void wlc_phyreg_exit(struct brcms_phy_pub *pih);
> -extern void wlc_radioreg_enter(struct brcms_phy_pub *pih);
> -extern void wlc_radioreg_exit(struct brcms_phy_pub *pih);
> -
> -extern void wlc_phy_read_table(struct brcms_phy *pi,
> - const struct phytbl_info *ptbl_info,
> - u16 tblAddr, u16 tblDataHi,
> - u16 tblDatalo);
> -extern void wlc_phy_write_table(struct brcms_phy *pi,
> - const struct phytbl_info *ptbl_info,
> - u16 tblAddr, u16 tblDataHi, u16 tblDatalo);
> -extern void wlc_phy_table_addr(struct brcms_phy *pi, uint tbl_id,
> - uint tbl_offset, u16 tblAddr, u16 tblDataHi,
> - u16 tblDataLo);
> -extern void wlc_phy_table_data_write(struct brcms_phy *pi, uint width, u32 val);
> -
> -extern void write_phy_channel_reg(struct brcms_phy *pi, uint val);
> -extern void wlc_phy_txpower_update_shm(struct brcms_phy *pi);
> -
> -extern u8 wlc_phy_nbits(s32 value);
> -extern void wlc_phy_compute_dB(u32 *cmplx_pwr, s8 *p_dB, u8 core);
> -
> -extern uint wlc_phy_init_radio_regs_allbands(struct brcms_phy *pi,
> - struct radio_20xx_regs *radioregs);
> -extern uint wlc_phy_init_radio_regs(struct brcms_phy *pi,
> - const struct radio_regs *radioregs,
> - u16 core_offset);
> -
> -extern void wlc_phy_txpower_ipa_upd(struct brcms_phy *pi);
> -
> -extern void wlc_phy_do_dummy_tx(struct brcms_phy *pi, bool ofdm, bool pa_on);
> -extern void wlc_phy_papd_decode_epsilon(u32 epsilon, s32 *eps_real,
> - s32 *eps_imag);
> -
> -extern void wlc_phy_cal_perical_mphase_reset(struct brcms_phy *pi);
> -extern void wlc_phy_cal_perical_mphase_restart(struct brcms_phy *pi);
> -
> -extern bool wlc_phy_attach_nphy(struct brcms_phy *pi);
> -extern bool wlc_phy_attach_lcnphy(struct brcms_phy *pi);
> -
> -extern void wlc_phy_detach_lcnphy(struct brcms_phy *pi);
> -
> -extern void wlc_phy_init_nphy(struct brcms_phy *pi);
> -extern void wlc_phy_init_lcnphy(struct brcms_phy *pi);
> -
> -extern void wlc_phy_cal_init_nphy(struct brcms_phy *pi);
> -extern void wlc_phy_cal_init_lcnphy(struct brcms_phy *pi);
> -
> -extern void wlc_phy_chanspec_set_nphy(struct brcms_phy *pi,
> - u16 chanspec);
> -extern void wlc_phy_chanspec_set_lcnphy(struct brcms_phy *pi,
> - u16 chanspec);
> -extern void wlc_phy_chanspec_set_fixup_lcnphy(struct brcms_phy *pi,
> - u16 chanspec);
> -extern int wlc_phy_channel2freq(uint channel);
> -extern int wlc_phy_chanspec_freq2bandrange_lpssn(uint);
> -extern int wlc_phy_chanspec_bandrange_get(struct brcms_phy *, u16 chanspec);
> -
> -extern void wlc_lcnphy_set_tx_pwr_ctrl(struct brcms_phy *pi, u16 mode);
> -extern s8 wlc_lcnphy_get_current_tx_pwr_idx(struct brcms_phy *pi);
> -
> -extern void wlc_phy_txpower_recalc_target_nphy(struct brcms_phy *pi);
> -extern void wlc_lcnphy_txpower_recalc_target(struct brcms_phy *pi);
> -extern void wlc_phy_txpower_recalc_target_lcnphy(struct brcms_phy *pi);
> -
> -extern void wlc_lcnphy_set_tx_pwr_by_index(struct brcms_phy *pi, int index);
> -extern void wlc_lcnphy_tx_pu(struct brcms_phy *pi, bool bEnable);
> -extern void wlc_lcnphy_stop_tx_tone(struct brcms_phy *pi);
> -extern void wlc_lcnphy_start_tx_tone(struct brcms_phy *pi, s32 f_kHz,
> - u16 max_val, bool iqcalmode);
> -
> -extern void wlc_phy_txpower_sromlimit_get_nphy(struct brcms_phy *pi, uint chan,
> - u8 *max_pwr, u8 rate_id);
> -extern void wlc_phy_ofdm_to_mcs_powers_nphy(u8 *power, u8 rate_mcs_start,
> - u8 rate_mcs_end,
> - u8 rate_ofdm_start);
> -extern void wlc_phy_mcs_to_ofdm_powers_nphy(u8 *power,
> - u8 rate_ofdm_start,
> - u8 rate_ofdm_end,
> - u8 rate_mcs_start);
> -
> -extern u16 wlc_lcnphy_tempsense(struct brcms_phy *pi, bool mode);
> -extern s16 wlc_lcnphy_tempsense_new(struct brcms_phy *pi, bool mode);
> -extern s8 wlc_lcnphy_tempsense_degree(struct brcms_phy *pi, bool mode);
> -extern s8 wlc_lcnphy_vbatsense(struct brcms_phy *pi, bool mode);
> -extern void wlc_phy_carrier_suppress_lcnphy(struct brcms_phy *pi);
> -extern void wlc_lcnphy_crsuprs(struct brcms_phy *pi, int channel);
> -extern void wlc_lcnphy_epa_switch(struct brcms_phy *pi, bool mode);
> -extern void wlc_2064_vco_cal(struct brcms_phy *pi);
> -
> -extern void wlc_phy_txpower_recalc_target(struct brcms_phy *pi);
> +u16 read_phy_reg(struct brcms_phy *pi, u16 addr);
> +void write_phy_reg(struct brcms_phy *pi, u16 addr, u16 val);
> +void and_phy_reg(struct brcms_phy *pi, u16 addr, u16 val);
> +void or_phy_reg(struct brcms_phy *pi, u16 addr, u16 val);
> +void mod_phy_reg(struct brcms_phy *pi, u16 addr, u16 mask, u16 val);
> +
> +u16 read_radio_reg(struct brcms_phy *pi, u16 addr);
> +void or_radio_reg(struct brcms_phy *pi, u16 addr, u16 val);
> +void and_radio_reg(struct brcms_phy *pi, u16 addr, u16 val);
> +void mod_radio_reg(struct brcms_phy *pi, u16 addr, u16 mask, u16 val);
> +void xor_radio_reg(struct brcms_phy *pi, u16 addr, u16 mask);
> +
> +void write_radio_reg(struct brcms_phy *pi, u16 addr, u16 val);
> +
> +void wlc_phyreg_enter(struct brcms_phy_pub *pih);
> +void wlc_phyreg_exit(struct brcms_phy_pub *pih);
> +void wlc_radioreg_enter(struct brcms_phy_pub *pih);
> +void wlc_radioreg_exit(struct brcms_phy_pub *pih);
> +
> +void wlc_phy_read_table(struct brcms_phy *pi,
> + const struct phytbl_info *ptbl_info,
> + u16 tblAddr, u16 tblDataHi, u16 tblDatalo);
> +void wlc_phy_write_table(struct brcms_phy *pi,
> + const struct phytbl_info *ptbl_info,
> + u16 tblAddr, u16 tblDataHi, u16 tblDatalo);
> +void wlc_phy_table_addr(struct brcms_phy *pi, uint tbl_id, uint tbl_offset,
> + u16 tblAddr, u16 tblDataHi, u16 tblDataLo);
> +void wlc_phy_table_data_write(struct brcms_phy *pi, uint width, u32 val);
> +
> +void write_phy_channel_reg(struct brcms_phy *pi, uint val);
> +void wlc_phy_txpower_update_shm(struct brcms_phy *pi);
> +
> +u8 wlc_phy_nbits(s32 value);
> +void wlc_phy_compute_dB(u32 *cmplx_pwr, s8 *p_dB, u8 core);
> +
> +uint wlc_phy_init_radio_regs_allbands(struct brcms_phy *pi,
> + struct radio_20xx_regs *radioregs);
> +uint wlc_phy_init_radio_regs(struct brcms_phy *pi,
> + const struct radio_regs *radioregs,
> + u16 core_offset);
> +
> +void wlc_phy_txpower_ipa_upd(struct brcms_phy *pi);
> +
> +void wlc_phy_do_dummy_tx(struct brcms_phy *pi, bool ofdm, bool pa_on);
> +void wlc_phy_papd_decode_epsilon(u32 epsilon, s32 *eps_real, s32 *eps_imag);
> +
> +void wlc_phy_cal_perical_mphase_reset(struct brcms_phy *pi);
> +void wlc_phy_cal_perical_mphase_restart(struct brcms_phy *pi);
> +
> +bool wlc_phy_attach_nphy(struct brcms_phy *pi);
> +bool wlc_phy_attach_lcnphy(struct brcms_phy *pi);
> +
> +void wlc_phy_detach_lcnphy(struct brcms_phy *pi);
> +
> +void wlc_phy_init_nphy(struct brcms_phy *pi);
> +void wlc_phy_init_lcnphy(struct brcms_phy *pi);
> +
> +void wlc_phy_cal_init_nphy(struct brcms_phy *pi);
> +void wlc_phy_cal_init_lcnphy(struct brcms_phy *pi);
> +
> +void wlc_phy_chanspec_set_nphy(struct brcms_phy *pi, u16 chanspec);
> +void wlc_phy_chanspec_set_lcnphy(struct brcms_phy *pi, u16 chanspec);
> +void wlc_phy_chanspec_set_fixup_lcnphy(struct brcms_phy *pi, u16 chanspec);
> +int wlc_phy_channel2freq(uint channel);
> +int wlc_phy_chanspec_freq2bandrange_lpssn(uint);
> +int wlc_phy_chanspec_bandrange_get(struct brcms_phy *, u16 chanspec);
> +
> +void wlc_lcnphy_set_tx_pwr_ctrl(struct brcms_phy *pi, u16 mode);
> +s8 wlc_lcnphy_get_current_tx_pwr_idx(struct brcms_phy *pi);
> +
> +void wlc_phy_txpower_recalc_target_nphy(struct brcms_phy *pi);
> +void wlc_lcnphy_txpower_recalc_target(struct brcms_phy *pi);
> +void wlc_phy_txpower_recalc_target_lcnphy(struct brcms_phy *pi);
> +
> +void wlc_lcnphy_set_tx_pwr_by_index(struct brcms_phy *pi, int index);
> +void wlc_lcnphy_tx_pu(struct brcms_phy *pi, bool bEnable);
> +void wlc_lcnphy_stop_tx_tone(struct brcms_phy *pi);
> +void wlc_lcnphy_start_tx_tone(struct brcms_phy *pi, s32 f_kHz, u16 max_val,
> + bool iqcalmode);
> +
> +void wlc_phy_txpower_sromlimit_get_nphy(struct brcms_phy *pi, uint chan,
> + u8 *max_pwr, u8 rate_id);
> +void wlc_phy_ofdm_to_mcs_powers_nphy(u8 *power, u8 rate_mcs_start,
> + u8 rate_mcs_end, u8 rate_ofdm_start);
> +void wlc_phy_mcs_to_ofdm_powers_nphy(u8 *power, u8 rate_ofdm_start,
> + u8 rate_ofdm_end, u8 rate_mcs_start);
> +
> +u16 wlc_lcnphy_tempsense(struct brcms_phy *pi, bool mode);
> +s16 wlc_lcnphy_tempsense_new(struct brcms_phy *pi, bool mode);
> +s8 wlc_lcnphy_tempsense_degree(struct brcms_phy *pi, bool mode);
> +s8 wlc_lcnphy_vbatsense(struct brcms_phy *pi, bool mode);
> +void wlc_phy_carrier_suppress_lcnphy(struct brcms_phy *pi);
> +void wlc_lcnphy_crsuprs(struct brcms_phy *pi, int channel);
> +void wlc_lcnphy_epa_switch(struct brcms_phy *pi, bool mode);
> +void wlc_2064_vco_cal(struct brcms_phy *pi);
> +
> +void wlc_phy_txpower_recalc_target(struct brcms_phy *pi);
>
> #define LCNPHY_TBL_ID_PAPDCOMPDELTATBL 0x18
> #define LCNPHY_TX_POWER_TABLE_SIZE 128
> @@ -1030,26 +1020,24 @@ extern void wlc_phy_txpower_recalc_target(struct brcms_phy *pi);
>
> #define LCNPHY_TX_PWR_CTRL_TEMPBASED 0xE001
>
> -extern void wlc_lcnphy_write_table(struct brcms_phy *pi,
> - const struct phytbl_info *pti);
> -extern void wlc_lcnphy_read_table(struct brcms_phy *pi,
> - struct phytbl_info *pti);
> -extern void wlc_lcnphy_set_tx_iqcc(struct brcms_phy *pi, u16 a, u16 b);
> -extern void wlc_lcnphy_set_tx_locc(struct brcms_phy *pi, u16 didq);
> -extern void wlc_lcnphy_get_tx_iqcc(struct brcms_phy *pi, u16 *a, u16 *b);
> -extern u16 wlc_lcnphy_get_tx_locc(struct brcms_phy *pi);
> -extern void wlc_lcnphy_get_radio_loft(struct brcms_phy *pi, u8 *ei0,
> - u8 *eq0, u8 *fi0, u8 *fq0);
> -extern void wlc_lcnphy_calib_modes(struct brcms_phy *pi, uint mode);
> -extern void wlc_lcnphy_deaf_mode(struct brcms_phy *pi, bool mode);
> -extern bool wlc_phy_tpc_isenabled_lcnphy(struct brcms_phy *pi);
> -extern void wlc_lcnphy_tx_pwr_update_npt(struct brcms_phy *pi);
> -extern s32 wlc_lcnphy_tssi2dbm(s32 tssi, s32 a1, s32 b0, s32 b1);
> -extern void wlc_lcnphy_get_tssi(struct brcms_phy *pi, s8 *ofdm_pwr,
> - s8 *cck_pwr);
> -extern void wlc_lcnphy_tx_power_adjustment(struct brcms_phy_pub *ppi);
> -
> -extern s32 wlc_lcnphy_rx_signal_power(struct brcms_phy *pi, s32 gain_index);
> +void wlc_lcnphy_write_table(struct brcms_phy *pi,
> + const struct phytbl_info *pti);
> +void wlc_lcnphy_read_table(struct brcms_phy *pi, struct phytbl_info *pti);
> +void wlc_lcnphy_set_tx_iqcc(struct brcms_phy *pi, u16 a, u16 b);
> +void wlc_lcnphy_set_tx_locc(struct brcms_phy *pi, u16 didq);
> +void wlc_lcnphy_get_tx_iqcc(struct brcms_phy *pi, u16 *a, u16 *b);
> +u16 wlc_lcnphy_get_tx_locc(struct brcms_phy *pi);
> +void wlc_lcnphy_get_radio_loft(struct brcms_phy *pi, u8 *ei0, u8 *eq0, u8 *fi0,
> + u8 *fq0);
> +void wlc_lcnphy_calib_modes(struct brcms_phy *pi, uint mode);
> +void wlc_lcnphy_deaf_mode(struct brcms_phy *pi, bool mode);
> +bool wlc_phy_tpc_isenabled_lcnphy(struct brcms_phy *pi);
> +void wlc_lcnphy_tx_pwr_update_npt(struct brcms_phy *pi);
> +s32 wlc_lcnphy_tssi2dbm(s32 tssi, s32 a1, s32 b0, s32 b1);
> +void wlc_lcnphy_get_tssi(struct brcms_phy *pi, s8 *ofdm_pwr, s8 *cck_pwr);
> +void wlc_lcnphy_tx_power_adjustment(struct brcms_phy_pub *ppi);
> +
> +s32 wlc_lcnphy_rx_signal_power(struct brcms_phy *pi, s32 gain_index);
>
> #define NPHY_MAX_HPVGA1_INDEX 10
> #define NPHY_DEF_HPVGA1_INDEXLIMIT 7
> @@ -1060,9 +1048,8 @@ struct phy_iq_est {
> u32 q_pwr;
> };
>
> -extern void wlc_phy_stay_in_carriersearch_nphy(struct brcms_phy *pi,
> - bool enable);
> -extern void wlc_nphy_deaf_mode(struct brcms_phy *pi, bool mode);
> +void wlc_phy_stay_in_carriersearch_nphy(struct brcms_phy *pi, bool enable);
> +void wlc_nphy_deaf_mode(struct brcms_phy *pi, bool mode);
>
> #define wlc_phy_write_table_nphy(pi, pti) \
> wlc_phy_write_table(pi, pti, 0x72, 0x74, 0x73)
> @@ -1076,10 +1063,10 @@ extern void wlc_nphy_deaf_mode(struct brcms_phy *pi, bool mode);
> #define wlc_nphy_table_data_write(pi, w, v) \
> wlc_phy_table_data_write((pi), (w), (v))
>
> -extern void wlc_phy_table_read_nphy(struct brcms_phy *pi, u32, u32 l, u32 o,
> - u32 w, void *d);
> -extern void wlc_phy_table_write_nphy(struct brcms_phy *pi, u32, u32, u32,
> - u32, const void *);
> +void wlc_phy_table_read_nphy(struct brcms_phy *pi, u32, u32 l, u32 o, u32 w,
> + void *d);
> +void wlc_phy_table_write_nphy(struct brcms_phy *pi, u32, u32, u32, u32,
> + const void *);
>
> #define PHY_IPA(pi) \
> ((pi->ipa2g_on && CHSPEC_IS2G(pi->radio_chanspec)) || \
> @@ -1089,73 +1076,67 @@ extern void wlc_phy_table_write_nphy(struct brcms_phy *pi, u32, u32, u32,
> if (NREV_LT((pi)->pubpi.phy_rev, 3)) \
> (void)bcma_read32(pi->d11core, D11REGOFFS(maccontrol))
>
> -extern void wlc_phy_cal_perical_nphy_run(struct brcms_phy *pi, u8 caltype);
> -extern void wlc_phy_aci_reset_nphy(struct brcms_phy *pi);
> -extern void wlc_phy_pa_override_nphy(struct brcms_phy *pi, bool en);
> -
> -extern u8 wlc_phy_get_chan_freq_range_nphy(struct brcms_phy *pi, uint chan);
> -extern void wlc_phy_switch_radio_nphy(struct brcms_phy *pi, bool on);
> -
> -extern void wlc_phy_stf_chain_upd_nphy(struct brcms_phy *pi);
> -
> -extern void wlc_phy_force_rfseq_nphy(struct brcms_phy *pi, u8 cmd);
> -extern s16 wlc_phy_tempsense_nphy(struct brcms_phy *pi);
> -
> -extern u16 wlc_phy_classifier_nphy(struct brcms_phy *pi, u16 mask, u16 val);
> -
> -extern void wlc_phy_rx_iq_est_nphy(struct brcms_phy *pi, struct phy_iq_est *est,
> - u16 num_samps, u8 wait_time,
> - u8 wait_for_crs);
> -
> -extern void wlc_phy_rx_iq_coeffs_nphy(struct brcms_phy *pi, u8 write,
> - struct nphy_iq_comp *comp);
> -extern void wlc_phy_aci_and_noise_reduction_nphy(struct brcms_phy *pi);
> -
> -extern void wlc_phy_rxcore_setstate_nphy(struct brcms_phy_pub *pih,
> - u8 rxcore_bitmask);
> -extern u8 wlc_phy_rxcore_getstate_nphy(struct brcms_phy_pub *pih);
> -
> -extern void wlc_phy_txpwrctrl_enable_nphy(struct brcms_phy *pi, u8 ctrl_type);
> -extern void wlc_phy_txpwr_fixpower_nphy(struct brcms_phy *pi);
> -extern void wlc_phy_txpwr_apply_nphy(struct brcms_phy *pi);
> -extern void wlc_phy_txpwr_papd_cal_nphy(struct brcms_phy *pi);
> -extern u16 wlc_phy_txpwr_idx_get_nphy(struct brcms_phy *pi);
> -
> -extern struct nphy_txgains wlc_phy_get_tx_gain_nphy(struct brcms_phy *pi);
> -extern int wlc_phy_cal_txiqlo_nphy(struct brcms_phy *pi,
> - struct nphy_txgains target_gain,
> - bool full, bool m);
> -extern int wlc_phy_cal_rxiq_nphy(struct brcms_phy *pi,
> - struct nphy_txgains target_gain,
> - u8 type, bool d);
> -extern void wlc_phy_txpwr_index_nphy(struct brcms_phy *pi, u8 core_mask,
> - s8 txpwrindex, bool res);
> -extern void wlc_phy_rssisel_nphy(struct brcms_phy *pi, u8 core, u8 rssi_type);
> -extern int wlc_phy_poll_rssi_nphy(struct brcms_phy *pi, u8 rssi_type,
> - s32 *rssi_buf, u8 nsamps);
> -extern void wlc_phy_rssi_cal_nphy(struct brcms_phy *pi);
> -extern int wlc_phy_aci_scan_nphy(struct brcms_phy *pi);
> -extern void wlc_phy_cal_txgainctrl_nphy(struct brcms_phy *pi,
> - s32 dBm_targetpower, bool debug);
> -extern int wlc_phy_tx_tone_nphy(struct brcms_phy *pi, u32 f_kHz, u16 max_val,
> - u8 mode, u8, bool);
> -extern void wlc_phy_stopplayback_nphy(struct brcms_phy *pi);
> -extern void wlc_phy_est_tonepwr_nphy(struct brcms_phy *pi, s32 *qdBm_pwrbuf,
> - u8 num_samps);
> -extern void wlc_phy_radio205x_vcocal_nphy(struct brcms_phy *pi);
> -
> -extern int wlc_phy_rssi_compute_nphy(struct brcms_phy *pi,
> - struct d11rxhdr *rxh);
> +void wlc_phy_cal_perical_nphy_run(struct brcms_phy *pi, u8 caltype);
> +void wlc_phy_aci_reset_nphy(struct brcms_phy *pi);
> +void wlc_phy_pa_override_nphy(struct brcms_phy *pi, bool en);
> +
> +u8 wlc_phy_get_chan_freq_range_nphy(struct brcms_phy *pi, uint chan);
> +void wlc_phy_switch_radio_nphy(struct brcms_phy *pi, bool on);
> +
> +void wlc_phy_stf_chain_upd_nphy(struct brcms_phy *pi);
> +
> +void wlc_phy_force_rfseq_nphy(struct brcms_phy *pi, u8 cmd);
> +s16 wlc_phy_tempsense_nphy(struct brcms_phy *pi);
> +
> +u16 wlc_phy_classifier_nphy(struct brcms_phy *pi, u16 mask, u16 val);
> +
> +void wlc_phy_rx_iq_est_nphy(struct brcms_phy *pi, struct phy_iq_est *est,
> + u16 num_samps, u8 wait_time, u8 wait_for_crs);
> +
> +void wlc_phy_rx_iq_coeffs_nphy(struct brcms_phy *pi, u8 write,
> + struct nphy_iq_comp *comp);
> +void wlc_phy_aci_and_noise_reduction_nphy(struct brcms_phy *pi);
> +
> +void wlc_phy_rxcore_setstate_nphy(struct brcms_phy_pub *pih, u8 rxcore_bitmask);
> +u8 wlc_phy_rxcore_getstate_nphy(struct brcms_phy_pub *pih);
> +
> +void wlc_phy_txpwrctrl_enable_nphy(struct brcms_phy *pi, u8 ctrl_type);
> +void wlc_phy_txpwr_fixpower_nphy(struct brcms_phy *pi);
> +void wlc_phy_txpwr_apply_nphy(struct brcms_phy *pi);
> +void wlc_phy_txpwr_papd_cal_nphy(struct brcms_phy *pi);
> +u16 wlc_phy_txpwr_idx_get_nphy(struct brcms_phy *pi);
> +
> +struct nphy_txgains wlc_phy_get_tx_gain_nphy(struct brcms_phy *pi);
> +int wlc_phy_cal_txiqlo_nphy(struct brcms_phy *pi,
> + struct nphy_txgains target_gain, bool full, bool m);
> +int wlc_phy_cal_rxiq_nphy(struct brcms_phy *pi, struct nphy_txgains target_gain,
> + u8 type, bool d);
> +void wlc_phy_txpwr_index_nphy(struct brcms_phy *pi, u8 core_mask,
> + s8 txpwrindex, bool res);
> +void wlc_phy_rssisel_nphy(struct brcms_phy *pi, u8 core, u8 rssi_type);
> +int wlc_phy_poll_rssi_nphy(struct brcms_phy *pi, u8 rssi_type,
> + s32 *rssi_buf, u8 nsamps);
> +void wlc_phy_rssi_cal_nphy(struct brcms_phy *pi);
> +int wlc_phy_aci_scan_nphy(struct brcms_phy *pi);
> +void wlc_phy_cal_txgainctrl_nphy(struct brcms_phy *pi, s32 dBm_targetpower,
> + bool debug);
> +int wlc_phy_tx_tone_nphy(struct brcms_phy *pi, u32 f_kHz, u16 max_val, u8 mode,
> + u8, bool);
> +void wlc_phy_stopplayback_nphy(struct brcms_phy *pi);
> +void wlc_phy_est_tonepwr_nphy(struct brcms_phy *pi, s32 *qdBm_pwrbuf,
> + u8 num_samps);
> +void wlc_phy_radio205x_vcocal_nphy(struct brcms_phy *pi);
> +
> +int wlc_phy_rssi_compute_nphy(struct brcms_phy *pi, struct d11rxhdr *rxh);
>
> #define NPHY_TESTPATTERN_BPHY_EVM 0
> #define NPHY_TESTPATTERN_BPHY_RFCS 1
>
> -extern void wlc_phy_nphy_tkip_rifs_war(struct brcms_phy *pi, u8 rifs);
> +void wlc_phy_nphy_tkip_rifs_war(struct brcms_phy *pi, u8 rifs);
>
> void wlc_phy_get_pwrdet_offsets(struct brcms_phy *pi, s8 *cckoffset,
> s8 *ofdmoffset);
> -extern s8 wlc_phy_upd_rssi_offset(struct brcms_phy *pi, s8 rssi,
> - u16 chanspec);
> +s8 wlc_phy_upd_rssi_offset(struct brcms_phy *pi, s8 rssi, u16 chanspec);
>
> -extern bool wlc_phy_n_txpower_ipa_ison(struct brcms_phy *pih);
> +bool wlc_phy_n_txpower_ipa_ison(struct brcms_phy *pih);
> #endif /* _BRCM_PHY_INT_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/phy_shim.h b/drivers/net/wireless/brcm80211/brcmsmac/phy_shim.h
> index 2c5b66b..dd87747 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/phy_shim.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/phy_shim.h
> @@ -124,56 +124,49 @@
>
> struct brcms_phy;
>
> -extern struct phy_shim_info *wlc_phy_shim_attach(struct brcms_hardware *wlc_hw,
> - struct brcms_info *wl,
> - struct brcms_c_info *wlc);
> -extern void wlc_phy_shim_detach(struct phy_shim_info *physhim);
> +struct phy_shim_info *wlc_phy_shim_attach(struct brcms_hardware *wlc_hw,
> + struct brcms_info *wl,
> + struct brcms_c_info *wlc);
> +void wlc_phy_shim_detach(struct phy_shim_info *physhim);
>
> /* PHY to WL utility functions */
> -extern struct wlapi_timer *wlapi_init_timer(struct phy_shim_info *physhim,
> - void (*fn) (struct brcms_phy *pi),
> - void *arg, const char *name);
> -extern void wlapi_free_timer(struct wlapi_timer *t);
> -extern void wlapi_add_timer(struct wlapi_timer *t, uint ms, int periodic);
> -extern bool wlapi_del_timer(struct wlapi_timer *t);
> -extern void wlapi_intrson(struct phy_shim_info *physhim);
> -extern u32 wlapi_intrsoff(struct phy_shim_info *physhim);
> -extern void wlapi_intrsrestore(struct phy_shim_info *physhim,
> - u32 macintmask);
> -
> -extern void wlapi_bmac_write_shm(struct phy_shim_info *physhim, uint offset,
> - u16 v);
> -extern u16 wlapi_bmac_read_shm(struct phy_shim_info *physhim, uint offset);
> -extern void wlapi_bmac_mhf(struct phy_shim_info *physhim, u8 idx,
> - u16 mask, u16 val, int bands);
> -extern void wlapi_bmac_corereset(struct phy_shim_info *physhim, u32 flags);
> -extern void wlapi_suspend_mac_and_wait(struct phy_shim_info *physhim);
> -extern void wlapi_switch_macfreq(struct phy_shim_info *physhim, u8 spurmode);
> -extern void wlapi_enable_mac(struct phy_shim_info *physhim);
> -extern void wlapi_bmac_mctrl(struct phy_shim_info *physhim, u32 mask,
> - u32 val);
> -extern void wlapi_bmac_phy_reset(struct phy_shim_info *physhim);
> -extern void wlapi_bmac_bw_set(struct phy_shim_info *physhim, u16 bw);
> -extern void wlapi_bmac_phyclk_fgc(struct phy_shim_info *physhim, bool clk);
> -extern void wlapi_bmac_macphyclk_set(struct phy_shim_info *physhim, bool clk);
> -extern void wlapi_bmac_core_phypll_ctl(struct phy_shim_info *physhim, bool on);
> -extern void wlapi_bmac_core_phypll_reset(struct phy_shim_info *physhim);
> -extern void wlapi_bmac_ucode_wake_override_phyreg_set(struct phy_shim_info *
> - physhim);
> -extern void wlapi_bmac_ucode_wake_override_phyreg_clear(struct phy_shim_info *
> - physhim);
> -extern void wlapi_bmac_write_template_ram(struct phy_shim_info *physhim, int o,
> - int len, void *buf);
> -extern u16 wlapi_bmac_rate_shm_offset(struct phy_shim_info *physhim,
> - u8 rate);
> -extern void wlapi_ucode_sample_init(struct phy_shim_info *physhim);
> -extern void wlapi_copyfrom_objmem(struct phy_shim_info *physhim, uint,
> - void *buf, int, u32 sel);
> -extern void wlapi_copyto_objmem(struct phy_shim_info *physhim, uint,
> - const void *buf, int, u32);
> -
> -extern void wlapi_high_update_phy_mode(struct phy_shim_info *physhim,
> - u32 phy_mode);
> -extern u16 wlapi_bmac_get_txant(struct phy_shim_info *physhim);
> +struct wlapi_timer *wlapi_init_timer(struct phy_shim_info *physhim,
> + void (*fn)(struct brcms_phy *pi),
> + void *arg, const char *name);
> +void wlapi_free_timer(struct wlapi_timer *t);
> +void wlapi_add_timer(struct wlapi_timer *t, uint ms, int periodic);
> +bool wlapi_del_timer(struct wlapi_timer *t);
> +void wlapi_intrson(struct phy_shim_info *physhim);
> +u32 wlapi_intrsoff(struct phy_shim_info *physhim);
> +void wlapi_intrsrestore(struct phy_shim_info *physhim, u32 macintmask);
> +
> +void wlapi_bmac_write_shm(struct phy_shim_info *physhim, uint offset, u16 v);
> +u16 wlapi_bmac_read_shm(struct phy_shim_info *physhim, uint offset);
> +void wlapi_bmac_mhf(struct phy_shim_info *physhim, u8 idx, u16 mask, u16 val,
> + int bands);
> +void wlapi_bmac_corereset(struct phy_shim_info *physhim, u32 flags);
> +void wlapi_suspend_mac_and_wait(struct phy_shim_info *physhim);
> +void wlapi_switch_macfreq(struct phy_shim_info *physhim, u8 spurmode);
> +void wlapi_enable_mac(struct phy_shim_info *physhim);
> +void wlapi_bmac_mctrl(struct phy_shim_info *physhim, u32 mask, u32 val);
> +void wlapi_bmac_phy_reset(struct phy_shim_info *physhim);
> +void wlapi_bmac_bw_set(struct phy_shim_info *physhim, u16 bw);
> +void wlapi_bmac_phyclk_fgc(struct phy_shim_info *physhim, bool clk);
> +void wlapi_bmac_macphyclk_set(struct phy_shim_info *physhim, bool clk);
> +void wlapi_bmac_core_phypll_ctl(struct phy_shim_info *physhim, bool on);
> +void wlapi_bmac_core_phypll_reset(struct phy_shim_info *physhim);
> +void wlapi_bmac_ucode_wake_override_phyreg_set(struct phy_shim_info *physhim);
> +void wlapi_bmac_ucode_wake_override_phyreg_clear(struct phy_shim_info *physhim);
> +void wlapi_bmac_write_template_ram(struct phy_shim_info *physhim, int o,
> + int len, void *buf);
> +u16 wlapi_bmac_rate_shm_offset(struct phy_shim_info *physhim, u8 rate);
> +void wlapi_ucode_sample_init(struct phy_shim_info *physhim);
> +void wlapi_copyfrom_objmem(struct phy_shim_info *physhim, uint, void *buf,
> + int, u32 sel);
> +void wlapi_copyto_objmem(struct phy_shim_info *physhim, uint, const void *buf,
> + int, u32);
> +
> +void wlapi_high_update_phy_mode(struct phy_shim_info *physhim, u32 phy_mode);
> +u16 wlapi_bmac_get_txant(struct phy_shim_info *physhim);
>
> #endif /* _BRCM_PHY_SHIM_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/pmu.h b/drivers/net/wireless/brcm80211/brcmsmac/pmu.h
> index 20e2012..a014bbc 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/pmu.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/pmu.h
> @@ -20,7 +20,7 @@
>
> #include "types.h"
>
> -extern u16 si_pmu_fast_pwrup_delay(struct si_pub *sih);
> -extern u32 si_pmu_measure_alpclk(struct si_pub *sih);
> +u16 si_pmu_fast_pwrup_delay(struct si_pub *sih);
> +u32 si_pmu_measure_alpclk(struct si_pub *sih);
>
> #endif /* _BRCM_PMU_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/pub.h b/drivers/net/wireless/brcm80211/brcmsmac/pub.h
> index d36ea5e..4da38cb 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/pub.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/pub.h
> @@ -266,83 +266,76 @@ struct brcms_antselcfg {
> };
>
> /* common functions for every port */
> -extern struct brcms_c_info *
> -brcms_c_attach(struct brcms_info *wl, struct bcma_device *core, uint unit,
> - bool piomode, uint *perr);
> -extern uint brcms_c_detach(struct brcms_c_info *wlc);
> -extern int brcms_c_up(struct brcms_c_info *wlc);
> -extern uint brcms_c_down(struct brcms_c_info *wlc);
> -
> -extern bool brcms_c_chipmatch(struct bcma_device *core);
> -extern void brcms_c_init(struct brcms_c_info *wlc, bool mute_tx);
> -extern void brcms_c_reset(struct brcms_c_info *wlc);
> -
> -extern void brcms_c_intrson(struct brcms_c_info *wlc);
> -extern u32 brcms_c_intrsoff(struct brcms_c_info *wlc);
> -extern void brcms_c_intrsrestore(struct brcms_c_info *wlc, u32 macintmask);
> -extern bool brcms_c_intrsupd(struct brcms_c_info *wlc);
> -extern bool brcms_c_isr(struct brcms_c_info *wlc);
> -extern bool brcms_c_dpc(struct brcms_c_info *wlc, bool bounded);
> -extern bool brcms_c_sendpkt_mac80211(struct brcms_c_info *wlc,
> - struct sk_buff *sdu,
> - struct ieee80211_hw *hw);
> -extern bool brcms_c_aggregatable(struct brcms_c_info *wlc, u8 tid);
> -extern void brcms_c_protection_upd(struct brcms_c_info *wlc, uint idx,
> - int val);
> -extern int brcms_c_get_header_len(void);
> -extern void brcms_c_set_addrmatch(struct brcms_c_info *wlc,
> - int match_reg_offset,
> - const u8 *addr);
> -extern void brcms_c_wme_setparams(struct brcms_c_info *wlc, u16 aci,
> - const struct ieee80211_tx_queue_params *arg,
> - bool suspend);
> -extern struct brcms_pub *brcms_c_pub(struct brcms_c_info *wlc);
> -extern void brcms_c_ampdu_flush(struct brcms_c_info *wlc,
> - struct ieee80211_sta *sta, u16 tid);
> -extern void brcms_c_ampdu_tx_operational(struct brcms_c_info *wlc, u8 tid,
> - u8 ba_wsize, uint max_rx_ampdu_bytes);
> -extern int brcms_c_module_register(struct brcms_pub *pub,
> - const char *name, struct brcms_info *hdl,
> - int (*down_fn)(void *handle));
> -extern int brcms_c_module_unregister(struct brcms_pub *pub, const char *name,
> - struct brcms_info *hdl);
> -extern void brcms_c_suspend_mac_and_wait(struct brcms_c_info *wlc);
> -extern void brcms_c_enable_mac(struct brcms_c_info *wlc);
> -extern void brcms_c_associate_upd(struct brcms_c_info *wlc, bool state);
> -extern void brcms_c_scan_start(struct brcms_c_info *wlc);
> -extern void brcms_c_scan_stop(struct brcms_c_info *wlc);
> -extern int brcms_c_get_curband(struct brcms_c_info *wlc);
> -extern int brcms_c_set_channel(struct brcms_c_info *wlc, u16 channel);
> -extern int brcms_c_set_rate_limit(struct brcms_c_info *wlc, u16 srl, u16 lrl);
> -extern void brcms_c_get_current_rateset(struct brcms_c_info *wlc,
> +struct brcms_c_info *brcms_c_attach(struct brcms_info *wl,
> + struct bcma_device *core, uint unit,
> + bool piomode, uint *perr);
> +uint brcms_c_detach(struct brcms_c_info *wlc);
> +int brcms_c_up(struct brcms_c_info *wlc);
> +uint brcms_c_down(struct brcms_c_info *wlc);
> +
> +bool brcms_c_chipmatch(struct bcma_device *core);
> +void brcms_c_init(struct brcms_c_info *wlc, bool mute_tx);
> +void brcms_c_reset(struct brcms_c_info *wlc);
> +
> +void brcms_c_intrson(struct brcms_c_info *wlc);
> +u32 brcms_c_intrsoff(struct brcms_c_info *wlc);
> +void brcms_c_intrsrestore(struct brcms_c_info *wlc, u32 macintmask);
> +bool brcms_c_intrsupd(struct brcms_c_info *wlc);
> +bool brcms_c_isr(struct brcms_c_info *wlc);
> +bool brcms_c_dpc(struct brcms_c_info *wlc, bool bounded);
> +bool brcms_c_sendpkt_mac80211(struct brcms_c_info *wlc, struct sk_buff *sdu,
> + struct ieee80211_hw *hw);
> +bool brcms_c_aggregatable(struct brcms_c_info *wlc, u8 tid);
> +void brcms_c_protection_upd(struct brcms_c_info *wlc, uint idx, int val);
> +int brcms_c_get_header_len(void);
> +void brcms_c_set_addrmatch(struct brcms_c_info *wlc, int match_reg_offset,
> + const u8 *addr);
> +void brcms_c_wme_setparams(struct brcms_c_info *wlc, u16 aci,
> + const struct ieee80211_tx_queue_params *arg,
> + bool suspend);
> +struct brcms_pub *brcms_c_pub(struct brcms_c_info *wlc);
> +void brcms_c_ampdu_flush(struct brcms_c_info *wlc, struct ieee80211_sta *sta,
> + u16 tid);
> +void brcms_c_ampdu_tx_operational(struct brcms_c_info *wlc, u8 tid,
> + u8 ba_wsize, uint max_rx_ampdu_bytes);
> +int brcms_c_module_register(struct brcms_pub *pub, const char *name,
> + struct brcms_info *hdl,
> + int (*down_fn)(void *handle));
> +int brcms_c_module_unregister(struct brcms_pub *pub, const char *name,
> + struct brcms_info *hdl);
> +void brcms_c_suspend_mac_and_wait(struct brcms_c_info *wlc);
> +void brcms_c_enable_mac(struct brcms_c_info *wlc);
> +void brcms_c_associate_upd(struct brcms_c_info *wlc, bool state);
> +void brcms_c_scan_start(struct brcms_c_info *wlc);
> +void brcms_c_scan_stop(struct brcms_c_info *wlc);
> +int brcms_c_get_curband(struct brcms_c_info *wlc);
> +int brcms_c_set_channel(struct brcms_c_info *wlc, u16 channel);
> +int brcms_c_set_rate_limit(struct brcms_c_info *wlc, u16 srl, u16 lrl);
> +void brcms_c_get_current_rateset(struct brcms_c_info *wlc,
> struct brcm_rateset *currs);
> -extern int brcms_c_set_rateset(struct brcms_c_info *wlc,
> - struct brcm_rateset *rs);
> -extern int brcms_c_set_beacon_period(struct brcms_c_info *wlc, u16 period);
> -extern u16 brcms_c_get_phy_type(struct brcms_c_info *wlc, int phyidx);
> -extern void brcms_c_set_shortslot_override(struct brcms_c_info *wlc,
> +int brcms_c_set_rateset(struct brcms_c_info *wlc, struct brcm_rateset *rs);
> +int brcms_c_set_beacon_period(struct brcms_c_info *wlc, u16 period);
> +u16 brcms_c_get_phy_type(struct brcms_c_info *wlc, int phyidx);
> +void brcms_c_set_shortslot_override(struct brcms_c_info *wlc,
> s8 sslot_override);
> -extern void brcms_c_set_beacon_listen_interval(struct brcms_c_info *wlc,
> - u8 interval);
> -extern u64 brcms_c_tsf_get(struct brcms_c_info *wlc);
> -extern void brcms_c_tsf_set(struct brcms_c_info *wlc, u64 tsf);
> -extern int brcms_c_set_tx_power(struct brcms_c_info *wlc, int txpwr);
> -extern int brcms_c_get_tx_power(struct brcms_c_info *wlc);
> -extern bool brcms_c_check_radio_disabled(struct brcms_c_info *wlc);
> -extern void brcms_c_mute(struct brcms_c_info *wlc, bool on);
> -extern bool brcms_c_tx_flush_completed(struct brcms_c_info *wlc);
> -extern void brcms_c_start_station(struct brcms_c_info *wlc, u8 *addr);
> -extern void brcms_c_start_ap(struct brcms_c_info *wlc, u8 *addr,
> - const u8 *bssid, u8 *ssid, size_t ssid_len);
> -extern void brcms_c_start_adhoc(struct brcms_c_info *wlc, u8 *addr);
> -extern void brcms_c_update_beacon(struct brcms_c_info *wlc);
> -extern void brcms_c_set_new_beacon(struct brcms_c_info *wlc,
> - struct sk_buff *beacon, u16 tim_offset,
> - u16 dtim_period);
> -extern void brcms_c_set_new_probe_resp(struct brcms_c_info *wlc,
> - struct sk_buff *probe_resp);
> -extern void brcms_c_enable_probe_resp(struct brcms_c_info *wlc, bool enable);
> -extern void brcms_c_set_ssid(struct brcms_c_info *wlc, u8 *ssid,
> - size_t ssid_len);
> +void brcms_c_set_beacon_listen_interval(struct brcms_c_info *wlc, u8 interval);
> +u64 brcms_c_tsf_get(struct brcms_c_info *wlc);
> +void brcms_c_tsf_set(struct brcms_c_info *wlc, u64 tsf);
> +int brcms_c_set_tx_power(struct brcms_c_info *wlc, int txpwr);
> +int brcms_c_get_tx_power(struct brcms_c_info *wlc);
> +bool brcms_c_check_radio_disabled(struct brcms_c_info *wlc);
> +void brcms_c_mute(struct brcms_c_info *wlc, bool on);
> +bool brcms_c_tx_flush_completed(struct brcms_c_info *wlc);
> +void brcms_c_start_station(struct brcms_c_info *wlc, u8 *addr);
> +void brcms_c_start_ap(struct brcms_c_info *wlc, u8 *addr, const u8 *bssid,
> + u8 *ssid, size_t ssid_len);
> +void brcms_c_start_adhoc(struct brcms_c_info *wlc, u8 *addr);
> +void brcms_c_update_beacon(struct brcms_c_info *wlc);
> +void brcms_c_set_new_beacon(struct brcms_c_info *wlc, struct sk_buff *beacon,
> + u16 tim_offset, u16 dtim_period);
> +void brcms_c_set_new_probe_resp(struct brcms_c_info *wlc,
> + struct sk_buff *probe_resp);
> +void brcms_c_enable_probe_resp(struct brcms_c_info *wlc, bool enable);
> +void brcms_c_set_ssid(struct brcms_c_info *wlc, u8 *ssid, size_t ssid_len);
>
> #endif /* _BRCM_PUB_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/rate.h b/drivers/net/wireless/brcm80211/brcmsmac/rate.h
> index 980d578..5bb88b7 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/rate.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/rate.h
> @@ -216,34 +216,30 @@ static inline u8 cck_phy2mac_rate(u8 signal)
>
> /* sanitize, and sort a rateset with the basic bit(s) preserved, validate
> * rateset */
> -extern bool
> -brcms_c_rate_hwrs_filter_sort_validate(struct brcms_c_rateset *rs,
> - const struct brcms_c_rateset *hw_rs,
> - bool check_brate, u8 txstreams);
> +bool brcms_c_rate_hwrs_filter_sort_validate(struct brcms_c_rateset *rs,
> + const struct brcms_c_rateset *hw_rs,
> + bool check_brate, u8 txstreams);
> /* copy rateset src to dst as-is (no masking or sorting) */
> -extern void brcms_c_rateset_copy(const struct brcms_c_rateset *src,
> - struct brcms_c_rateset *dst);
> +void brcms_c_rateset_copy(const struct brcms_c_rateset *src,
> + struct brcms_c_rateset *dst);
>
> /* would be nice to have these documented ... */
> -extern u32 brcms_c_compute_rspec(struct d11rxhdr *rxh, u8 *plcp);
> -
> -extern void brcms_c_rateset_filter(struct brcms_c_rateset *src,
> - struct brcms_c_rateset *dst, bool basic_only, u8 rates, uint xmask,
> - bool mcsallow);
> -
> -extern void
> -brcms_c_rateset_default(struct brcms_c_rateset *rs_tgt,
> - const struct brcms_c_rateset *rs_hw, uint phy_type,
> - int bandtype, bool cck_only, uint rate_mask,
> - bool mcsallow, u8 bw, u8 txstreams);
> -
> -extern s16 brcms_c_rate_legacy_phyctl(uint rate);
> -
> -extern void brcms_c_rateset_mcs_upd(struct brcms_c_rateset *rs, u8 txstreams);
> -extern void brcms_c_rateset_mcs_clear(struct brcms_c_rateset *rateset);
> -extern void brcms_c_rateset_mcs_build(struct brcms_c_rateset *rateset,
> - u8 txstreams);
> -extern void brcms_c_rateset_bw_mcs_filter(struct brcms_c_rateset *rateset,
> - u8 bw);
> +u32 brcms_c_compute_rspec(struct d11rxhdr *rxh, u8 *plcp);
> +
> +void brcms_c_rateset_filter(struct brcms_c_rateset *src,
> + struct brcms_c_rateset *dst, bool basic_only,
> + u8 rates, uint xmask, bool mcsallow);
> +
> +void brcms_c_rateset_default(struct brcms_c_rateset *rs_tgt,
> + const struct brcms_c_rateset *rs_hw, uint phy_type,
> + int bandtype, bool cck_only, uint rate_mask,
> + bool mcsallow, u8 bw, u8 txstreams);
> +
> +s16 brcms_c_rate_legacy_phyctl(uint rate);
> +
> +void brcms_c_rateset_mcs_upd(struct brcms_c_rateset *rs, u8 txstreams);
> +void brcms_c_rateset_mcs_clear(struct brcms_c_rateset *rateset);
> +void brcms_c_rateset_mcs_build(struct brcms_c_rateset *rateset, u8 txstreams);
> +void brcms_c_rateset_bw_mcs_filter(struct brcms_c_rateset *rateset, u8 bw);
>
> #endif /* _BRCM_RATE_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/stf.h b/drivers/net/wireless/brcm80211/brcmsmac/stf.h
> index 19f6580..ba94930 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/stf.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/stf.h
> @@ -19,24 +19,19 @@
>
> #include "types.h"
>
> -extern int brcms_c_stf_attach(struct brcms_c_info *wlc);
> -extern void brcms_c_stf_detach(struct brcms_c_info *wlc);
> +int brcms_c_stf_attach(struct brcms_c_info *wlc);
> +void brcms_c_stf_detach(struct brcms_c_info *wlc);
>
> -extern void brcms_c_tempsense_upd(struct brcms_c_info *wlc);
> -extern void brcms_c_stf_ss_algo_channel_get(struct brcms_c_info *wlc,
> - u16 *ss_algo_channel,
> - u16 chanspec);
> -extern int brcms_c_stf_ss_update(struct brcms_c_info *wlc,
> - struct brcms_band *band);
> -extern void brcms_c_stf_phy_txant_upd(struct brcms_c_info *wlc);
> -extern int brcms_c_stf_txchain_set(struct brcms_c_info *wlc, s32 int_val,
> - bool force);
> -extern bool brcms_c_stf_stbc_rx_set(struct brcms_c_info *wlc, s32 int_val);
> -extern void brcms_c_stf_phy_txant_upd(struct brcms_c_info *wlc);
> -extern void brcms_c_stf_phy_chain_calc(struct brcms_c_info *wlc);
> -extern u16 brcms_c_stf_phytxchain_sel(struct brcms_c_info *wlc,
> - u32 rspec);
> -extern u16 brcms_c_stf_d11hdrs_phyctl_txant(struct brcms_c_info *wlc,
> - u32 rspec);
> +void brcms_c_tempsense_upd(struct brcms_c_info *wlc);
> +void brcms_c_stf_ss_algo_channel_get(struct brcms_c_info *wlc,
> + u16 *ss_algo_channel, u16 chanspec);
> +int brcms_c_stf_ss_update(struct brcms_c_info *wlc, struct brcms_band *band);
> +void brcms_c_stf_phy_txant_upd(struct brcms_c_info *wlc);
> +int brcms_c_stf_txchain_set(struct brcms_c_info *wlc, s32 int_val, bool force);
> +bool brcms_c_stf_stbc_rx_set(struct brcms_c_info *wlc, s32 int_val);
> +void brcms_c_stf_phy_txant_upd(struct brcms_c_info *wlc);
> +void brcms_c_stf_phy_chain_calc(struct brcms_c_info *wlc);
> +u16 brcms_c_stf_phytxchain_sel(struct brcms_c_info *wlc, u32 rspec);
> +u16 brcms_c_stf_d11hdrs_phyctl_txant(struct brcms_c_info *wlc, u32 rspec);
>
> #endif /* _BRCM_STF_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/ucode_loader.h b/drivers/net/wireless/brcm80211/brcmsmac/ucode_loader.h
> index 18750a8..c87dd89 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/ucode_loader.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/ucode_loader.h
> @@ -43,16 +43,14 @@ struct brcms_ucode {
> u32 *bcm43xx_bomminor;
> };
>
> -extern int
> -brcms_ucode_data_init(struct brcms_info *wl, struct brcms_ucode *ucode);
> +int brcms_ucode_data_init(struct brcms_info *wl, struct brcms_ucode *ucode);
>
> -extern void brcms_ucode_data_free(struct brcms_ucode *ucode);
> +void brcms_ucode_data_free(struct brcms_ucode *ucode);
>
> -extern int brcms_ucode_init_buf(struct brcms_info *wl, void **pbuf,
> - unsigned int idx);
> -extern int brcms_ucode_init_uint(struct brcms_info *wl, size_t *n_bytes,
> - unsigned int idx);
> -extern void brcms_ucode_free_buf(void *);
> -extern int brcms_check_firmwares(struct brcms_info *wl);
> +int brcms_ucode_init_buf(struct brcms_info *wl, void **pbuf, unsigned int idx);
> +int brcms_ucode_init_uint(struct brcms_info *wl, size_t *n_bytes,
> + unsigned int idx);
> +void brcms_ucode_free_buf(void *);
> +int brcms_check_firmwares(struct brcms_info *wl);
>
> #endif /* _BRCM_UCODE_H_ */
> diff --git a/drivers/net/wireless/brcm80211/include/brcmu_d11.h b/drivers/net/wireless/brcm80211/include/brcmu_d11.h
> index 92623f0..8660a2c 100644
> --- a/drivers/net/wireless/brcm80211/include/brcmu_d11.h
> +++ b/drivers/net/wireless/brcm80211/include/brcmu_d11.h
> @@ -140,6 +140,6 @@ struct brcmu_d11inf {
> void (*decchspec)(struct brcmu_chan *ch);
> };
>
> -extern void brcmu_d11_attach(struct brcmu_d11inf *d11inf);
> +void brcmu_d11_attach(struct brcmu_d11inf *d11inf);
>
> #endif /* _BRCMU_CHANNELS_H_ */
> diff --git a/drivers/net/wireless/brcm80211/include/brcmu_utils.h b/drivers/net/wireless/brcm80211/include/brcmu_utils.h
> index 898cacb..8ba445b 100644
> --- a/drivers/net/wireless/brcm80211/include/brcmu_utils.h
> +++ b/drivers/net/wireless/brcm80211/include/brcmu_utils.h
> @@ -114,31 +114,29 @@ static inline struct sk_buff *pktq_ppeek_tail(struct pktq *pq, int prec)
> return skb_peek_tail(&pq->q[prec].skblist);
> }
>
> -extern struct sk_buff *brcmu_pktq_penq(struct pktq *pq, int prec,
> - struct sk_buff *p);
> -extern struct sk_buff *brcmu_pktq_penq_head(struct pktq *pq, int prec,
> - struct sk_buff *p);
> -extern struct sk_buff *brcmu_pktq_pdeq(struct pktq *pq, int prec);
> -extern struct sk_buff *brcmu_pktq_pdeq_tail(struct pktq *pq, int prec);
> -extern struct sk_buff *brcmu_pktq_pdeq_match(struct pktq *pq, int prec,
> - bool (*match_fn)(struct sk_buff *p,
> - void *arg),
> - void *arg);
> +struct sk_buff *brcmu_pktq_penq(struct pktq *pq, int prec, struct sk_buff *p);
> +struct sk_buff *brcmu_pktq_penq_head(struct pktq *pq, int prec,
> + struct sk_buff *p);
> +struct sk_buff *brcmu_pktq_pdeq(struct pktq *pq, int prec);
> +struct sk_buff *brcmu_pktq_pdeq_tail(struct pktq *pq, int prec);
> +struct sk_buff *brcmu_pktq_pdeq_match(struct pktq *pq, int prec,
> + bool (*match_fn)(struct sk_buff *p,
> + void *arg),
> + void *arg);
>
> /* packet primitives */
> -extern struct sk_buff *brcmu_pkt_buf_get_skb(uint len);
> -extern void brcmu_pkt_buf_free_skb(struct sk_buff *skb);
> +struct sk_buff *brcmu_pkt_buf_get_skb(uint len);
> +void brcmu_pkt_buf_free_skb(struct sk_buff *skb);
>
> /* Empty the queue at particular precedence level */
> /* callback function fn(pkt, arg) returns true if pkt belongs to if */
> -extern void brcmu_pktq_pflush(struct pktq *pq, int prec,
> - bool dir, bool (*fn)(struct sk_buff *, void *), void *arg);
> +void brcmu_pktq_pflush(struct pktq *pq, int prec, bool dir,
> + bool (*fn)(struct sk_buff *, void *), void *arg);
>
> /* operations on a set of precedences in packet queue */
>
> -extern int brcmu_pktq_mlen(struct pktq *pq, uint prec_bmp);
> -extern struct sk_buff *brcmu_pktq_mdeq(struct pktq *pq, uint prec_bmp,
> - int *prec_out);
> +int brcmu_pktq_mlen(struct pktq *pq, uint prec_bmp);
> +struct sk_buff *brcmu_pktq_mdeq(struct pktq *pq, uint prec_bmp, int *prec_out);
>
> /* operations on packet queue as a whole */
>
> @@ -167,11 +165,11 @@ static inline bool pktq_empty(struct pktq *pq)
> return pq->len == 0;
> }
>
> -extern void brcmu_pktq_init(struct pktq *pq, int num_prec, int max_len);
> +void brcmu_pktq_init(struct pktq *pq, int num_prec, int max_len);
> /* prec_out may be NULL if caller is not interested in return value */
> -extern struct sk_buff *brcmu_pktq_peek_tail(struct pktq *pq, int *prec_out);
> -extern void brcmu_pktq_flush(struct pktq *pq, bool dir,
> - bool (*fn)(struct sk_buff *, void *), void *arg);
> +struct sk_buff *brcmu_pktq_peek_tail(struct pktq *pq, int *prec_out);
> +void brcmu_pktq_flush(struct pktq *pq, bool dir,
> + bool (*fn)(struct sk_buff *, void *), void *arg);
>
> /* externs */
> /* ip address */
> @@ -204,13 +202,13 @@ static inline u16 brcmu_maskget16(u16 var, u16 mask, u8 shift)
> /* externs */
> /* format/print */
> #ifdef DEBUG
> -extern void brcmu_prpkt(const char *msg, struct sk_buff *p0);
> +void brcmu_prpkt(const char *msg, struct sk_buff *p0);
> #else
> #define brcmu_prpkt(a, b)
> #endif /* DEBUG */
>
> #ifdef DEBUG
> -extern __printf(3, 4)
> +__printf(3, 4)
> void brcmu_dbg_hex_dump(const void *data, size_t size, const char *fmt, ...);
> #else
> __printf(3, 4)
>
^ permalink raw reply
* Re: [PATCH 04/11] ath: Remove extern from function prototypes
From: Kalle Valo @ 2013-09-26 7:30 UTC (permalink / raw)
To: Joe Perches
Cc: netdev, linux-wireless, Jouni Malinen, Luis R. Rodriguez, ath10k,
John W. Linville, ath9k-devel, David S. Miller, linux-kernel
In-Reply-To: <a3dabaf02d36dbb4051188b706a3e66e6465c56b.1380137609.git.joe@perches.com>
Joe Perches <joe@perches.com> writes:
> There are a mix of function prototypes with and without extern
> in the kernel sources. Standardize on not using extern for
> function prototypes.
>
> Function prototypes don't need to be written with extern.
> extern is assumed by the compiler. Its use is as unnecessary as
> using auto to declare automatic/local variables in a block.
>
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> drivers/net/wireless/ath/ath10k/debug.h | 8 ++++----
> drivers/net/wireless/ath/ath6kl/common.h | 3 +--
> drivers/net/wireless/ath/ath6kl/debug.h | 9 ++++-----
> drivers/net/wireless/ath/ath9k/ath9k.h | 2 +-
> 4 files changed, 10 insertions(+), 12 deletions(-)
For the ath10k and ath6kl changes:
Acked-by: Kalle Valo <kvalo@qca.qualcomm.com>
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH 0/5] ath10k: improve RX performance
From: Kalle Valo @ 2013-09-26 7:21 UTC (permalink / raw)
To: Michal Kazior; +Cc: ath10k, linux-wireless
In-Reply-To: <1380028158-861-1-git-send-email-michal.kazior@tieto.com>
Michal Kazior <michal.kazior@tieto.com> writes:
> This patchset gives clear RX performance
> improvement on AP135. Throughput is at least
> doubled (300mbps -> 600mbps, UDP RX, 2x2).
>
> This contains a workaround for
> retransmission/duplication recovery.
>
> There's a pending patch for mac80211 that will
> allow proper individiual A-MSDU subframe
> reporting.
>
> Changes since RFC:
> * comments fixes (Kalle)
> * one patch extracted/split (Kalle)
> * commit message adjustments
>
>
> Michal Kazior (5):
> ath10k: report A-MSDU subframes individually
> ath10k: document decap modes
> ath10k: cleanup RX decap handling
> ath10k: fix Native Wifi decap mode RX
> ath10k: align RX frames properly
All five applies, thanks.
There were few long lines, I fixed those myself. Can you please double
check that I didn't break anything?
Kalle
For patch 1 I did:
diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c
index e30b95c..c5f1800 100644
--- a/drivers/net/wireless/ath/ath10k/htt_rx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
@@ -650,7 +650,7 @@ static void ath10k_htt_rx_amsdu(struct ath10k_htt *htt,
first = skb;
while (skb) {
void *decap_hdr;
- int decap_len;
+ int len;
rxd = (void *)skb->data - sizeof(*rxd);
fmt = MS(__le32_to_cpu(rxd->msdu_start.info1),
@@ -661,8 +661,10 @@ static void ath10k_htt_rx_amsdu(struct ath10k_htt *htt,
/* First frame in an A-MSDU chain has more decapped data. */
if (skb == first) {
- decap_hdr += round_up(ieee80211_hdrlen(hdr->frame_control), 4);
- decap_hdr += round_up(ath10k_htt_rx_crypto_param_len(enctype), 4);
+ len = round_up(ieee80211_hdrlen(hdr->frame_control), 4);
+ len += round_up(ath10k_htt_rx_crypto_param_len(enctype),
+ 4);
+ decap_hdr += len;
}
switch (fmt) {
@@ -672,12 +674,12 @@ static void ath10k_htt_rx_amsdu(struct ath10k_htt *htt,
case RX_MSDU_DECAP_NATIVE_WIFI:
break;
case RX_MSDU_DECAP_ETHERNET2_DIX:
- decap_len = 0;
- decap_len += sizeof(struct rfc1042_hdr);
- decap_len += sizeof(struct amsdu_subframe_hdr);
+ len = 0;
+ len += sizeof(struct rfc1042_hdr);
+ len += sizeof(struct amsdu_subframe_hdr);
skb_pull(skb, sizeof(struct ethhdr));
- memcpy(skb_push(skb, decap_len), decap_hdr, decap_len);
+ memcpy(skb_push(skb, len), decap_hdr, len);
memcpy(skb_push(skb, hdr_len), hdr, hdr_len);
break;
case RX_MSDU_DECAP_8023_SNAP_LLC:
And for patch 3:
diff --cc drivers/net/wireless/ath/ath10k/htt_rx.c
index c5f1800,c94ced8..0000000
--- a/drivers/net/wireless/ath/ath10k/htt_rx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
@@@ -672,14 -671,18 +673,18 @@@ static void ath10k_htt_rx_amsdu(struct
skb_trim(skb, skb->len - FCS_LEN);
break;
case RX_MSDU_DECAP_NATIVE_WIFI:
+ /* nothing to do */
break;
case RX_MSDU_DECAP_ETHERNET2_DIX:
+ /* strip ethernet header and insert decapped 802.11
+ * header, amsdu subframe header and rfc1042 header */
+
- decap_len = 0;
- decap_len += sizeof(struct rfc1042_hdr);
- decap_len += sizeof(struct amsdu_subframe_hdr);
+ len = 0;
+ len += sizeof(struct rfc1042_hdr);
+ len += sizeof(struct amsdu_subframe_hdr);
skb_pull(skb, sizeof(struct ethhdr));
- memcpy(skb_push(skb, decap_len), decap_hdr, decap_len);
+ memcpy(skb_push(skb, len), decap_hdr, len);
memcpy(skb_push(skb, hdr_len), hdr, hdr_len);
break;
case RX_MSDU_DECAP_8023_SNAP_LLC:
^ permalink raw reply related
* Re: [PATCH 3/3] ath10k: implement firmware IE container support
From: Kalle Valo @ 2013-09-26 6:18 UTC (permalink / raw)
To: Michal Kazior; +Cc: ath10k, linux-wireless
In-Reply-To: <CA+BoTQ=v0snRLTP44LXVdQx2UVKYxLCW-JiWyMWOR4eEzMvFKA@mail.gmail.com>
Michal Kazior <michal.kazior@tieto.com> writes:
> On 26 September 2013 07:55, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
>> Michal Kazior <michal.kazior@tieto.com> writes:
>>
>>> Did you skip board file intentionally?
>>
>> Yes, because my understanding is that the board file is not tied to any
>> particular firmware version. The board file should be specific to the
>> hardware configuration in use, or at least that's how it is with ath6kl.
>
> But the board file is not loaded at all for API 2. The api_1 variant
> requests 3 files and can result with up to 3 binaries loaded. api_n
> requests 1 file and can result with up to 2 binaries loaded.
Oops, that's clearly a bug. How did it even pass my tests without the
board file? I'll send v2 to fix that.
So my idea is that with API 2 we load only firmware-2.bin and board.bin
from user space. With API 1 we continue loading firmware.bin, otp.bin
(optional) and board.bin, just as before. And firmware-2.bin can contain
the old firmware.bin (mandatory) and otp.bin (optional) images.
I just realised that I'm missing a check that there really is a firmware
image inside firmware-2.bin, need to add that as well.
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH 3/3] ath10k: implement firmware IE container support
From: Michal Kazior @ 2013-09-26 6:04 UTC (permalink / raw)
To: Kalle Valo; +Cc: ath10k, linux-wireless
In-Reply-To: <878uykunyc.fsf@kamboji.qca.qualcomm.com>
On 26 September 2013 07:55, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
> Michal Kazior <michal.kazior@tieto.com> writes:
>
>> Did you skip board file intentionally?
>
> Yes, because my understanding is that the board file is not tied to any
> particular firmware version. The board file should be specific to the
> hardware configuration in use, or at least that's how it is with ath6kl.
But the board file is not loaded at all for API 2. The api_1 variant
requests 3 files and can result with up to 3 binaries loaded. api_n
requests 1 file and can result with up to 2 binaries loaded.
Michał.
^ permalink raw reply
* Re: [PATCH 3/3] ath10k: implement firmware IE container support
From: Kalle Valo @ 2013-09-26 5:55 UTC (permalink / raw)
To: Michal Kazior; +Cc: ath10k, linux-wireless
In-Reply-To: <CA+BoTQ=BhtjC1YNLs9OYBPN6TiYhyrwYoK2A1wifS01HVJp1YA@mail.gmail.com>
Michal Kazior <michal.kazior@tieto.com> writes:
> Did you skip board file intentionally?
Yes, because my understanding is that the board file is not tied to any
particular firmware version. The board file should be specific to the
hardware configuration in use, or at least that's how it is with ath6kl.
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH 3/3] ath10k: implement firmware IE container support
From: Michal Kazior @ 2013-09-26 5:46 UTC (permalink / raw)
To: Kalle Valo; +Cc: ath10k, linux-wireless
In-Reply-To: <20130925210848.2596.56332.stgit@localhost6.localdomain6>
On 25 September 2013 23:08, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
> +static int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name)
> +{
> + size_t magic_len, len, ie_len;
> + struct ath10k_fw_ie *hdr;
> + const u8 *data;
> + int ie_id, i, index, bit;
> + __le32 *timestamp;
> +
> + ar->firmware = ath10k_fetch_fw_file(ar, ar->hw_params.fw.dir, name);
> + if (IS_ERR(ar->firmware)) {
> + ath10k_err("Could not fetch firmware file '%s': %ld\n",
> + name, PTR_ERR(ar->firmware));
> + return PTR_ERR(ar->firmware);
> + }
> +
> + data = ar->firmware->data;
> + len = ar->firmware->size;
> +
> + /* magic also includes the null byte, check that as well */
> + magic_len = strlen(ATH10K_FIRMWARE_MAGIC) + 1;
> +
> + if (len < magic_len) {
> + ath10k_err("firmware image too small to contain magic: %d\n",
> + len);
> + return -EINVAL;
> + }
> +
> + if (memcmp(data, ATH10K_FIRMWARE_MAGIC, magic_len) != 0) {
> + ath10k_err("Invalid firmware magic\n");
> + return -EINVAL;
> + }
> +
> + /* jump over the padding */
> + magic_len = ALIGN(magic_len, 4);
> +
> + len -= magic_len;
> + data += magic_len;
> +
> + /* loop elements */
> + while (len > sizeof(struct ath10k_fw_ie)) {
> + hdr = (struct ath10k_fw_ie *)data;
> +
> + ie_id = le32_to_cpu(hdr->id);
> + ie_len = le32_to_cpu(hdr->len);
> +
> + len -= sizeof(*hdr);
> + data += sizeof(*hdr);
> +
> + if (len < ie_len) {
> + ath10k_err("Invalid length for FW IE %d (%d < %d)\n",
> + ie_id, len, ie_len);
> + return -EINVAL;
> + }
> +
> + switch (ie_id) {
> + case ATH10K_FW_IE_FW_VERSION:
> + if (ie_len > sizeof(ar->hw->wiphy->fw_version) - 1)
> + break;
> +
> + memcpy(ar->hw->wiphy->fw_version, data, ie_len);
> + ar->hw->wiphy->fw_version[ie_len] = '\0';
> +
> + ath10k_dbg(ATH10K_DBG_BOOT,
> + "found fw version %s\n",
> + ar->hw->wiphy->fw_version);
> + break;
> + case ATH10K_FW_IE_TIMESTAMP:
> + if (ie_len != sizeof(u32))
> + break;
> +
> + timestamp = (__le32 *)data;
> +
> + ath10k_dbg(ATH10K_DBG_BOOT, "found fw timestamp %d\n",
> + le32_to_cpup(timestamp));
> + break;
> + case ATH10K_FW_IE_FEATURES:
> + ath10k_dbg(ATH10K_DBG_BOOT,
> + "found firmware features ie (%zd B)\n",
> + ie_len);
> +
> + for (i = 0; i < ATH10K_FW_FEATURE_COUNT; i++) {
> + index = i / 8;
> + bit = i % 8;
> +
> + if (index == ie_len)
> + break;
> +
> + if (data[index] & (1 << bit))
> + __set_bit(i, ar->fw_features);
> + }
> +
> + ath10k_dbg_dump(ATH10K_DBG_BOOT, "features", "",
> + ar->fw_features,
> + sizeof(ar->fw_features));
> + break;
> + case ATH10K_FW_IE_FW_IMAGE:
> + ath10k_dbg(ATH10K_DBG_BOOT,
> + "found fw image ie (%zd B)\n",
> + ie_len);
> +
> + ar->firmware_data = data;
> + ar->firmware_len = ie_len;
> +
> + break;
> + case ATH10K_FW_IE_OTP_IMAGE:
> + ath10k_dbg(ATH10K_DBG_BOOT,
> + "found otp image ie (%zd B)\n",
> + ie_len);
> +
> + ar->otp_data = data;
> + ar->otp_len = ie_len;
> +
> + break;
> + default:
> + ath10k_warn("Unknown FW IE: %u\n",
> + le32_to_cpu(hdr->id));
> + break;
> + }
> +
> + /* jump over the padding */
> + ie_len = ALIGN(ie_len, 4);
> +
> + len -= ie_len;
> + data += ie_len;
> + };
> +
> + return 0;
> +}
> +
> +static int ath10k_core_fetch_firmware_files(struct ath10k *ar)
> +{
> + int ret;
> +
> + ret = ath10k_core_fetch_firmware_api_n(ar, ATH10K_FW_API2_FILE);
> + if (ret == 0) {
> + ar->fw_api = 2;
> + goto out;
> + }
Did you skip board file intentionally?
Michał.
^ permalink raw reply
* Re: [PATCH v5 1/2] Bluetooth: btmrvl: add setup handler
From: Marcel Holtmann @ 2013-09-26 1:45 UTC (permalink / raw)
To: Bing Zhao
Cc: Johan Hedberg, linux-bluetooth@vger.kernel.org development,
Gustavo F. Padovan, linux-wireless@vger.kernel.org Wireless,
Mike Frysinger, Hyuckjoo Lee, Amitkumar Karwar
In-Reply-To: <477F20668A386D41ADCC57781B1F70430F45077E5B@SC-VEXCH1.marvell.com>
Hi Bing,
>> You're right that we're missing the clearing of the HCI_SETUP flag for
>> such a scenario. Could you try the attached patch. It should fix the
>
> We have tested your patch. Yes, it fixes the problem. Thanks!
then lets get a proper version with full commit message explaining the issue merged upstream. As I said, this is a real bug we need to fix.
>> issue. One problem that it does have is that if the HCIDEVUP ioctl path
>> goes through before hci_power_on gets called we will never notify mgmt
>> of the adapter. However, that might be acceptable here since if you're
>> using HCIDEVUP like this it seems it's not a mgmt based system anyway.
>
> Do you think the following change helps?
>
> diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
> index 3d9f02b..24814b0 100644
> --- a/net/bluetooth/hci_core.c
> +++ b/net/bluetooth/hci_core.c
> @@ -1665,7 +1665,7 @@ static void hci_power_on(struct work_struct *work)
> BT_DBG("%s", hdev->name);
>
> err = hci_dev_open(hdev->id);
> - if (err < 0) {
> + if (err < 0 && err != -EALREADY) {
> mgmt_set_powered_failed(hdev, err);
> return;
> }
I am more and more convinced that we might just need to disable certain ioctl in case there is a mgmt socket/client present and HCI_MGMT is set. Trying to be graceful with legacy ioctl that BlueZ 5 will never use anymore seems to come at a too high cost. I rather fail on the legacy commands with a proper error than having mgmt interface behave inconsistent.
We might actually be able to keep HCIDEVUP and HCIDEVDOWN around, but then they need to behave like mgmt set powered command. So both commands need to go through the same mgmt engine for this.
Regards
Marcel
^ permalink raw reply
* Re: bcma 3.12-rc1 scheduling while atomic
From: Michael Stolovitzsky @ 2013-09-26 0:54 UTC (permalink / raw)
To: linux-wireless
In-Reply-To: <1380142945.23272.42.camel@dcbw.foobar.com>
On 13-09-25, Dan Williams wrote:
> [ 7.607842] BUG: scheduling while atomic: NetworkManager/523/0x00000200
[...]
I am observing the same with BCM4313. Let me know if I can help in any way.
^ permalink raw reply
* RE: [PATCH v5 1/2] Bluetooth: btmrvl: add setup handler
From: Bing Zhao @ 2013-09-25 23:23 UTC (permalink / raw)
To: Johan Hedberg
Cc: Marcel Holtmann, linux-bluetooth@vger.kernel.org, Gustavo Padovan,
linux-wireless@vger.kernel.org, Mike Frysinger, Hyuckjoo Lee,
Amitkumar Karwar
In-Reply-To: <20130924193010.GA2584@x220.p-661hnu-f1>
Hi Johan,
> You're right that we're missing the clearing of the HCI_SETUP flag for
> such a scenario. Could you try the attached patch. It should fix the
We have tested your patch. Yes, it fixes the problem. Thanks!
> issue. One problem that it does have is that if the HCIDEVUP ioctl path
> goes through before hci_power_on gets called we will never notify mgmt
> of the adapter. However, that might be acceptable here since if you're
> using HCIDEVUP like this it seems it's not a mgmt based system anyway.
Do you think the following change helps?
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 3d9f02b..24814b0 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1665,7 +1665,7 @@ static void hci_power_on(struct work_struct *work)
BT_DBG("%s", hdev->name);
err = hci_dev_open(hdev->id);
- if (err < 0) {
+ if (err < 0 && err != -EALREADY) {
mgmt_set_powered_failed(hdev, err);
return;
}
Thanks,
Bing
^ permalink raw reply related
* RE: [PATCH 09/11] mwifiex: Remove extern from function prototypes
From: Bing Zhao @ 2013-09-25 23:13 UTC (permalink / raw)
To: Joe Perches, netdev@vger.kernel.org
Cc: David S. Miller, John W. Linville, linux-wireless@vger.kernel.org,
linux-kernel@vger.kernel.org
In-Reply-To: <b3a7cd194857b3dc099e8f8bb0ed97bb4a1b5fde.1380137610.git.joe@perches.com>
Hi Joe,
Thanks for your patch.
> There are a mix of function prototypes with and without extern
> in the kernel sources. Standardize on not using extern for
> function prototypes.
>
> Function prototypes don't need to be written with extern.
> extern is assumed by the compiler. Its use is as unnecessary as
> using auto to declare automatic/local variables in a block.
>
> Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Bing Zhao <bzhao@marvell.com>
Thanks,
Bing
> ---
> drivers/net/wireless/mwifiex/wmm.h | 24 ++++++++++--------------
> 1 file changed, 10 insertions(+), 14 deletions(-)
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox