return cpu_to_le16((uint16_t)capability);
}
+static void init_request(struct ks_wlan_private *priv, struct hostif_request_t *req)
+{
+ req->phy_type = cpu_to_le16((uint16_t)(priv->reg.phy_type));
+ req->cts_mode = cpu_to_le16((uint16_t)(priv->reg.cts_mode));
+ req->scan_type = cpu_to_le16((uint16_t)(priv->reg.scan_type));
+ req->rate_set.size = priv->reg.rate_set.size;
+ req->capability = ks_wlan_cap(priv);
+ memcpy(&req->rate_set.body[0], &priv->reg.rate_set.body[0],
+ priv->reg.rate_set.size);
+}
+
static
void hostif_ps_adhoc_set_request(struct ks_wlan_private *priv)
{
if (!pp)
return;
- pp->phy_type = cpu_to_le16((uint16_t)(priv->reg.phy_type));
- pp->cts_mode = cpu_to_le16((uint16_t)(priv->reg.cts_mode));
- pp->scan_type = cpu_to_le16((uint16_t)(priv->reg.scan_type));
+ init_request(priv, &pp->request);
pp->channel = cpu_to_le16((uint16_t)(priv->reg.channel));
- pp->rate_set.size = priv->reg.rate_set.size;
- pp->capability = ks_wlan_cap(priv);
- memcpy(&pp->rate_set.body[0], &priv->reg.rate_set.body[0],
- priv->reg.rate_set.size);
/* send to device request */
ps_confirm_wait_inc(priv);
if (!pp)
return;
- pp->phy_type = cpu_to_le16((uint16_t)(priv->reg.phy_type));
- pp->cts_mode = cpu_to_le16((uint16_t)(priv->reg.cts_mode));
- pp->scan_type = cpu_to_le16((uint16_t)(priv->reg.scan_type));
-
- pp->rate_set.size = priv->reg.rate_set.size;
- memcpy(&pp->rate_set.body[0], &priv->reg.rate_set.body[0],
- priv->reg.rate_set.size);
+ init_request(priv, &pp->request);
pp->ssid.size = priv->reg.ssid.size;
memcpy(&pp->ssid.body[0], &priv->reg.ssid.body[0], priv->reg.ssid.size);
- pp->capability = ks_wlan_cap(priv);
pp->beacon_lost_count =
cpu_to_le16((uint16_t)(priv->reg.beacon_lost_count));
pp->auth_type = cpu_to_le16((uint16_t)(priv->reg.authenticate_type));
if (!pp)
return;
- pp->phy_type = cpu_to_le16((uint16_t)(priv->reg.phy_type));
- pp->cts_mode = cpu_to_le16((uint16_t)(priv->reg.cts_mode));
- pp->scan_type = cpu_to_le16((uint16_t)(priv->reg.scan_type));
-
- pp->rate_set.size = priv->reg.rate_set.size;
- memcpy(&pp->rate_set.body[0], &priv->reg.rate_set.body[0],
- priv->reg.rate_set.size);
+ init_request(priv, &pp->request);
pp->ssid.size = priv->reg.ssid.size;
memcpy(&pp->ssid.body[0], &priv->reg.ssid.body[0], priv->reg.ssid.size);
- pp->capability = ks_wlan_cap(priv);
pp->beacon_lost_count =
cpu_to_le16((uint16_t)(priv->reg.beacon_lost_count));
pp->auth_type = cpu_to_le16((uint16_t)(priv->reg.authenticate_type));
if (!pp)
return;
- pp->phy_type = cpu_to_le16((uint16_t)(priv->reg.phy_type));
- pp->cts_mode = cpu_to_le16((uint16_t)(priv->reg.cts_mode));
- pp->scan_type = cpu_to_le16((uint16_t)(priv->reg.scan_type));
+ init_request(priv, &pp->request);
pp->channel = cpu_to_le16((uint16_t)(priv->reg.channel));
- pp->rate_set.size = priv->reg.rate_set.size;
- memcpy(&pp->rate_set.body[0], &priv->reg.rate_set.body[0],
- priv->reg.rate_set.size);
pp->ssid.size = priv->reg.ssid.size;
memcpy(&pp->ssid.body[0], &priv->reg.ssid.body[0], priv->reg.ssid.size);
- pp->capability = ks_wlan_cap(priv);
/* send to device request */
ps_confirm_wait_inc(priv);
if (!pp)
return;
- pp->phy_type = cpu_to_le16((uint16_t)(priv->reg.phy_type));
- pp->cts_mode = cpu_to_le16((uint16_t)(priv->reg.cts_mode));
- pp->scan_type = cpu_to_le16((uint16_t)(priv->reg.scan_type));
- pp->rate_set.size = priv->reg.rate_set.size;
- memcpy(&pp->rate_set.body[0], &priv->reg.rate_set.body[0],
- priv->reg.rate_set.size);
+ init_request(priv, &pp->request);
pp->ssid.size = priv->reg.ssid.size;
memcpy(&pp->ssid.body[0], &priv->reg.ssid.body[0], priv->reg.ssid.size);
- pp->capability = ks_wlan_cap(priv);
pp->channel_list.body[0] = priv->reg.channel;
pp->channel_list.size = 1;
__le16 result_code;
} __packed;
+#define D_11B_ONLY_MODE 0
+#define D_11G_ONLY_MODE 1
+#define D_11BG_COMPATIBLE_MODE 2
+#define D_11A_ONLY_MODE 3
+
+#define CTS_MODE_FALSE 0
+#define CTS_MODE_TRUE 1
+
+struct hostif_request_t {
+ __le16 phy_type;
+ __le16 cts_mode;
+ __le16 scan_type;
+ __le16 capability;
+ struct rate_set16_t rate_set;
+} __packed;
+
/**
* struct hostif_ps_adhoc_set_request_t - pseudo adhoc mode
* @capability: bit5 : preamble
*/
struct hostif_ps_adhoc_set_request_t {
struct hostif_hdr header;
- __le16 phy_type;
-#define D_11B_ONLY_MODE 0
-#define D_11G_ONLY_MODE 1
-#define D_11BG_COMPATIBLE_MODE 2
-#define D_11A_ONLY_MODE 3
- __le16 cts_mode;
-#define CTS_MODE_FALSE 0
-#define CTS_MODE_TRUE 1
+ struct hostif_request_t request;
__le16 channel;
- struct rate_set16_t rate_set;
- __le16 capability;
- __le16 scan_type;
} __packed;
struct hostif_ps_adhoc_set_confirm_t {
*/
struct hostif_infrastructure_set_request_t {
struct hostif_hdr header;
- __le16 phy_type;
- __le16 cts_mode;
- struct rate_set16_t rate_set;
+ struct hostif_request_t request;
struct ssid_t ssid;
- __le16 capability;
__le16 beacon_lost_count;
__le16 auth_type;
#define AUTH_TYPE_OPEN_SYSTEM 0
#define AUTH_TYPE_SHARED_KEY 1
struct channel_list_t channel_list;
- __le16 scan_type;
} __packed;
/**
*/
struct hostif_infrastructure_set2_request_t {
struct hostif_hdr header;
- __le16 phy_type;
- __le16 cts_mode;
- struct rate_set16_t rate_set;
+ struct hostif_request_t request;
struct ssid_t ssid;
- __le16 capability;
__le16 beacon_lost_count;
__le16 auth_type;
#define AUTH_TYPE_OPEN_SYSTEM 0
#define AUTH_TYPE_SHARED_KEY 1
struct channel_list_t channel_list;
- __le16 scan_type;
u8 bssid[ETH_ALEN];
} __packed;
*/
struct hostif_adhoc_set_request_t {
struct hostif_hdr header;
- __le16 phy_type;
- __le16 cts_mode;
- __le16 channel;
- struct rate_set16_t rate_set;
+ struct hostif_request_t request;
struct ssid_t ssid;
- __le16 capability;
- __le16 scan_type;
+ __le16 channel;
} __packed;
/**
*/
struct hostif_adhoc_set2_request_t {
struct hostif_hdr header;
- __le16 phy_type;
- __le16 cts_mode;
+ struct hostif_request_t request;
__le16 reserved;
- struct rate_set16_t rate_set;
struct ssid_t ssid;
- __le16 capability;
- __le16 scan_type;
struct channel_list_t channel_list;
u8 bssid[ETH_ALEN];
} __packed;