Пример #1
0
static int r8180_wx_set_retry(struct net_device *dev,
                              struct iw_request_info *info,
                              union iwreq_data *wrqu, char *extra)
{
    struct r8180_priv *priv = ieee80211_priv(dev);
    int err = 0;

    if (priv->ieee80211->bHwRadioOff)
        return 0;

    down(&priv->wx_sem);

    if (wrqu->retry.flags & IW_RETRY_LIFETIME ||
            wrqu->retry.disabled)	{
        err = -EINVAL;
        goto exit;
    }
    if (!(wrqu->retry.flags & IW_RETRY_LIMIT))	{
        err = -EINVAL;
        goto exit;
    }

    if (wrqu->retry.value > R8180_MAX_RETRY)	{
        err = -EINVAL;
        goto exit;
    }
    if (wrqu->retry.flags & IW_RETRY_MAX) {
        priv->retry_rts = wrqu->retry.value;
        DMESG("Setting retry for RTS/CTS data to %d", wrqu->retry.value);

    }	else {
        priv->retry_data = wrqu->retry.value;
        DMESG("Setting retry for non RTS/CTS data to %d", wrqu->retry.value);
    }

    /* FIXME !
     * We might try to write directly the TX config register
     * or to restart just the (R)TX process.
     * I'm unsure if whole reset is really needed
     */

    rtl8180_commit(dev);
    /*
    if(priv->up){
    	rtl8180_rtx_disable(dev);
    	rtl8180_rx_enable(dev);
    	rtl8180_tx_enable(dev);

    }
    */
exit:
    up(&priv->wx_sem);

    return err;
}
Пример #2
0
static int r8180_wx_set_beaconinterval(struct net_device *dev, struct iw_request_info *aa,
			  union iwreq_data *wrqu, char *b)
{
	int *parms = (int *)b;
	int bi = parms[0];
	
	struct r8180_priv *priv = ieee80211_priv(dev);
	
	down(&priv->wx_sem);
	DMESG("setting beacon interval to %x",bi);
	
	priv->ieee80211->beacon_interval=bi;
	rtl8180_commit(dev);
	up(&priv->wx_sem);
		
	return 0;	
}