/* Write mgmt frame to this file to send it */ static ssize_t wil_write_file_txmgmt(struct file *file, const char __user *buf, size_t len, loff_t *ppos) { struct wil6210_priv *wil = file->private_data; struct wiphy *wiphy = wil_to_wiphy(wil); struct wireless_dev *wdev = wil_to_wdev(wil); struct cfg80211_mgmt_tx_params params; int rc; void *frame = kmalloc(len, GFP_KERNEL); if (!frame) return -ENOMEM; if (copy_from_user(frame, buf, len)) { kfree(frame); return -EIO; } params.buf = frame; params.len = len; params.chan = wdev->preset_chandef.chan; rc = wil_cfg80211_mgmt_tx(wiphy, wdev, ¶ms, NULL); kfree(frame); wil_info(wil, "%s() -> %d\n", __func__, rc); return len; }
/* Write mgmt frame to this file to send it */ static ssize_t wil_write_file_txmgmt(struct file *file, const char __user *buf, size_t len, loff_t *ppos) { struct wil6210_priv *wil = file->private_data; struct wiphy *wiphy = wil_to_wiphy(wil); struct wireless_dev *wdev = wil->main_ndev->ieee80211_ptr; struct cfg80211_mgmt_tx_params params; int rc; void *frame; if (!len) return -EINVAL; frame = memdup_user(buf, len); if (IS_ERR(frame)) return PTR_ERR(frame); params.buf = frame; params.len = len; rc = wil_cfg80211_mgmt_tx(wiphy, wdev, ¶ms, NULL); kfree(frame); wil_info(wil, "-> %d\n", rc); return len; }
/* * Write mgmt frame to this file to send it */ static ssize_t wil_write_file_txmgmt(struct file *file, const char __user *buf, size_t len, loff_t *ppos) { struct wil6210_priv *wil = file->private_data; #if 0 struct net_device *ndev = wil_to_ndev(wil); #endif struct wiphy *wiphy = wil_to_wiphy(wil); struct wireless_dev *wdev = wil_to_wdev(wil); int rc; void *frame = kmalloc(len, GFP_KERNEL); if (!frame) return -ENOMEM; if (copy_from_user(frame, buf, len)) return -EIO; #if 0 rc = wmi_set_channel(wil, 1); if (rc) return rc; rc = wmi_call(wil, WMI_RX_ON_CMDID, NULL, 0, WMI_RX_ON_DONE_EVENTID, NULL, 0, 20); if (rc) return rc; #endif rc = wil_cfg80211_mgmt_tx(wiphy, wdev, wdev->preset_chandef.chan, true, 0, frame, len, true, false, NULL); kfree(frame); wil_info(wil, "%s() -> %d\n", __func__, rc); #if 0 msleep(300); rtnl_lock(); dev_close(ndev); ndev->flags &= ~IFF_UP; rtnl_unlock(); wil_reset(wil); #endif return len; }