WL_ERR("wl_cfg80211_dev is unavailable\n"); \
BUG(); \
} \
- ci_to_wl(ci); \
+ ci->cfg_priv; \
})
#define CHECK_SYS_UP() \
do { \
- struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy); \
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_cfg(wiphy); \
if (unlikely(!test_bit(WL_STATUS_READY, &cfg_priv->status))) { \
WL_INFO("device is not ready : status (%d)\n", \
(int)cfg_priv->status); \
enum nl80211_iftype type, u32 *flags,
struct vif_params *params)
{
- struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_cfg(wiphy);
struct wireless_dev *wdev;
s32 infra = 0;
s32 err = 0;
static s32 brcmf_do_iscan(struct brcmf_cfg80211_priv *cfg_priv)
{
- struct brcmf_cfg80211_iscan_ctrl *iscan = wl_to_iscan(cfg_priv);
- struct net_device *ndev = wl_to_ndev(cfg_priv);
+ struct brcmf_cfg80211_iscan_ctrl *iscan = cfg_to_iscan(cfg_priv);
+ struct net_device *ndev = cfg_to_ndev(cfg_priv);
struct brcmf_ssid ssid;
s32 passive_scan;
s32 err = 0;
iscan->state = WL_ISCAN_STATE_SCANING;
passive_scan = cfg_priv->active_scan ? 0 : 1;
- err = brcmf_dev_ioctl(wl_to_ndev(cfg_priv), BRCMF_C_SET_PASSIVE_SCAN,
+ err = brcmf_dev_ioctl(cfg_to_ndev(cfg_priv), BRCMF_C_SET_PASSIVE_SCAN,
&passive_scan, sizeof(passive_scan));
if (unlikely(err)) {
WL_ERR("error (%d)\n", err);
struct cfg80211_scan_request *request,
struct cfg80211_ssid *this_ssid)
{
- struct brcmf_cfg80211_priv *cfg_priv = ndev_to_wl(ndev);
+ struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(ndev);
struct cfg80211_ssid *ssids;
- struct brcmf_cfg80211_scan_req *sr = wl_to_sr(cfg_priv);
+ struct brcmf_cfg80211_scan_req *sr = cfg_priv->scan_req_int;
s32 passive_scan;
bool iscan_req;
bool spec_scan;
static s32 brcmf_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed)
{
- struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
- struct net_device *ndev = wl_to_ndev(cfg_priv);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_cfg(wiphy);
+ struct net_device *ndev = cfg_to_ndev(cfg_priv);
s32 err = 0;
WL_TRACE("Enter\n");
brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_ibss_params *params)
{
- struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_cfg(wiphy);
struct brcmf_join_params join_params;
size_t join_params_size = 0;
s32 err = 0;
static s32 brcmf_cfg80211_leave_ibss(struct wiphy *wiphy, struct net_device *dev)
{
- struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_cfg(wiphy);
s32 err = 0;
WL_TRACE("Enter\n");
static s32
brcmf_set_wpa_version(struct net_device *dev, struct cfg80211_connect_params *sme)
{
- struct brcmf_cfg80211_priv *cfg_priv = ndev_to_wl(dev);
+ struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(dev);
struct brcmf_cfg80211_security *sec;
s32 val = 0;
s32 err = 0;
static s32
brcmf_set_auth_type(struct net_device *dev, struct cfg80211_connect_params *sme)
{
- struct brcmf_cfg80211_priv *cfg_priv = ndev_to_wl(dev);
+ struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(dev);
struct brcmf_cfg80211_security *sec;
s32 val = 0;
s32 err = 0;
static s32
brcmf_set_set_cipher(struct net_device *dev, struct cfg80211_connect_params *sme)
{
- struct brcmf_cfg80211_priv *cfg_priv = ndev_to_wl(dev);
+ struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(dev);
struct brcmf_cfg80211_security *sec;
s32 pval = 0;
s32 gval = 0;
static s32
brcmf_set_key_mgmt(struct net_device *dev, struct cfg80211_connect_params *sme)
{
- struct brcmf_cfg80211_priv *cfg_priv = ndev_to_wl(dev);
+ struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(dev);
struct brcmf_cfg80211_security *sec;
s32 val = 0;
s32 err = 0;
brcmf_set_set_sharedkey(struct net_device *dev,
struct cfg80211_connect_params *sme)
{
- struct brcmf_cfg80211_priv *cfg_priv = ndev_to_wl(dev);
+ struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(dev);
struct brcmf_cfg80211_security *sec;
struct brcmf_wsec_key key;
s32 val;
brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_connect_params *sme)
{
- struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_cfg(wiphy);
struct ieee80211_channel *chan = sme->channel;
struct brcmf_join_params join_params;
size_t join_params_size;
brcmf_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev,
u16 reason_code)
{
- struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_cfg(wiphy);
struct brcmf_scb_val scbval;
s32 err = 0;
enum nl80211_tx_power_setting type, s32 dbm)
{
- struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
- struct net_device *ndev = wl_to_ndev(cfg_priv);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_cfg(wiphy);
+ struct net_device *ndev = cfg_to_ndev(cfg_priv);
u16 txpwrmw;
s32 err = 0;
s32 disable = 0;
static s32 brcmf_cfg80211_get_tx_power(struct wiphy *wiphy, s32 *dbm)
{
- struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
- struct net_device *ndev = wl_to_ndev(cfg_priv);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_cfg(wiphy);
+ struct net_device *ndev = cfg_to_ndev(cfg_priv);
s32 txpwrdbm;
u8 result;
s32 err = 0;
{
struct key_params params;
struct brcmf_wsec_key key;
- struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_cfg(wiphy);
struct brcmf_cfg80211_security *sec;
s32 wsec;
s32 err = 0;
brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
u8 *mac, struct station_info *sinfo)
{
- struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_cfg(wiphy);
struct brcmf_scb_val scb_val;
int rssi;
s32 rate;
static s32 brcmf_cfg80211_resume(struct wiphy *wiphy)
{
- struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_cfg(wiphy);
/*
* Check for WL_STATUS_READY before any function call which
#endif /* defined(CONFIG_PM_SLEEP) */
if (test_bit(WL_STATUS_READY, &cfg_priv->status))
- brcmf_invoke_iscan(wiphy_to_wl(wiphy));
+ brcmf_invoke_iscan(wiphy_to_cfg(wiphy));
WL_TRACE("Exit\n");
return 0;
static s32 brcmf_cfg80211_suspend(struct wiphy *wiphy,
struct cfg80211_wowlan *wow)
{
- struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
- struct net_device *ndev = wl_to_ndev(cfg_priv);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_cfg(wiphy);
+ struct net_device *ndev = cfg_to_ndev(cfg_priv);
WL_TRACE("Enter\n");
brcmf_cfg80211_set_pmksa(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_pmksa *pmksa)
{
- struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_cfg(wiphy);
struct _pmkid_list *pmkids = &cfg_priv->pmk_list->pmkids;
s32 err = 0;
int i;
brcmf_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_pmksa *pmksa)
{
- struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_cfg(wiphy);
struct _pmkid_list pmkid;
s32 err = 0;
int i;
static s32
brcmf_cfg80211_flush_pmksa(struct wiphy *wiphy, struct net_device *dev)
{
- struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_cfg(wiphy);
s32 err = 0;
WL_TRACE("Enter\n");
static void brcmf_free_wdev(struct brcmf_cfg80211_priv *cfg_priv)
{
- struct wireless_dev *wdev = wl_to_wdev(cfg_priv);
+ struct wireless_dev *wdev = cfg_to_wdev(cfg_priv);
if (unlikely(!wdev)) {
WL_ERR("wdev is invalid\n");
wiphy_unregister(wdev->wiphy);
wiphy_free(wdev->wiphy);
kfree(wdev);
- wl_to_wdev(cfg_priv) = NULL;
+ cfg_to_wdev(cfg_priv) = NULL;
}
static s32 brcmf_inform_bss(struct brcmf_cfg80211_priv *cfg_priv)
static s32 brcmf_inform_single_bss(struct brcmf_cfg80211_priv *cfg_priv,
struct brcmf_bss_info *bi)
{
- struct wiphy *wiphy = wl_to_wiphy(cfg_priv);
+ struct wiphy *wiphy = cfg_to_wiphy(cfg_priv);
struct ieee80211_channel *notify_channel;
struct cfg80211_bss *bss;
struct ieee80211_supported_band *band;
static s32 wl_inform_ibss(struct brcmf_cfg80211_priv *cfg_priv,
struct net_device *dev, const u8 *bssid)
{
- struct wiphy *wiphy = wl_to_wiphy(cfg_priv);
+ struct wiphy *wiphy = cfg_to_wiphy(cfg_priv);
struct ieee80211_channel *notify_channel;
struct brcmf_bss_info *bi = NULL;
struct ieee80211_supported_band *band;
static __used s32
brcmf_dev_bufvar_set(struct net_device *dev, s8 *name, s8 *buf, s32 len)
{
- struct brcmf_cfg80211_priv *cfg_priv = ndev_to_wl(dev);
+ struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(dev);
u32 buflen;
buflen = brcmu_mkiovar(name, buf, len, cfg_priv->ioctl_buf,
brcmf_dev_bufvar_get(struct net_device *dev, s8 *name, s8 *buf,
s32 buf_len)
{
- struct brcmf_cfg80211_priv *cfg_priv = ndev_to_wl(dev);
+ struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(dev);
u32 len;
s32 err = 0;
static s32 brcmf_get_assoc_ies(struct brcmf_cfg80211_priv *cfg_priv)
{
- struct net_device *ndev = wl_to_ndev(cfg_priv);
+ struct net_device *ndev = cfg_to_ndev(cfg_priv);
struct brcmf_cfg80211_assoc_ielen *assoc_info;
- struct brcmf_cfg80211_connect_info *conn_info = wl_to_conn(cfg_priv);
+ struct brcmf_cfg80211_connect_info *conn_info = cfg_to_conn(cfg_priv);
u32 req_len;
u32 resp_len;
s32 err = 0;
static void brcmf_clear_assoc_ies(struct brcmf_cfg80211_priv *cfg_priv)
{
- struct brcmf_cfg80211_connect_info *conn_info = wl_to_conn(cfg_priv);
+ struct brcmf_cfg80211_connect_info *conn_info = cfg_to_conn(cfg_priv);
kfree(conn_info->req_ie);
conn_info->req_ie = NULL;
ssid = (struct brcmf_ssid *)brcmf_read_prof(cfg_priv, WL_PROF_SSID);
*(u32 *)cfg_priv->extra_buf = cpu_to_le32(WL_EXTRA_BUF_MAX);
- err = brcmf_dev_ioctl(wl_to_ndev(cfg_priv), BRCMF_C_GET_BSS_INFO,
+ err = brcmf_dev_ioctl(cfg_to_ndev(cfg_priv), BRCMF_C_GET_BSS_INFO,
cfg_priv->extra_buf, WL_EXTRA_BUF_MAX);
if (unlikely(err)) {
WL_ERR("Could not get bss info %d\n", err);
* so we speficially query dtim information to dongle.
*/
u32 var;
- err = brcmf_dev_intvar_get(wl_to_ndev(cfg_priv),
+ err = brcmf_dev_intvar_get(cfg_to_ndev(cfg_priv),
"dtim_assoc", &var);
if (unlikely(err)) {
WL_ERR("wl dtim_assoc failed (%d)\n", err);
struct net_device *ndev,
const struct brcmf_event_msg *e, void *data)
{
- struct brcmf_cfg80211_connect_info *conn_info = wl_to_conn(cfg_priv);
+ struct brcmf_cfg80211_connect_info *conn_info = cfg_to_conn(cfg_priv);
s32 err = 0;
WL_TRACE("Enter\n");
struct net_device *ndev, const struct brcmf_event_msg *e,
void *data, bool completed)
{
- struct brcmf_cfg80211_connect_info *conn_info = wl_to_conn(cfg_priv);
+ struct brcmf_cfg80211_connect_info *conn_info = cfg_to_conn(cfg_priv);
s32 err = 0;
WL_TRACE("Enter\n");
if (cfg_priv->iscan_on && cfg_priv->iscan_kickstart) {
WL_TRACE("Exit\n");
- return brcmf_wakeup_iscan(wl_to_iscan(cfg_priv));
+ return brcmf_wakeup_iscan(cfg_to_iscan(cfg_priv));
}
if (unlikely(!test_and_clear_bit(WL_STATUS_SCANNING,
static void brcmf_term_iscan(struct brcmf_cfg80211_priv *cfg_priv)
{
- struct brcmf_cfg80211_iscan_ctrl *iscan = wl_to_iscan(cfg_priv);
+ struct brcmf_cfg80211_iscan_ctrl *iscan = cfg_to_iscan(cfg_priv);
if (cfg_priv->iscan_on && iscan->tsk) {
iscan->state = WL_ISCAN_STATE_IDLE;
static void brcmf_notify_iscan_complete(struct brcmf_cfg80211_iscan_ctrl *iscan,
bool aborted)
{
- struct brcmf_cfg80211_priv *cfg_priv = iscan_to_wl(iscan);
- struct net_device *ndev = wl_to_ndev(cfg_priv);
+ struct brcmf_cfg80211_priv *cfg_priv = iscan_to_cfg(iscan);
+ struct net_device *ndev = cfg_to_ndev(cfg_priv);
if (unlikely(!test_and_clear_bit(WL_STATUS_SCANNING,
&cfg_priv->status))) {
struct sched_param param = {.sched_priority = MAX_RT_PRIO - 1 };
struct brcmf_cfg80211_iscan_ctrl *iscan =
(struct brcmf_cfg80211_iscan_ctrl *)data;
- struct brcmf_cfg80211_priv *cfg_priv = iscan_to_wl(iscan);
+ struct brcmf_cfg80211_priv *cfg_priv = iscan_to_cfg(iscan);
struct brcmf_cfg80211_iscan_eloop *el = &iscan->el;
u32 status;
int err = 0;
static s32 brcmf_invoke_iscan(struct brcmf_cfg80211_priv *cfg_priv)
{
- struct brcmf_cfg80211_iscan_ctrl *iscan = wl_to_iscan(cfg_priv);
+ struct brcmf_cfg80211_iscan_ctrl *iscan = cfg_to_iscan(cfg_priv);
int err = 0;
if (cfg_priv->iscan_on && !iscan->tsk) {
static s32 brcmf_init_iscan(struct brcmf_cfg80211_priv *cfg_priv)
{
- struct brcmf_cfg80211_iscan_ctrl *iscan = wl_to_iscan(cfg_priv);
+ struct brcmf_cfg80211_iscan_ctrl *iscan = cfg_to_iscan(cfg_priv);
int err = 0;
if (cfg_priv->iscan_on) {
- iscan->dev = wl_to_ndev(cfg_priv);
+ iscan->dev = cfg_to_ndev(cfg_priv);
iscan->state = WL_ISCAN_STATE_IDLE;
brcmf_init_iscan_eloop(&iscan->el);
iscan->timer_ms = WL_ISCAN_TIMER_INTERVAL_MS;
static s32 wl_init_priv(struct brcmf_cfg80211_priv *cfg_priv)
{
- struct wiphy *wiphy = wl_to_wiphy(cfg_priv);
+ struct wiphy *wiphy = cfg_to_wiphy(cfg_priv);
s32 err = 0;
cfg_priv->scan_request = NULL;
return -ENOMEM;
wdev->iftype = brcmf_mode_to_nl80211_iftype(WL_MODE_BSS);
- cfg_priv = wdev_to_wl(wdev);
+ cfg_priv = wdev_to_cfg(wdev);
cfg_priv->wdev = wdev;
cfg_priv->pub = data;
- ci = (struct brcmf_cfg80211_iface *)wl_to_ci(cfg_priv);
+ ci = (struct brcmf_cfg80211_iface *)&cfg_priv->ci;
ci->cfg_priv = cfg_priv;
ndev->ieee80211_ptr = wdev;
SET_NETDEV_DEV(ndev, wiphy_dev(wdev->wiphy));
WL_INFO("event type (%d)\n", e->etype);
if (cfg_priv->el.handler[e->etype]) {
cfg_priv->el.handler[e->etype](cfg_priv,
- wl_to_ndev(cfg_priv),
+ cfg_to_ndev(cfg_priv),
&e->emsg, e->edata);
} else {
WL_INFO("Unknown Event (%d): ignoring\n", e->etype);
const struct brcmf_event_msg *e, void *data)
{
u32 event_type = be32_to_cpu(e->event_type);
- struct brcmf_cfg80211_priv *cfg_priv = ndev_to_wl(ndev);
+ struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(ndev);
if (likely(!brcmf_enq_event(cfg_priv, event_type, e, data)))
brcmf_wakeup_event(cfg_priv);
if (cfg_priv->dongle_up)
return err;
- ndev = wl_to_ndev(cfg_priv);
+ ndev = cfg_to_ndev(cfg_priv);
wdev = ndev->ieee80211_ptr;
if (need_lock)
rtnl_lock();
s8 phy;
s32 err = 0;
- err = brcmf_dev_ioctl(wl_to_ndev(cfg_priv), WLC_GET_PHYLIST, &phy_list,
+ err = brcmf_dev_ioctl(cfg_to_ndev(cfg_priv), WLC_GET_PHYLIST, &phy_list,
sizeof(phy_list));
if (unlikely(err)) {
WL_ERR("error (%d)\n", err);
phy = ((char *)&phy_list)[1];
WL_INFO("%c phy\n", phy);
if (phy == 'n' || phy == 'a') {
- wiphy = wl_to_wiphy(cfg_priv);
+ wiphy = cfg_to_wiphy(cfg_priv);
wiphy->bands[IEEE80211_BAND_5GHZ] = &__wl_band_5ghz_n;
}
if (cfg_priv->scan_request) {
cfg80211_scan_done(cfg_priv->scan_request, true);
/* May need to perform this to cover rmmod */
- /* wl_set_mpc(wl_to_ndev(wl), 1); */
+ /* wl_set_mpc(cfg_to_ndev(wl), 1); */
cfg_priv->scan_request = NULL;
}
clear_bit(WL_STATUS_READY, &cfg_priv->status);
static __used s32 brcmf_add_ie(struct brcmf_cfg80211_priv *cfg_priv,
u8 t, u8 l, u8 *v)
{
- struct brcmf_cfg80211_ie *ie = wl_to_ie(cfg_priv);
+ struct brcmf_cfg80211_ie *ie = &cfg_priv->ie;
s32 err = 0;
if (unlikely(ie->offset + l + 2 > WL_TLV_INFO_MAX)) {
WL_TRACE("Enter\n");
if (cfg_priv->link_up) {
- dev = wl_to_ndev(cfg_priv);
+ dev = cfg_to_ndev(cfg_priv);
WL_INFO("Call WLC_DISASSOC to stop excess roaming\n ");
err = brcmf_dev_ioctl(dev, BRCMF_C_DISASSOC, NULL, 0);
if (unlikely(err))
static void brcmf_set_mpc(struct net_device *ndev, int mpc)
{
s32 err = 0;
- struct brcmf_cfg80211_priv *cfg_priv = ndev_to_wl(ndev);
+ struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(ndev);
if (test_bit(WL_STATUS_READY, &cfg_priv->status)) {
err = brcmf_dev_intvar_set(ndev, "mpc", mpc);
struct dentry *fd;
s32 err = 0;
- sprintf(buf, "netdev:%s", wl_to_ndev(cfg_priv)->name);
+ sprintf(buf, "netdev:%s", cfg_to_ndev(cfg_priv)->name);
cfg_priv->debugfsdir = debugfs_create_dir(buf,
- wl_to_wiphy(cfg_priv)->debugfsdir);
+ cfg_to_wiphy(cfg_priv)->debugfsdir);
fd = debugfs_create_u16("beacon_int", S_IRUGO, cfg_priv->debugfsdir,
(u16 *)&cfg_priv->profile->beacon_interval);