Search Linux Wireless

A question about setting Master mode and ieee80211_ioctl_siwmode() handler

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,
I have a short question:
  I wonder how can a command like :
"iwconfig wlan0 mode Master"
should succeed ;
I did tried it on some wireless NIC, which probably does not support
master mode, and got:
"Error for wireless request "Set Mode" (8B06) :
    SET failed on device wlan0 ; Invalid argument."


The reason is this:
I look at the kernel code which implements receiving the set mode IOCTL.

The method is ieee80211_ioctl_siwmode(), in net/mac80211/wext.c.

(I am looking at the last git wireless tree; it appears here below).

As far as I can see, we don't handle the "Master" mode in the case
sentence , so when we try to set the mode to Master,
by :
"iwconfig wlan0 mode Master"
we will always get to the default and exit with
		"return -EINVAL"

Am I wrong here ? can somebody please explain?

static int ieee80211_ioctl_siwmode(struct net_device *dev,
				   struct iw_request_info *info,
				   __u32 *mode, char *extra)
{
	struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
	int type;

	if (sdata->vif.type == IEEE80211_IF_TYPE_VLAN)
		return -EOPNOTSUPP;

	switch (*mode) {
	case IW_MODE_INFRA:
		type = IEEE80211_IF_TYPE_STA;
		break;
	case IW_MODE_ADHOC:
		type = IEEE80211_IF_TYPE_IBSS;
		break;
	case IW_MODE_REPEAT:
		type = IEEE80211_IF_TYPE_WDS;
		break;
	case IW_MODE_MONITOR:
		type = IEEE80211_IF_TYPE_MNTR;
		break;
	default:
		return -EINVAL;
	}

	return ieee80211_if_change_type(sdata, type);
}


Any ideas?
Regards,
DS
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux