static int iwm_wext_siwessid(struct net_device *dev, struct iw_request_info *info, struct iw_point *data, char *ssid) { struct iwm_priv *iwm = ndev_to_iwm(dev); size_t len = data->length; int ret; if (iwm->conf.mode == UMAC_MODE_IBSS) return cfg80211_ibss_wext_siwessid(dev, info, data, ssid); if (!test_bit(IWM_STATUS_READY, &iwm->status)) return -EIO; if (len > 0 && ssid[len - 1] == '\0') len--; if (iwm->umac_profile_active) { if (iwm->umac_profile->ssid.ssid_len == len && !memcmp(iwm->umac_profile->ssid.ssid, ssid, len)) return 0; ret = iwm_invalidate_mlme_profile(iwm); if (ret < 0) { IWM_ERR(iwm, "Couldn't invalidate profile\n"); return ret; } } iwm->umac_profile->ssid.ssid_len = len; memcpy(iwm->umac_profile->ssid.ssid, ssid, len); return iwm_send_mlme_profile(iwm); }
static int cfg80211_wext_siwessid(struct net_device *dev, struct iw_request_info *info, struct iw_point *data, char *ssid) { struct wireless_dev *wdev = dev->ieee80211_ptr; switch (wdev->iftype) { case NL80211_IFTYPE_ADHOC: return cfg80211_ibss_wext_siwessid(dev, info, data, ssid); case NL80211_IFTYPE_STATION: return cfg80211_mgd_wext_siwessid(dev, info, data, ssid); default: return -EOPNOTSUPP; } }