diff --git a/cfg80211.c b/cfg80211.c index 483ed25..bab4d37 100644 --- a/cfg80211.c +++ b/cfg80211.c @@ -259,6 +259,7 @@ struct wilc_vif *wilc_get_wl_to_vif(struct wilc *wl) } static int set_channel(struct wiphy *wiphy, + struct net_device *netdev, struct cfg80211_chan_def *chandef) { struct wilc *wl = wiphy_priv(wiphy); @@ -912,7 +913,7 @@ static int change_bss(struct wiphy *wiphy, struct net_device *dev, return 0; } -static int set_wiphy_params(struct wiphy *wiphy, u32 changed) +static int set_wiphy_params(struct wiphy *wiphy, int radio_idx, u32 changed) { int ret = -EINVAL; struct cfg_param_attr cfg_param_val; @@ -2008,6 +2009,7 @@ static void wilc_set_wakeup(struct wiphy *wiphy, bool enabled) } static int set_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev, + int radio_idx, enum nl80211_tx_power_setting type, int mbm) { int ret; @@ -2040,6 +2042,7 @@ static int set_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev, } static int get_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev, + int radio_idx, unsigned int link_id, int *dbm) { int ret; @@ -2059,7 +2062,7 @@ static int get_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev, return ret; } -static int set_antenna(struct wiphy *wiphy, u32 tx_ant, u32 rx_ant) +static int set_antenna(struct wiphy *wiphy, int radio_idx, u32 tx_ant, u32 rx_ant) { int ret; struct wilc *wl = wiphy_priv(wiphy); @@ -2315,7 +2318,7 @@ void wilc_deinit_host_int(struct net_device *net) mutex_destroy(&priv->scan_req_lock); ret = wilc_deinit(vif); - del_timer_sync(&priv->eap_buff_timer); + timer_delete_sync(&priv->eap_buff_timer); if (ret) netdev_err(net, "Error while deinitializing host interface\n"); diff --git a/hif.c b/hif.c index 412ee91..aaba667 100644 --- a/hif.c +++ b/hif.c @@ -778,7 +778,7 @@ static inline void host_int_parse_assoc_resp_info(struct wilc_vif *vif, } } - del_timer(&hif_drv->connect_timer); + timer_delete(&hif_drv->connect_timer); conn_info->conn_result(CONN_DISCONN_EVENT_CONN_RESP, mac_status, hif_drv->conn_info.arg); @@ -813,7 +813,7 @@ void wilc_handle_disconnect(struct wilc_vif *vif) if (hif_drv->usr_scan_req.scan_result) { PRINT_INFO(vif->ndev, HOSTINF_DBG, "\n\n<< Abort the running OBSS Scan >>\n\n"); - del_timer(&hif_drv->scan_timer); + timer_delete(&hif_drv->scan_timer); handle_scan_done(vif, SCAN_EVENT_ABORTED); } @@ -867,7 +867,7 @@ static void handle_rcvd_gnrl_async_info(struct work_struct *work) } else if (hif_drv->usr_scan_req.scan_result) { PRINT_WRN(vif->ndev, HOSTINF_DBG, "Received WILC_MAC_STATUS_DISCONNECTED. Abort the running Scan"); - del_timer(&hif_drv->scan_timer); + timer_delete(&hif_drv->scan_timer); handle_scan_done(vif, SCAN_EVENT_ABORTED); } } @@ -900,7 +900,7 @@ int wilc_disconnect(struct wilc_vif *vif) PRINT_INFO(vif_tmp->ndev, GENERIC_DBG, "Abort scan from disconnect. state [%d]\n", hif_drv_tmp->hif_state); - del_timer(&hif_drv_tmp->scan_timer); + timer_delete(&hif_drv_tmp->scan_timer); handle_scan_done(vif_tmp, SCAN_EVENT_ABORTED); } } @@ -923,7 +923,7 @@ int wilc_disconnect(struct wilc_vif *vif) conn_info = &hif_drv->conn_info; if (scan_req->scan_result) { - del_timer(&hif_drv->scan_timer); + timer_delete(&hif_drv->scan_timer); scan_req->scan_result(SCAN_EVENT_ABORTED, NULL, scan_req->arg); scan_req->scan_result = NULL; } @@ -931,7 +931,7 @@ int wilc_disconnect(struct wilc_vif *vif) if (conn_info->conn_result) { if (hif_drv->hif_state == HOST_IF_WAITING_CONN_RESP || hif_drv->hif_state == HOST_IF_EXTERNAL_AUTH) { - del_timer(&hif_drv->connect_timer); + timer_delete(&hif_drv->connect_timer); conn_info->conn_result(CONN_DISCONN_EVENT_CONN_RESP, WILC_MAC_STATUS_DISCONNECTED, conn_info->arg); @@ -1190,13 +1190,13 @@ static void wilc_handle_listen_state_expired(struct work_struct *work) static void listen_timer_cb(struct timer_list *t) { - struct host_if_drv *hif_drv = from_timer(hif_drv, t, + struct host_if_drv *hif_drv = timer_container_of(hif_drv, t, remain_on_ch_timer); struct wilc_vif *vif = hif_drv->remain_on_ch_timer_vif; int result; struct host_if_msg *msg; - del_timer(&vif->hif_drv->remain_on_ch_timer); + timer_delete(&vif->hif_drv->remain_on_ch_timer); msg = wilc_alloc_work(vif, wilc_handle_listen_state_expired, false); if (IS_ERR(msg)) @@ -1309,7 +1309,7 @@ static void handle_scan_complete(struct work_struct *work) { struct host_if_msg *msg = container_of(work, struct host_if_msg, work); - del_timer(&msg->vif->hif_drv->scan_timer); + timer_delete(&msg->vif->hif_drv->scan_timer); PRINT_INFO(msg->vif->ndev, HOSTINF_DBG, "scan completed\n"); handle_scan_done(msg->vif, SCAN_EVENT_DONE); @@ -1319,7 +1319,7 @@ static void handle_scan_complete(struct work_struct *work) static void timer_scan_cb(struct timer_list *t) { - struct host_if_drv *hif_drv = from_timer(hif_drv, t, scan_timer); + struct host_if_drv *hif_drv = timer_container_of(hif_drv, t, scan_timer); struct wilc_vif *vif = hif_drv->scan_timer_vif; struct host_if_msg *msg; int result; @@ -1335,7 +1335,7 @@ static void timer_scan_cb(struct timer_list *t) static void timer_connect_cb(struct timer_list *t) { - struct host_if_drv *hif_drv = from_timer(hif_drv, t, + struct host_if_drv *hif_drv = timer_container_of(hif_drv, t, connect_timer); struct wilc_vif *vif = hif_drv->connect_timer_vif; struct host_if_msg *msg; @@ -1790,7 +1790,7 @@ int wilc_hif_set_cfg(struct wilc_vif *vif, struct cfg_param_attr *param) static void get_periodic_rssi(struct timer_list *t) { - struct wilc_vif *vif = from_timer(vif, t, periodic_rssi); + struct wilc_vif *vif = timer_container_of(vif, t, periodic_rssi); if (!vif->hif_drv) { netdev_err(vif->ndev, "%s: hif driver is NULL", __func__); @@ -1842,10 +1842,10 @@ int wilc_deinit(struct wilc_vif *vif) mutex_lock(&vif->wilc->deinit_lock); - del_timer_sync(&hif_drv->scan_timer); - del_timer_sync(&hif_drv->connect_timer); - del_timer_sync(&vif->periodic_rssi); - del_timer_sync(&hif_drv->remain_on_ch_timer); + timer_delete_sync(&hif_drv->scan_timer); + timer_delete_sync(&hif_drv->connect_timer); + timer_delete_sync(&vif->periodic_rssi); + timer_delete_sync(&hif_drv->remain_on_ch_timer); if (hif_drv->usr_scan_req.scan_result) { hif_drv->usr_scan_req.scan_result(SCAN_EVENT_ABORTED, NULL, @@ -2025,7 +2025,7 @@ int wilc_listen_state_expired(struct wilc_vif *vif, u64 cookie) return -EFAULT; } - del_timer(&vif->hif_drv->remain_on_ch_timer); + timer_delete(&vif->hif_drv->remain_on_ch_timer); return wilc_handle_roc_expired(vif, cookie); } diff --git a/netdev.c b/netdev.c index 5cc98ad..c882043 100644 --- a/netdev.c +++ b/netdev.c @@ -118,7 +118,7 @@ static int debug_thread(void *arg) if (hif_drv->usr_scan_req.scan_result) { PRINT_INFO(vif->ndev, GENERIC_DBG, "Abort the running OBSS Scan\n"); - del_timer(&hif_drv->scan_timer); + timer_delete(&hif_drv->scan_timer); handle_scan_done(vif, SCAN_EVENT_ABORTED); } @@ -260,7 +260,7 @@ void eap_buff_timeout(struct timer_list *t) u8 *assoc_bss; static u8 timeout = 5; int status = -1; - struct wilc_priv *priv = from_timer(priv, t, eap_buff_timer); + struct wilc_priv *priv = timer_container_of(priv, t, eap_buff_timer); struct wilc_vif *vif = netdev_priv(priv->dev); assoc_bss = priv->associated_bss; @@ -269,7 +269,7 @@ void eap_buff_timeout(struct timer_list *t) (jiffies + msecs_to_jiffies(10))); return; } - del_timer(&priv->eap_buff_timer); + timer_delete(&priv->eap_buff_timer); timeout = 5; status = wilc_send_buffered_eap(vif, wilc_frmw_to_host, diff --git a/power.c b/power.c index 6ab8d63..5bf4f9f 100644 --- a/power.c +++ b/power.c @@ -37,11 +37,13 @@ int wilc_of_parse_power_pins(struct wilc *wilc) !gpio_is_valid(power->gpios.reset)) return -EINVAL; - ret = devm_gpio_request(wilc->dev, power->gpios.chip_en, "CHIP_EN"); + ret = devm_gpio_request_one(wilc->dev, power->gpios.chip_en, + GPIOF_OUT_INIT_LOW, "CHIP_EN"); if (ret) return ret; - ret = devm_gpio_request(wilc->dev, power->gpios.reset, "RESET"); + ret = devm_gpio_request_one(wilc->dev, power->gpios.reset, + GPIOF_OUT_INIT_HIGH, "RESET"); return ret; }