struct ks_wlan_private *priv =
(struct ks_wlan_private *)netdev_priv(dev);
- if (priv->sleep_mode == SLP_SLEEP) {
+ if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
- }
/* for SLEEP MODE */
if (priv->reg.powermgt > 0)
vwrq->disabled = 0;
struct ks_wlan_private *priv =
(struct ks_wlan_private *)netdev_priv(dev);
- if (priv->sleep_mode == SLP_SLEEP) {
+ if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
- }
/* for SLEEP MODE */
vwrq->qual = 0; /* not supported */
vwrq->level = priv->wstats.qual.level;
int i;
- if (priv->sleep_mode == SLP_SLEEP) {
+ if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
- }
/* for SLEEP MODE */
for (i = 0; i < priv->aplist.size; i++) {
memcpy(address[i].sa_data, &(priv->aplist.ap[i].bssid[0]),
struct iw_scan_req *req = NULL;
DPRINTK(2, "\n");
- if (priv->sleep_mode == SLP_SLEEP) {
+ if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
- }
/* for SLEEP MODE */
/* specified SSID SCAN */
char *current_ev = extra;
DPRINTK(2, "\n");
- if (priv->sleep_mode == SLP_SLEEP) {
+ if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
- }
/* for SLEEP MODE */
if (priv->sme_i.sme_flag & SME_AP_SCAN) {
DPRINTK(2, "flag AP_SCAN\n");
DPRINTK(2, "\n");
- if (priv->sleep_mode == SLP_SLEEP) {
+ if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
- }
/* for SLEEP MODE */
return 0;
// return -EOPNOTSUPP;
DPRINTK(2, "index=%d:value=%08X\n", index, value);
- if (priv->sleep_mode == SLP_SLEEP) {
+ if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
- }
/* for SLEEP MODE */
switch (index) {
case IW_AUTH_WPA_VERSION: /* 0 */
switch (value) {
case IW_AUTH_WPA_VERSION_DISABLED:
priv->wpa.version = value;
- if (priv->wpa.rsn_enabled) {
+ if (priv->wpa.rsn_enabled)
priv->wpa.rsn_enabled = 0;
- }
priv->need_commit |= SME_RSN;
break;
case IW_AUTH_WPA_VERSION_WPA:
case IW_AUTH_WPA_VERSION_WPA2:
priv->wpa.version = value;
- if (!(priv->wpa.rsn_enabled)) {
+ if (!(priv->wpa.rsn_enabled))
priv->wpa.rsn_enabled = 1;
- }
priv->need_commit |= SME_RSN;
break;
default:
int index = (vwrq->flags & IW_AUTH_INDEX);
DPRINTK(2, "index=%d\n", index);
- if (priv->sleep_mode == SLP_SLEEP) {
+ if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
- }
/* for SLEEP MODE */
/* WPA (not used ?? wpa_supplicant) */
DPRINTK(2, "flags=%04X:: ext_flags=%08X\n", dwrq->flags,
enc->ext_flags);
- if (priv->sleep_mode == SLP_SLEEP) {
+ if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
- }
+
/* for SLEEP MODE */
if (index < 1 || index > 4)
return -EINVAL;
else
index--;
- if (dwrq->flags & IW_ENCODE_DISABLED) {
+ if (dwrq->flags & IW_ENCODE_DISABLED)
priv->wpa.key[index].key_len = 0;
- }
if (enc) {
priv->wpa.key[index].ext_flags = enc->ext_flags;
struct ks_wlan_private *priv =
(struct ks_wlan_private *)netdev_priv(dev);
- if (priv->sleep_mode == SLP_SLEEP) {
+ if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
- }
/* for SLEEP MODE */
/* WPA (not used ?? wpa_supplicant)
DPRINTK(2, "\n");
- if (priv->sleep_mode == SLP_SLEEP) {
+ if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
- }
+
/* for SLEEP MODE */
- if (!extra) {
+ if (!extra)
return -EINVAL;
- }
+
pmksa = (struct iw_pmksa *)extra;
DPRINTK(2, "cmd=%d\n", pmksa->cmd);
(struct ks_wlan_private *)netdev_priv(dev);
DPRINTK(2, "\n");
- if (priv->sleep_mode == SLP_SLEEP) {
+ if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
- }
+
/* for SLEEP MODE */
if (!(*uwrq))
return -EINVAL;
DPRINTK(2, ":%d :%d\n", mlme->cmd, mlme->reason_code);
- if (priv->sleep_mode == SLP_SLEEP) {
+ if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
- }
+
/* for SLEEP MODE */
switch (mlme->cmd) {
case IW_MLME_DEAUTH:
- if (mlme->reason_code == WLAN_REASON_MIC_FAILURE) {
+ if (mlme->reason_code == WLAN_REASON_MIC_FAILURE)
return 0;
- }
case IW_MLME_DISASSOC:
mode = 1;
return ks_wlan_set_stop_request(dev, NULL, &mode, NULL);
{
struct ks_wlan_private *priv = (struct ks_wlan_private *)dev->priv;
- if (priv->sleep_mode == SLP_SLEEP) {
+ if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
- }
+
/* for SLEEP MODE */
if (*uwrq == CONNECT_STATUS) { /* 0 */
priv->connect_status &= ~FORCE_DISCONNECT;
{
struct ks_wlan_private *priv = (struct ks_wlan_private *)dev->priv;
- if (priv->sleep_mode == SLP_SLEEP) {
+ if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
- }
+
/* for SLEEP MODE */
*uwrq = ((priv->connect_status & FORCE_DISCONNECT) ? 1 : 0);
return 0;
{
struct ks_wlan_private *priv = (struct ks_wlan_private *)dev->priv;
- if (priv->sleep_mode == SLP_SLEEP) {
+ if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
- }
+
/* for SLEEP MODE */
*uwrq = (priv->connect_status & CONNECT_STATUS_MASK);
return 0;
struct ks_wlan_private *priv =
(struct ks_wlan_private *)netdev_priv(dev);
- if (priv->sleep_mode == SLP_SLEEP) {
+ if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
- }
+
/* for SLEEP MODE */
if (*uwrq == LONG_PREAMBLE) { /* 0 */
priv->reg.preamble = LONG_PREAMBLE;
struct ks_wlan_private *priv =
(struct ks_wlan_private *)netdev_priv(dev);
- if (priv->sleep_mode == SLP_SLEEP) {
+ if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
- }
+
/* for SLEEP MODE */
*uwrq = priv->reg.preamble;
return 0;
struct ks_wlan_private *priv =
(struct ks_wlan_private *)netdev_priv(dev);
- if (priv->sleep_mode == SLP_SLEEP) {
+ if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
- }
+
/* for SLEEP MODE */
if (*uwrq == POWMGT_ACTIVE_MODE) { /* 0 */
priv->reg.powermgt = POWMGT_ACTIVE_MODE;
struct ks_wlan_private *priv =
(struct ks_wlan_private *)netdev_priv(dev);
- if (priv->sleep_mode == SLP_SLEEP) {
+ if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
- }
+
/* for SLEEP MODE */
*uwrq = priv->reg.powermgt;
return 0;
struct ks_wlan_private *priv =
(struct ks_wlan_private *)netdev_priv(dev);
- if (priv->sleep_mode == SLP_SLEEP) {
+ if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
- }
/* for SLEEP MODE */
if (*uwrq == ACTIVE_SCAN) { /* 0 */
priv->reg.scan_type = ACTIVE_SCAN;
struct ks_wlan_private *priv =
(struct ks_wlan_private *)netdev_priv(dev);
- if (priv->sleep_mode == SLP_SLEEP) {
+ if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
- }
/* for SLEEP MODE */
*uwrq = priv->reg.scan_type;
return 0;
struct ks_wlan_private *priv = (struct ks_wlan_private *)dev->priv;
unsigned char *wbuff = NULL;
- if (priv->sleep_mode == SLP_SLEEP) {
+ if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
- }
/* for SLEEP MODE */
wbuff = (unsigned char *)kmalloc(dwrq->length, GFP_ATOMIC);
if (!wbuff)
struct ks_wlan_private *priv = (struct ks_wlan_private *)dev->priv;
unsigned short read_length;
- if (priv->sleep_mode == SLP_SLEEP) {
+ if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
- }
/* for SLEEP MODE */
if (!atomic_read(&priv->event_count)) {
if (priv->dev_state < DEVICE_STATE_BOOT) { /* Remove device */
int i, j, len = 0;
char tmp[WEP_ASCII_BUFF_SIZE];
- if (priv->sleep_mode == SLP_SLEEP) {
+ if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
- }
/* for SLEEP MODE */
strcpy(tmp, " WEP keys ASCII \n");
len += strlen(" WEP keys ASCII \n");
struct ks_wlan_private *priv =
(struct ks_wlan_private *)netdev_priv(dev);
- if (priv->sleep_mode == SLP_SLEEP) {
+ if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
- }
/* for SLEEP MODE */
- if (*uwrq >= BEACON_LOST_COUNT_MIN && *uwrq <= BEACON_LOST_COUNT_MAX) {
+ if (*uwrq >= BEACON_LOST_COUNT_MIN && *uwrq <= BEACON_LOST_COUNT_MAX)
priv->reg.beacon_lost_count = *uwrq;
- } else
+ else
return -EINVAL;
if (priv->reg.operation_mode == MODE_INFRASTRUCTURE) {
struct ks_wlan_private *priv =
(struct ks_wlan_private *)netdev_priv(dev);
- if (priv->sleep_mode == SLP_SLEEP) {
+ if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
- }
/* for SLEEP MODE */
*uwrq = priv->reg.beacon_lost_count;
return 0;
struct ks_wlan_private *priv =
(struct ks_wlan_private *)netdev_priv(dev);
- if (priv->sleep_mode == SLP_SLEEP) {
+ if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
- }
/* for SLEEP MODE */
if (*uwrq == D_11B_ONLY_MODE) { /* 0 */
priv->reg.phy_type = D_11B_ONLY_MODE;
struct ks_wlan_private *priv =
(struct ks_wlan_private *)netdev_priv(dev);
- if (priv->sleep_mode == SLP_SLEEP) {
+ if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
- }
/* for SLEEP MODE */
*uwrq = priv->reg.phy_type;
return 0;
struct ks_wlan_private *priv =
(struct ks_wlan_private *)netdev_priv(dev);
- if (priv->sleep_mode == SLP_SLEEP) {
+ if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
- }
/* for SLEEP MODE */
if (*uwrq == CTS_MODE_FALSE) { /* 0 */
priv->reg.cts_mode = CTS_MODE_FALSE;
struct ks_wlan_private *priv =
(struct ks_wlan_private *)netdev_priv(dev);
- if (priv->sleep_mode == SLP_SLEEP) {
+ if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
- }
/* for SLEEP MODE */
*uwrq = priv->reg.cts_mode;
return 0;
{
struct ks_wlan_private *priv = (struct ks_wlan_private *)dev->priv;
- if (priv->sleep_mode == SLP_SLEEP) {
+ if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
- }
/* for SLEEP MODE */
if (*uwrq >= 0 && *uwrq <= 0xFFFF) /* 0-65535 */
priv->reg.phy_info_timer = (uint16_t) * uwrq;
{
struct ks_wlan_private *priv = (struct ks_wlan_private *)dev->priv;
- if (priv->sleep_mode == SLP_SLEEP) {
+ if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
- }
/* for SLEEP MODE */
*uwrq = priv->reg.phy_info_timer;
return 0;
(struct ks_wlan_private *)netdev_priv(dev);
DPRINTK(2, "\n");
- if (priv->sleep_mode == SLP_SLEEP) {
+ if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
- }
/* for SLEEP MODE */
if (*uwrq == 0 || *uwrq == 1)
priv->wps.wps_enabled = *uwrq;
(struct ks_wlan_private *)netdev_priv(dev);
DPRINTK(2, "\n");
- if (priv->sleep_mode == SLP_SLEEP) {
+ if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
- }
/* for SLEEP MODE */
*uwrq = priv->wps.wps_enabled;
netdev_info(dev, "return=%d\n", *uwrq);
DPRINTK(2, "\n");
- if (priv->sleep_mode == SLP_SLEEP) {
+ if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
- }
/* for SLEEP MODE */
DPRINTK(2, "dwrq->length=%d\n", dwrq->length);
/* length check */
- if (p[1] + 2 != dwrq->length || dwrq->length > 256) {
+ if (p[1] + 2 != dwrq->length || dwrq->length > 256)
return -EINVAL;
- }
priv->wps.ielen = p[1] + 2 + 1; /* IE header + IE + sizeof(len) */
len = p[1] + 2; /* IE header + IE */
struct ks_wlan_private *priv = (struct ks_wlan_private *)dev->priv;
DPRINTK(2, "\n");
- if (priv->sleep_mode == SLP_SLEEP) {
+ if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
- }
/* for SLEEP MODE */
return 0;
}
struct ks_wlan_private *priv =
(struct ks_wlan_private *)netdev_priv(dev);
- if (priv->sleep_mode == SLP_SLEEP) {
+ if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
- }
/* for SLEEP MODE */
if (*uwrq >= 0 && *uwrq <= 0xFF) /* 0-255 */
priv->gain.TxGain = (uint8_t) * uwrq;
struct ks_wlan_private *priv =
(struct ks_wlan_private *)netdev_priv(dev);
- if (priv->sleep_mode == SLP_SLEEP) {
+ if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
- }
/* for SLEEP MODE */
*uwrq = priv->gain.TxGain;
hostif_sme_enqueue(priv, SME_GET_GAIN);
struct ks_wlan_private *priv =
(struct ks_wlan_private *)netdev_priv(dev);
- if (priv->sleep_mode == SLP_SLEEP) {
+ if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
- }
/* for SLEEP MODE */
if (*uwrq >= 0 && *uwrq <= 0xFF) /* 0-255 */
priv->gain.RxGain = (uint8_t) * uwrq;
struct ks_wlan_private *priv =
(struct ks_wlan_private *)netdev_priv(dev);
- if (priv->sleep_mode == SLP_SLEEP) {
+ if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
- }
/* for SLEEP MODE */
*uwrq = priv->gain.RxGain;
hostif_sme_enqueue(priv, SME_GET_GAIN);
{
struct ks_wlan_private *priv = (struct ks_wlan_private *)dev->priv;
- if (priv->sleep_mode == SLP_SLEEP) {
+ if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
- }
/* for SLEEP MODE */
if (*uwrq >= 0x9 && *uwrq <= 0xF) /* 0x9-0xf */
priv->region = (uint8_t) * uwrq;
{
struct ks_wlan_private *priv = netdev_priv(dev);
- if (priv->dev_state < DEVICE_STATE_READY) {
+ if (priv->dev_state < DEVICE_STATE_READY)
return NULL; /* not finished initialize */
- }
return &priv->nstats;
}
DPRINTK(1, "head(%d) tail(%d)!!\n", priv->tx_dev.qhead,
priv->tx_dev.qtail);
- if (!netif_queue_stopped(dev)) {
+ if (!netif_queue_stopped(dev))
netif_stop_queue(dev);
- }
priv->nstats.tx_errors++;
netif_wake_queue(dev);
}
netif_trans_update(dev);
DPRINTK(4, "rc=%d\n", rc);
- if (rc) {
+ if (rc)
rc = 0;
- }
return rc;
}
struct ks_wlan_private *priv = netdev_priv(dev);
DPRINTK(4, "\n");
- if (priv->dev_state < DEVICE_STATE_READY) {
+ if (priv->dev_state < DEVICE_STATE_READY)
return; /* not finished initialize */
- }
hostif_sme_enqueue(priv, SME_MULTICAST_REQUEST);
}