int cfg80211_wext_giwessid(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_giwessid(dev, info, data, ssid);
	case NL80211_IFTYPE_STATION:
		return cfg80211_mgd_wext_giwessid(dev, info, data, ssid);
	default:
		return -EOPNOTSUPP;
	}
}
Beispiel #2
0
static int iwm_wext_giwessid(struct net_device *dev,
                             struct iw_request_info *info,
                             struct iw_point *data, char *ssid)
{
    struct iwm_priv *iwm = ndev_to_iwm(dev);

    if (iwm->conf.mode == UMAC_MODE_IBSS)
        return cfg80211_ibss_wext_giwessid(dev, info, data, ssid);

    if (!test_bit(IWM_STATUS_READY, &iwm->status))
        return -EIO;

    data->length = iwm->umac_profile->ssid.ssid_len;
    if (data->length) {
        memcpy(ssid, iwm->umac_profile->ssid.ssid, data->length);
        data->flags = 1;
    } else
        data->flags = 0;

    return 0;
}