• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ p80211req_dorequest函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中p80211req_dorequest函数的典型用法代码示例。如果您正苦于以下问题:C++ p80211req_dorequest函数的具体用法?C++ p80211req_dorequest怎么用?C++ p80211req_dorequest使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了p80211req_dorequest函数的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: prism2_get_tx_power

static int prism2_get_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev,
			       int *dbm)
{
	struct prism2_wiphy_private *priv = wiphy_priv(wiphy);
	struct wlandevice *wlandev = priv->wlandev;
	struct p80211msg_dot11req_mibget msg;
	struct p80211item_uint32 *mibitem;
	int result;
	int err = 0;

	mibitem = (struct p80211item_uint32 *)&msg.mibattribute.data;
	msg.msgcode = DIDMSG_DOT11REQ_MIBGET;
	mibitem->did = DIDMIB_DOT11PHY_TXPOWERTABLE_CURRENTTXPOWERLEVEL;

	result = p80211req_dorequest(wlandev, (u8 *)&msg);

	if (result) {
		err = -EFAULT;
		goto exit;
	}

	*dbm = mibitem->data;

exit:
	return err;
}
开发者ID:grate-driver,项目名称:linux,代码行数:26,代码来源:cfg80211.c


示例2: p80211wext_giwfrag

static int p80211wext_giwfrag(netdevice_t *dev,
			      struct iw_request_info *info,
			      struct iw_param *frag, char *extra)
{
	wlandevice_t *wlandev = (wlandevice_t*)dev->priv;
	p80211item_uint32_t             mibitem;
	p80211msg_dot11req_mibset_t     msg;
	int result;
	int err = 0;

	DBFENTER;

	msg.msgcode = DIDmsg_dot11req_mibget;
	mibitem.did = DIDmib_dot11mac_dot11OperationTable_dot11FragmentationThreshold;
	memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem));
	result = p80211req_dorequest(wlandev, (UINT8*)&msg);

	if (result) {
		err = -EFAULT;
		goto exit;
	}

	memcpy(&mibitem, &msg.mibattribute.data, sizeof(mibitem));

	frag->value = mibitem.data;
	frag->disabled = (frag->value == 2346);
	frag->fixed = 1;

 exit:
	DBFEXIT;
	return err;
}
开发者ID:BackupTheBerlios,项目名称:wl530g-svn,代码行数:32,代码来源:p80211wext.c


示例3: p80211knetdev_set_mac_address

/*----------------------------------------------------------------
* p80211knetdev_set_mac_address
*
* Handles the ioctl for changing the MACAddress of a netdevice
*
* references: linux/netdevice.h and drivers/net/net_init.c
*
* NOTE: [MSM] We only prevent address changes when the netdev is
* up.  We don't control anything based on dot11 state.  If the
* address is changed on a STA that's currently associated, you
* will probably lose the ability to send and receive data frames.
* Just be aware.  Therefore, this should usually only be done
* prior to scan/join/auth/assoc.
*
* Arguments:
*	dev	netdevice struct
*	addr	the new MACAddress (a struct)
*
* Returns:
*	zero on success, a negative errno on failure.  Possible values:
*		-EBUSY	device is bussy (cmd not possible)
*		-and errors returned by: p80211req_dorequest(..)
*
* by: Collin R. Mulliner <[email protected]>
----------------------------------------------------------------*/
static int p80211knetdev_set_mac_address(netdevice_t *dev, void *addr)
{
	struct sockaddr *new_addr = addr;
	struct p80211msg_dot11req_mibset dot11req;
	p80211item_unk392_t *mibattr;
	p80211item_pstr6_t *macaddr;
	p80211item_uint32_t *resultcode;
	int result = 0;

	/* If we're running, we don't allow MAC address changes */
	if (netif_running(dev))
		return -EBUSY;

	/* Set up some convenience pointers. */
	mibattr = &dot11req.mibattribute;
	macaddr = (p80211item_pstr6_t *) &mibattr->data;
	resultcode = &dot11req.resultcode;

	/* Set up a dot11req_mibset */
	memset(&dot11req, 0, sizeof(struct p80211msg_dot11req_mibset));
	dot11req.msgcode = DIDmsg_dot11req_mibset;
	dot11req.msglen = sizeof(struct p80211msg_dot11req_mibset);
	memcpy(dot11req.devname,
	       ((wlandevice_t *) dev->ml_priv)->name, WLAN_DEVNAMELEN_MAX - 1);

	/* Set up the mibattribute argument */
	mibattr->did = DIDmsg_dot11req_mibset_mibattribute;
	mibattr->status = P80211ENUM_msgitem_status_data_ok;
	mibattr->len = sizeof(mibattr->data);

	macaddr->did = DIDmib_dot11mac_dot11OperationTable_dot11MACAddress;
	macaddr->status = P80211ENUM_msgitem_status_data_ok;
	macaddr->len = sizeof(macaddr->data);
	macaddr->data.len = ETH_ALEN;
	memcpy(&macaddr->data.data, new_addr->sa_data, ETH_ALEN);

	/* Set up the resultcode argument */
	resultcode->did = DIDmsg_dot11req_mibset_resultcode;
	resultcode->status = P80211ENUM_msgitem_status_no_value;
	resultcode->len = sizeof(resultcode->data);
	resultcode->data = 0;

	/* now fire the request */
	result = p80211req_dorequest(dev->ml_priv, (u8 *) &dot11req);

	/* If the request wasn't successful, report an error and don't
	 * change the netdev address
	 */
	if (result != 0 || resultcode->data != P80211ENUM_resultcode_success) {
		printk(KERN_ERR
		       "Low-level driver failed dot11req_mibset(dot11MACAddress).\n");
		result = -EADDRNOTAVAIL;
	} else {
		/* everything's ok, change the addr in netdev */
		memcpy(dev->dev_addr, new_addr->sa_data, dev->addr_len);
	}

	return result;
}
开发者ID:119-org,项目名称:hi3518-osdrv,代码行数:84,代码来源:p80211netdev.c


示例4: p80211knetdev_do_ioctl

/*----------------------------------------------------------------
 * p80211knetdev_do_ioctl
 *
 * Handle an ioctl call on one of our devices.  Everything Linux
 * ioctl specific is done here.  Then we pass the contents of the
 * ifr->data to the request message handler.
 *
 * Arguments:
 *	dev	Linux kernel netdevice
 *	ifr	Our private ioctl request structure, typed for the
 *		generic struct ifreq so we can use ptr to func
 *		w/o cast.
 *
 * Returns:
 *	zero on success, a negative errno on failure.  Possible values:
 *		-ENETDOWN Device isn't up.
 *		-EBUSY	cmd already in progress
 *		-ETIME	p80211 cmd timed out (MSD may have its own timers)
 *		-EFAULT memory fault copying msg from user buffer
 *		-ENOMEM unable to allocate kernel msg buffer
 *		-EINVAL	bad magic, it the cmd really for us?
 *		-EintR	sleeping on cmd, awakened by signal, cmd cancelled.
 *
 * Call Context:
 *	Process thread (ioctl caller).  TODO: SMP support may require
 *	locks.
 *----------------------------------------------------------------
 */
static int p80211knetdev_do_ioctl(struct net_device *dev,
				  struct ifreq *ifr, int cmd)
{
	int result = 0;
	struct p80211ioctl_req *req = (struct p80211ioctl_req *)ifr;
	struct wlandevice *wlandev = dev->ml_priv;
	u8 *msgbuf;

	netdev_dbg(dev, "rx'd ioctl, cmd=%d, len=%d\n", cmd, req->len);

#ifdef SIOCETHTOOL
	if (cmd == SIOCETHTOOL) {
		result =
		    p80211netdev_ethtool(wlandev, (void __user *)ifr->ifr_data);
		goto bail;
	}
#endif

	/* Test the magic, assume ifr is good if it's there */
	if (req->magic != P80211_IOCTL_MAGIC) {
		result = -EINVAL;
		goto bail;
	}

	if (cmd == P80211_IFTEST) {
		result = 0;
		goto bail;
	} else if (cmd != P80211_IFREQ) {
		result = -EINVAL;
		goto bail;
	}

	/* Allocate a buf of size req->len */
	msgbuf = kmalloc(req->len, GFP_KERNEL);
	if (msgbuf) {
		if (copy_from_user(msgbuf, (void __user *)req->data, req->len))
			result = -EFAULT;
		else
			result = p80211req_dorequest(wlandev, msgbuf);

		if (result == 0) {
			if (copy_to_user
			    ((void __user *)req->data, msgbuf, req->len)) {
				result = -EFAULT;
			}
		}
		kfree(msgbuf);
	} else {
		result = -ENOMEM;
	}
bail:
	/* If allocate,copyfrom or copyto fails, return errno */
	return result;
}
开发者ID:SantoshShilimkar,项目名称:linux,代码行数:82,代码来源:p80211netdev.c


示例5: p80211wext_giwrate

static int p80211wext_giwrate(netdevice_t *dev,
			      struct iw_request_info *info,
			      struct iw_param *rrq, char *extra)
{
	wlandevice_t *wlandev = (wlandevice_t*)dev->priv;
	p80211item_uint32_t             mibitem;
	p80211msg_dot11req_mibset_t     msg;
	int result;
	int err = 0;

	DBFENTER;

	msg.msgcode = DIDmsg_dot11req_mibget;
	mibitem.did = DIDmib_p2_p2MAC_p2CurrentTxRate;
	memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem));
	result = p80211req_dorequest(wlandev, (UINT8*)&msg);
	
	if (result) {
		err = -EFAULT;
		goto exit;
	}

	memcpy(&mibitem, &msg.mibattribute.data, sizeof(mibitem));

	rrq->fixed = 0;   /* can it change? */
	rrq->disabled = 0; 
	rrq->value = 0;

#define		HFA384x_RATEBIT_1			((UINT16)1)
#define		HFA384x_RATEBIT_2			((UINT16)2)
#define		HFA384x_RATEBIT_5dot5			((UINT16)4)
#define		HFA384x_RATEBIT_11			((UINT16)8)

	switch (mibitem.data) {
	case HFA384x_RATEBIT_1:
		rrq->value = 1000000;
		break;
	case HFA384x_RATEBIT_2:
		rrq->value = 2000000;
		break;
	case HFA384x_RATEBIT_5dot5:
		rrq->value = 5500000;
		break;
	case HFA384x_RATEBIT_11:
		rrq->value = 11000000;
		break;
	default:
		err = -EINVAL;
	}
 exit:
	DBFEXIT;
	return err;
}
开发者ID:BackupTheBerlios,项目名称:wl530g-svn,代码行数:53,代码来源:p80211wext.c


示例6: p80211wext_autojoin

static int p80211wext_autojoin(wlandevice_t *wlandev)
{
	p80211msg_lnxreq_autojoin_t     msg;
	struct iw_point			data;
	char ssid[IW_ESSID_MAX_SIZE];
        
	int result;
	int err = 0;

	DBFENTER;

	/* Get ESSID */
	result = p80211wext_giwessid(wlandev->netdev, NULL, &data, ssid);

	if (result) {
		err = -EFAULT;
		goto exit;
	}

#warning "make a smarter sharedkey/opensystem auth decision"
	/* Get WEPDef */
	if (wlandev->hostwep & HOSTWEP_PRIVACYINVOKED ||
	    wlandev->hostwep & HOSTWEP_EXCLUDEUNENCRYPTED) {
		msg.authtype.data = P80211ENUM_authalg_sharedkey;
	}
	else {
		msg.authtype.data = P80211ENUM_authalg_opensystem;
	}

	msg.msgcode = DIDmsg_lnxreq_autojoin;		

	/* Trim the last '\0' to fit the SSID format */

	if (ssid[data.length-1] == '\0') {
		data.length = data.length - 1;
	}
	
	memcpy(msg.ssid.data.data, ssid, data.length);
	msg.ssid.data.len = data.length;

	result = p80211req_dorequest(wlandev, (UINT8*)&msg);

	if (result) {
		err = -EFAULT;
		goto exit;
	}

exit:

	DBFEXIT;
	return err;	

}
开发者ID:miettal,项目名称:armadillo420_standard,代码行数:53,代码来源:p80211wext.c


示例7: prism2_domibset_uint32

static int prism2_domibset_uint32(struct wlandevice *wlandev, u32 did, u32 data)
{
	struct p80211msg_dot11req_mibset msg;
	struct p80211item_uint32 *mibitem =
			(struct p80211item_uint32 *)&msg.mibattribute.data;

	msg.msgcode = DIDMSG_DOT11REQ_MIBSET;
	mibitem->did = did;
	mibitem->data = data;

	return p80211req_dorequest(wlandev, (u8 *)&msg);
}
开发者ID:austriancoder,项目名称:linux,代码行数:12,代码来源:cfg80211.c


示例8: prism2_domibset_pstr32

static int prism2_domibset_pstr32(struct wlandevice *wlandev,
				  u32 did, u8 len, const u8 *data)
{
	struct p80211msg_dot11req_mibset msg;
	struct p80211item_pstr32 *mibitem =
			(struct p80211item_pstr32 *)&msg.mibattribute.data;

	msg.msgcode = DIDMSG_DOT11REQ_MIBSET;
	mibitem->did = did;
	mibitem->data.len = len;
	memcpy(mibitem->data.data, data, len);

	return p80211req_dorequest(wlandev, (u8 *)&msg);
}
开发者ID:grate-driver,项目名称:linux,代码行数:14,代码来源:cfg80211.c


示例9: p80211wext_setmib

static int p80211wext_setmib(wlandevice_t *wlandev, u32 did, u32 data)
{
	p80211msg_dot11req_mibset_t msg;
	p80211item_uint32_t *mibitem =
		(p80211item_uint32_t *)&msg.mibattribute.data;
	int result;

	msg.msgcode = DIDmsg_dot11req_mibset;
	memset(mibitem, 0, sizeof(*mibitem));
	mibitem->did = did;
	mibitem->data = data;
	result = p80211req_dorequest(wlandev, (u8 *) &msg);

	return result;
}
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:15,代码来源:p80211wext.c


示例10: p80211wext_siwessid

static int p80211wext_siwessid(netdevice_t *dev,
			       struct iw_request_info *info,
			       struct iw_point *data, char *essid)
{
	wlandevice_t *wlandev = (wlandevice_t*)dev->priv;
	p80211msg_dot11req_mibset_t     msg;
	p80211item_pstr32_t             pstr;

	int result;
	int err = 0;

	DBFENTER;

	if (!wlan_wext_write) {
		err = (-EOPNOTSUPP);
		goto exit;
	}

	memset(&msg, 0, sizeof(msg));
	memset(&pstr, 0, sizeof(pstr));  
	msg.msgcode = DIDmsg_dot11req_mibset;

#warning "Get rid of p2mib here!"

	if (wlandev->macmode == WLAN_MACMODE_ESS_AP)
		pstr.did = DIDmib_p2_p2Static_p2CnfOwnSSID;
	else
		pstr.did = DIDmib_dot11smt_dot11StationConfigTable_dot11DesiredSSID;

	pstr.data.len = data->length;
	memcpy(pstr.data.data, essid, data->length);

	memcpy(&msg.mibattribute.data, &pstr, sizeof(pstr));
	result = p80211req_dorequest(wlandev, (UINT8*)&msg);

	if (result) {
		err = -EFAULT;
		goto exit;
	}

	/* Auto Join */
	err = p80211wext_autojoin(wlandev); 

 exit:
	DBFEXIT;
	return err;
}
开发者ID:miettal,项目名称:armadillo420_standard,代码行数:47,代码来源:p80211wext.c


示例11: p80211wext_autojoin

static int p80211wext_autojoin(wlandevice_t *wlandev)
{
	p80211msg_lnxreq_autojoin_t msg;
	struct iw_point data;
	char ssid[IW_ESSID_MAX_SIZE];

	int result;
	int err = 0;

	/* Get ESSID */
	result = p80211wext_giwessid(wlandev->netdev, NULL, &data, ssid);

	if (result) {
		err = -EFAULT;
		goto exit;
	}

	if (wlandev->hostwep & HOSTWEP_SHAREDKEY)
		msg.authtype.data = P80211ENUM_authalg_sharedkey;
	else
		msg.authtype.data = P80211ENUM_authalg_opensystem;

	msg.msgcode = DIDmsg_lnxreq_autojoin;

	/* Trim the last '\0' to fit the SSID format */

	if (data.length && ssid[data.length - 1] == '\0')
		data.length = data.length - 1;

	memcpy(msg.ssid.data.data, ssid, data.length);
	msg.ssid.data.len = data.length;

	result = p80211req_dorequest(wlandev, (u8 *) &msg);

	if (result) {
		err = -EFAULT;
		goto exit;
	}

exit:

	return err;

}
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:44,代码来源:p80211wext.c


示例12: p80211wext_siwtxpow

static int p80211wext_siwtxpow(netdevice_t *dev,
                               struct iw_request_info *info,
                               struct iw_param *rrq, char *extra)
{
        wlandevice_t *wlandev = (wlandevice_t*)dev->priv;
        p80211item_uint32_t             mibitem;
        p80211msg_dot11req_mibset_t     msg;
        int result;
        int err = 0;
                              
        DBFENTER;
	
       if (!wlan_wext_write) {
                err = (-EOPNOTSUPP); 
                goto exit;    
        }

        msg.msgcode = DIDmsg_dot11req_mibset;

        switch (rrq->value) {

          case 1 : mibitem.did = DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel1; break;
          case 2 : mibitem.did = DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel2; break;
          case 3 : mibitem.did = DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel3; break;
          case 4 : mibitem.did = DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel4; break;
          case 5 : mibitem.did = DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel5; break;
          case 6 : mibitem.did = DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel6; break;
          case 7 : mibitem.did = DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel7; break;
          case 8 : mibitem.did = DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel8; break;
          default: mibitem.did = DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel8; break;
	}

        memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem));
        result = p80211req_dorequest(wlandev, (UINT8*)&msg);

        if (result) {
                err = -EFAULT;
                goto exit;
        }

 exit:
        DBFEXIT;
        return err;
}
开发者ID:miettal,项目名称:armadillo420_standard,代码行数:44,代码来源:p80211wext.c


示例13: p80211wext_siwscan

static int p80211wext_siwscan(netdevice_t *dev,
			     struct iw_request_info *info,
			     struct iw_point *srq, char *extra)
{
	wlandevice_t *wlandev = (wlandevice_t*)dev->priv;
	p80211msg_dot11req_scan_t	msg;	
	int result;
	int err = 0;
	int i = 0;

	DBFENTER;

	if (wlandev->macmode == WLAN_MACMODE_ESS_AP) {
		WLAN_LOG_ERROR("Can't scan in AP mode\n");
		err = (-EOPNOTSUPP);
		goto exit;
	}

	memset(&msg, 0x00, sizeof(p80211msg_dot11req_scan_t));
	msg.msgcode = DIDmsg_dot11req_scan;
	msg.bsstype.data = P80211ENUM_bsstype_any;

	memset(&(msg.bssid.data), 0xFF, sizeof (p80211item_pstr6_t));
	msg.bssid.data.len = 6;

	msg.scantype.data = P80211ENUM_scantype_active;
	msg.probedelay.data = 0;

	for (i = 0; i < 14; i++)
		msg.channellist.data.data[i] = i;
	msg.channellist.data.len = 14;

	msg.maxchanneltime.data = 250;
	msg.minchanneltime.data = 200;

	result = p80211req_dorequest(wlandev, (UINT8*)&msg);
	if (result)
		err = prism2_result2err (msg.resultcode.data);

 exit:
	DBFEXIT;
	return err;
}
开发者ID:miettal,项目名称:armadillo420_standard,代码行数:43,代码来源:p80211wext.c


示例14: p80211wext_giwscan

static int p80211wext_giwscan(netdevice_t *dev,
			     struct iw_request_info *info,
			     struct iw_point *srq, char *extra)
{
	wlandevice_t *wlandev = (wlandevice_t*)dev->priv;
	p80211msg_dot11req_scan_results_t	msg;
	int result = 0;
	int err = 0;
	int i = 0;
	int scan_good = 0;
	char *current_ev = extra;

	DBFENTER;

	/* Since wireless tools doesn't really have a way of passing how
	 * many scan results results there were back here, keep grabbing them
	 * until we fail.
	 */
	do {
		memset(&msg, 0, sizeof(msg));
		msg.msgcode = DIDmsg_dot11req_scan_results;
		msg.bssindex.data = i;

		result = p80211req_dorequest(wlandev, (UINT8*)&msg);
		if ((result != 0) || 
		    (msg.resultcode.data != P80211ENUM_resultcode_success)) {
			break;
		}
		  
		current_ev = wext_translate_bss(current_ev, extra + IW_SCAN_MAX_DATA, &msg);
		scan_good = 1;
		i++;
	} while (i < IW_MAX_AP);

	srq->length = (current_ev - extra);
	srq->flags = 0;	/* todo */

	if (result && !scan_good)
		err = prism2_result2err (msg.resultcode.data);

	DBFEXIT;
	return err;
}
开发者ID:miettal,项目名称:armadillo420_standard,代码行数:43,代码来源:p80211wext.c


示例15: p80211wext_siwessid

static int p80211wext_siwessid(netdevice_t *dev,
			       struct iw_request_info *info,
			       struct iw_point *data, char *essid)
{
	wlandevice_t *wlandev = dev->ml_priv;
	p80211msg_lnxreq_autojoin_t msg;

	int result;
	int err = 0;
	int length = data->length;

	if (!wlan_wext_write) {
		err = (-EOPNOTSUPP);
		goto exit;
	}

	if (wlandev->hostwep & HOSTWEP_SHAREDKEY)
		msg.authtype.data = P80211ENUM_authalg_sharedkey;
	else
		msg.authtype.data = P80211ENUM_authalg_opensystem;

	msg.msgcode = DIDmsg_lnxreq_autojoin;

	/* Trim the last '\0' to fit the SSID format */
	if (length && essid[length - 1] == '\0')
		length--;

	memcpy(msg.ssid.data.data, essid, length);
	msg.ssid.data.len = length;

	pr_debug("autojoin_ssid for %s \n", essid);
	result = p80211req_dorequest(wlandev, (u8 *) &msg);
	pr_debug("autojoin_ssid %d\n", result);

	if (result) {
		err = -EFAULT;
		goto exit;
	}

exit:
	return err;
}
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:42,代码来源:p80211wext.c


示例16: prism2_disconnect

static int prism2_disconnect(struct wiphy *wiphy, struct net_device *dev,
			     u16 reason_code)
{
	struct wlandevice *wlandev = dev->ml_priv;
	struct p80211msg_lnxreq_autojoin msg_join;
	int result;
	int err = 0;

	/* Do a join, with a bogus ssid. Thats the only way I can think of */
	msg_join.msgcode = DIDMSG_LNXREQ_AUTOJOIN;

	memcpy(msg_join.ssid.data.data, "---", 3);
	msg_join.ssid.data.len = 3;

	result = p80211req_dorequest(wlandev, (u8 *)&msg_join);

	if (result)
		err = -EFAULT;

	return err;
}
开发者ID:grate-driver,项目名称:linux,代码行数:21,代码来源:cfg80211.c


示例17: p80211wext_giwessid

static int p80211wext_giwessid(netdevice_t *dev,
			       struct iw_request_info *info,
			       struct iw_point *data, char *essid)
{
	wlandevice_t *wlandev = (wlandevice_t*)dev->priv;
	p80211msg_dot11req_mibset_t     msg;
	p80211item_pstr32_t             pstr;

	int result;
	int err = 0;

	DBFENTER;

	memset(&msg, 0, sizeof(msg));
	memset(&pstr, 0, sizeof(pstr));  
	msg.msgcode = DIDmsg_dot11req_mibget;

	if (wlandev->macmode == WLAN_MACMODE_ESS_AP)
		pstr.did = DIDmib_p2_p2Static_p2CnfOwnSSID;
	else
		pstr.did = DIDmib_dot11smt_dot11StationConfigTable_dot11DesiredSSID;
	
	memcpy(&msg.mibattribute.data, &pstr, sizeof(pstr));
	result = p80211req_dorequest(wlandev, (UINT8*)&msg);
	
	if (result) {
		err = -EFAULT;
		goto exit;
	}
	
	memcpy(&pstr, &msg.mibattribute.data, sizeof(pstr));

	data->flags = 1;
	data->length = pstr.data.len;
	memcpy(essid, pstr.data.data, pstr.data.len);
	
 exit:
	DBFEXIT;
	return err;
}
开发者ID:BackupTheBerlios,项目名称:wl530g-svn,代码行数:40,代码来源:p80211wext.c


示例18: prism2_disconnect

int prism2_disconnect(struct wiphy *wiphy, struct net_device *dev,
		      u16 reason_code)
{
	wlandevice_t *wlandev = dev->ml_priv;
	struct p80211msg_lnxreq_autojoin msg_join;
	int result;
	int err = 0;


	
	msg_join.msgcode = DIDmsg_lnxreq_autojoin;

	memcpy(msg_join.ssid.data.data, "---", 3);
	msg_join.ssid.data.len = 3;

	result = p80211req_dorequest(wlandev, (u8 *) &msg_join);

	if (result)
		err = -EFAULT;

	return err;
}
开发者ID:DirtyDroidX,项目名称:android_kernel_htc_m8ul,代码行数:22,代码来源:cfg80211.c


示例19: p80211wext_giwfreq

static int p80211wext_giwfreq(netdevice_t *dev,
			      struct iw_request_info *info,
			      struct iw_freq *freq, char *extra)
{
	wlandevice_t *wlandev = (wlandevice_t*)dev->priv;
	p80211item_uint32_t             mibitem;
	p80211msg_dot11req_mibset_t     msg;
	int result;
	int err = 0;

	DBFENTER;

	msg.msgcode = DIDmsg_dot11req_mibget;
	mibitem.did = DIDmib_dot11phy_dot11PhyDSSSTable_dot11CurrentChannel;
	memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem));
	result = p80211req_dorequest(wlandev, (UINT8*)&msg);
	
	if (result) {
		err = -EFAULT;
		goto exit;
	}
	
	memcpy(&mibitem, &msg.mibattribute.data, sizeof(mibitem));
	
	if (mibitem.data > NUM_CHANNELS) {
		err = -EFAULT;
		goto exit;
	}
	
	/* convert into frequency instead of a channel */
	freq->e = 1;		
	freq->m = p80211wext_channel_freq[mibitem.data-1] * 100000;

 exit:
	DBFEXIT;
	return err;
}
开发者ID:BackupTheBerlios,项目名称:wl530g-svn,代码行数:37,代码来源:p80211wext.c



注:本文中的p80211req_dorequest函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ p9_debug函数代码示例发布时间:2022-05-30
下一篇:
C++ p7_profile_Destroy函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap