unsigned char byte;
int ret;
- if (priv->reg.powermgt == POWMGT_ACTIVE_MODE)
+ if (priv->reg.power_mgmt == POWER_MGMT_ACTIVE)
return;
if (priv->reg.operation_mode != MODE_INFRASTRUCTURE)
{
priv->reg.tx_rate = TX_RATE_AUTO;
priv->reg.preamble = LONG_PREAMBLE;
- priv->reg.powermgt = POWMGT_ACTIVE_MODE;
+ priv->reg.power_mgmt = POWER_MGMT_ACTIVE;
priv->reg.scan_type = ACTIVE_SCAN;
priv->reg.beacon_lost_count = 20;
priv->reg.rts = 2347UL;
}
static
-void hostif_power_mngmt_confirm(struct ks_wlan_private *priv)
+void hostif_power_mgmt_confirm(struct ks_wlan_private *priv)
{
DPRINTK(3, "\n");
- if (priv->reg.powermgt > POWMGT_ACTIVE_MODE &&
+ if (priv->reg.power_mgmt > POWER_MGMT_ACTIVE &&
priv->reg.operation_mode == MODE_INFRASTRUCTURE) {
atomic_set(&priv->psstatus.confirm_wait, 0);
priv->dev_state = DEVICE_STATE_SLEEP;
case HIF_MIB_SET_CONF:
hostif_mib_set_confirm(priv);
break;
- case HIF_POWERMGT_CONF:
- hostif_power_mngmt_confirm(priv);
+ case HIF_POWER_MGMT_CONF:
+ hostif_power_mgmt_confirm(priv);
break;
case HIF_SLEEP_CONF:
hostif_sleep_confirm(priv);
}
static
-void hostif_power_mngmt_request(struct ks_wlan_private *priv,
- unsigned long mode, unsigned long wake_up,
- unsigned long receiveDTIMs)
+void hostif_power_mgmt_request(struct ks_wlan_private *priv,
+ unsigned long mode, unsigned long wake_up,
+ unsigned long receiveDTIMs)
{
- struct hostif_power_mngmt_request_t *pp;
+ struct hostif_power_mgmt_request_t *pp;
DPRINTK(3, "mode=%lu wake_up=%lu receiveDTIMs=%lu\n", mode, wake_up,
receiveDTIMs);
- pp = hostif_generic_request(sizeof(*pp), HIF_POWERMGT_REQ);
+ pp = hostif_generic_request(sizeof(*pp), HIF_POWER_MGMT_REQ);
if (!pp)
return;
}
static
-void hostif_sme_powermgt_set(struct ks_wlan_private *priv)
+void hostif_sme_power_mgmt_set(struct ks_wlan_private *priv)
{
unsigned long mode, wake_up, receiveDTIMs;
DPRINTK(3, "\n");
- switch (priv->reg.powermgt) {
- case POWMGT_ACTIVE_MODE:
+ switch (priv->reg.power_mgmt) {
+ case POWER_MGMT_ACTIVE:
mode = POWER_ACTIVE;
wake_up = 0;
receiveDTIMs = 0;
break;
- case POWMGT_SAVE1_MODE:
+ case POWER_MGMT_SAVE1:
if (priv->reg.operation_mode == MODE_INFRASTRUCTURE) {
mode = POWER_SAVE;
wake_up = 0;
receiveDTIMs = 0;
}
break;
- case POWMGT_SAVE2_MODE:
+ case POWER_MGMT_SAVE2:
if (priv->reg.operation_mode == MODE_INFRASTRUCTURE) {
mode = POWER_SAVE;
wake_up = 0;
receiveDTIMs = 0;
break;
}
- hostif_power_mngmt_request(priv, mode, wake_up, receiveDTIMs);
+ hostif_power_mgmt_request(priv, mode, wake_up, receiveDTIMs);
}
static
priv->scan_ssid, priv->scan_ssid_len);
break;
case SME_POW_MNGMT_REQUEST:
- hostif_sme_powermgt_set(priv);
+ hostif_sme_power_mgmt_set(priv);
break;
case SME_PHY_INFO_REQUEST:
hostif_phy_information_request(priv);
#define HIF_MIB_GET_CONF 0xE802
#define HIF_MIB_SET_REQ 0xE003
#define HIF_MIB_SET_CONF 0xE803
-#define HIF_POWERMGT_REQ 0xE004
-#define HIF_POWERMGT_CONF 0xE804
+#define HIF_POWER_MGMT_REQ 0xE004
+#define HIF_POWER_MGMT_CONF 0xE804
#define HIF_START_REQ 0xE005
#define HIF_START_CONF 0xE805
#define HIF_CONNECT_IND 0xE806
u32 mib_attribute;
} __packed;
-struct hostif_power_mngmt_request_t {
+struct hostif_power_mgmt_request_t {
struct hostif_hdr header;
u32 mode;
#define POWER_ACTIVE 1
#define DTIM_TRUE 1
} __packed;
-/* power management mode */
-enum {
- POWMGT_ACTIVE_MODE = 0,
- POWMGT_SAVE1_MODE,
- POWMGT_SAVE2_MODE
+enum power_mgmt_mode_type {
+ POWER_MGMT_ACTIVE,
+ POWER_MGMT_SAVE1,
+ POWER_MGMT_SAVE2
};
#define RESULT_SUCCESS 0
/* #define RESULT_ALREADY_RUNNING 3 */
#define RESULT_ALREADY_RUNNING 7
-struct hostif_power_mngmt_confirm_t {
+struct hostif_power_mgmt_confirm_t {
struct hostif_hdr header;
u16 result_code;
} __packed;
u8 body[32 + 1];
} ssid; /* SSID */
u8 preamble; /* Preamble */
- u8 powermgt; /* PowerManagementMode */
+ u8 power_mgmt;
u32 scan_type; /* AP List Scan Type */
#define BEACON_LOST_COUNT_MIN 0
#define BEACON_LOST_COUNT_MAX 65535
return -EPERM;
if (vwrq->disabled) {
- priv->reg.powermgt = POWMGT_ACTIVE_MODE;
+ priv->reg.power_mgmt = POWER_MGMT_ACTIVE;
} else {
if (priv->reg.operation_mode == MODE_INFRASTRUCTURE)
- priv->reg.powermgt = POWMGT_SAVE1_MODE;
+ priv->reg.power_mgmt = POWER_MGMT_SAVE1;
else
return -EINVAL;
}
if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
/* for SLEEP MODE */
- if (priv->reg.powermgt > 0)
+ if (priv->reg.power_mgmt > 0)
vwrq->disabled = 0;
else
vwrq->disabled = 1;
return 0;
}
-static int ks_wlan_set_powermgt(struct net_device *dev,
- struct iw_request_info *info, __u32 *uwrq,
- char *extra)
+static int ks_wlan_set_power_mgmt(struct net_device *dev,
+ struct iw_request_info *info, __u32 *uwrq,
+ char *extra)
{
struct ks_wlan_private *priv =
(struct ks_wlan_private *)netdev_priv(dev);
return -EPERM;
/* for SLEEP MODE */
- if (*uwrq == POWMGT_ACTIVE_MODE) { /* 0 */
- priv->reg.powermgt = POWMGT_ACTIVE_MODE;
- } else if (*uwrq == POWMGT_SAVE1_MODE) { /* 1 */
+ if (*uwrq == POWER_MGMT_ACTIVE) { /* 0 */
+ priv->reg.power_mgmt = POWER_MGMT_ACTIVE;
+ } else if (*uwrq == POWER_MGMT_SAVE1) { /* 1 */
if (priv->reg.operation_mode == MODE_INFRASTRUCTURE)
- priv->reg.powermgt = POWMGT_SAVE1_MODE;
+ priv->reg.power_mgmt = POWER_MGMT_SAVE1;
else
return -EINVAL;
- } else if (*uwrq == POWMGT_SAVE2_MODE) { /* 2 */
+ } else if (*uwrq == POWER_MGMT_SAVE2) { /* 2 */
if (priv->reg.operation_mode == MODE_INFRASTRUCTURE)
- priv->reg.powermgt = POWMGT_SAVE2_MODE;
+ priv->reg.power_mgmt = POWER_MGMT_SAVE2;
else
return -EINVAL;
} else {
return 0;
}
-static int ks_wlan_get_powermgt(struct net_device *dev,
- struct iw_request_info *info, __u32 *uwrq,
- char *extra)
+static int ks_wlan_get_power_mgmt(struct net_device *dev,
+ struct iw_request_info *info, __u32 *uwrq,
+ char *extra)
{
struct ks_wlan_private *priv =
(struct ks_wlan_private *)netdev_priv(dev);
return -EPERM;
/* for SLEEP MODE */
- *uwrq = priv->reg.powermgt;
+ *uwrq = priv->reg.power_mgmt;
return 0;
}
case HIF_MIB_SET_CONF:
netdev_info(dev, "HIF_MIB_SET_CONF\n");
break;
- case HIF_POWERMGT_REQ:
- netdev_info(dev, "HIF_POWERMGT_REQ\n");
+ case HIF_POWER_MGMT_REQ:
+ netdev_info(dev, "HIF_POWER_MGMT_REQ\n");
break;
- case HIF_POWERMGT_CONF:
- netdev_info(dev, "HIF_POWERMGT_CONF\n");
+ case HIF_POWER_MGMT_CONF:
+ netdev_info(dev, "HIF_POWER_MGMT_CONF\n");
break;
case HIF_START_REQ:
netdev_info(dev, "HIF_START_REQ\n");
(iw_handler)ks_wlan_get_eeprom_cksum, /* 7 KS_WLAN_GET_CONNECT */
(iw_handler)ks_wlan_set_preamble, /* 8 KS_WLAN_SET_PREAMBLE */
(iw_handler)ks_wlan_get_preamble, /* 9 KS_WLAN_GET_PREAMBLE */
- (iw_handler)ks_wlan_set_powermgt, /* 10 KS_WLAN_SET_POWER_SAVE */
- (iw_handler)ks_wlan_get_powermgt, /* 11 KS_WLAN_GET_POWER_SAVE */
+ (iw_handler)ks_wlan_set_power_mgmt, /* 10 KS_WLAN_SET_POWER_SAVE */
+ (iw_handler)ks_wlan_get_power_mgmt, /* 11 KS_WLAN_GET_POWER_SAVE */
(iw_handler)ks_wlan_set_scan_type, /* 12 KS_WLAN_SET_SCAN_TYPE */
(iw_handler)ks_wlan_get_scan_type, /* 13 KS_WLAN_GET_SCAN_TYPE */
(iw_handler)ks_wlan_set_rx_gain, /* 14 KS_WLAN_SET_RX_GAIN */