int infra_mode;
bool connected;
u8 bssid[ETH_ALEN];
- __le32 current_command_oid;
+ u32 current_command_oid;
/* encryption stuff */
u8 encr_tx_key_index;
}
#ifdef DEBUG
-static const char *oid_to_string(__le32 oid)
+static const char *oid_to_string(u32 oid)
{
- switch (le32_to_cpu(oid)) {
+ switch (oid) {
#define OID_STR(oid) case oid: return(#oid)
/* from rndis_host.h */
OID_STR(RNDIS_OID_802_3_PERMANENT_ADDRESS);
return "?";
}
#else
-static const char *oid_to_string(__le32 oid)
+static const char *oid_to_string(u32 oid)
{
return "?";
}
return ret;
}
-static int rndis_query_oid(struct usbnet *dev, __le32 oid, void *data, int *len)
+static int rndis_query_oid(struct usbnet *dev, u32 oid, void *data, int *len)
{
struct rndis_wlan_private *priv = get_rndis_wlan_priv(dev);
union {
memset(u.get, 0, sizeof *u.get);
u.get->msg_type = cpu_to_le32(RNDIS_MSG_QUERY);
u.get->msg_len = cpu_to_le32(sizeof *u.get);
- u.get->oid = oid;
+ u.get->oid = cpu_to_le32(oid);
priv->current_command_oid = oid;
ret = rndis_command(dev, u.header, buflen);
return ret;
}
-static int rndis_set_oid(struct usbnet *dev, __le32 oid, const void *data,
+static int rndis_set_oid(struct usbnet *dev, u32 oid, const void *data,
int len)
{
struct rndis_wlan_private *priv = get_rndis_wlan_priv(dev);
memset(u.set, 0, sizeof *u.set);
u.set->msg_type = cpu_to_le32(RNDIS_MSG_SET);
u.set->msg_len = cpu_to_le32(sizeof(*u.set) + len);
- u.set->oid = oid;
+ u.set->oid = cpu_to_le32(oid);
u.set->len = cpu_to_le32(len);
u.set->offset = cpu_to_le32(sizeof(*u.set) - 8);
u.set->handle = cpu_to_le32(0);
}
#endif
- ret = rndis_set_oid(dev, cpu_to_le32(RNDIS_OID_GEN_RNDIS_CONFIG_PARAMETER),
+ ret = rndis_set_oid(dev, RNDIS_OID_GEN_RNDIS_CONFIG_PARAMETER,
infobuf, info_len);
if (ret != 0)
netdev_dbg(dev->net, "setting rndis config parameter failed, %d\n",
/* Note: RNDIS_OID_802_11_BSSID_LIST_SCAN clears internal BSS list. */
tmp = cpu_to_le32(1);
- return rndis_set_oid(usbdev, cpu_to_le32(RNDIS_OID_802_11_BSSID_LIST_SCAN), &tmp,
+ return rndis_set_oid(usbdev, RNDIS_OID_802_11_BSSID_LIST_SCAN, &tmp,
sizeof(tmp));
}
struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev);
int ret;
- ret = rndis_set_oid(usbdev, cpu_to_le32(RNDIS_OID_802_11_SSID),
+ ret = rndis_set_oid(usbdev, RNDIS_OID_802_11_SSID,
ssid, sizeof(*ssid));
if (ret < 0) {
netdev_warn(usbdev->net, "setting SSID failed (%08X)\n", ret);
{
int ret;
- ret = rndis_set_oid(usbdev, cpu_to_le32(RNDIS_OID_802_11_BSSID),
+ ret = rndis_set_oid(usbdev, RNDIS_OID_802_11_BSSID,
bssid, ETH_ALEN);
if (ret < 0) {
netdev_warn(usbdev->net, "setting BSSID[%pM] failed (%08X)\n",
int ret, len;
len = ETH_ALEN;
- ret = rndis_query_oid(usbdev, cpu_to_le32(RNDIS_OID_802_11_BSSID),
+ ret = rndis_query_oid(usbdev, RNDIS_OID_802_11_BSSID,
bssid, &len);
if (ret != 0)
struct ndis_80211_assoc_info *info, int len)
{
return rndis_query_oid(usbdev,
- cpu_to_le32(RNDIS_OID_802_11_ASSOCIATION_INFORMATION),
+ RNDIS_OID_802_11_ASSOCIATION_INFORMATION,
info, &len);
}
if (priv->radio_on) {
ret = rndis_set_oid(usbdev,
- cpu_to_le32(RNDIS_OID_802_11_DISASSOCIATE),
+ RNDIS_OID_802_11_DISASSOCIATE,
NULL, 0);
if (ret == 0) {
priv->radio_on = false;
tmp = cpu_to_le32(auth_mode);
ret = rndis_set_oid(usbdev,
- cpu_to_le32(RNDIS_OID_802_11_AUTHENTICATION_MODE),
+ RNDIS_OID_802_11_AUTHENTICATION_MODE,
&tmp, sizeof(tmp));
if (ret != 0) {
netdev_warn(usbdev->net, "setting auth mode failed (%08X)\n",
tmp = cpu_to_le32(NDIS_80211_PRIV_ACCEPT_ALL);
return rndis_set_oid(usbdev,
- cpu_to_le32(RNDIS_OID_802_11_PRIVACY_FILTER), &tmp,
+ RNDIS_OID_802_11_PRIVACY_FILTER, &tmp,
sizeof(tmp));
}
tmp = cpu_to_le32(encr_mode);
ret = rndis_set_oid(usbdev,
- cpu_to_le32(RNDIS_OID_802_11_ENCRYPTION_STATUS), &tmp,
+ RNDIS_OID_802_11_ENCRYPTION_STATUS, &tmp,
sizeof(tmp));
if (ret != 0) {
netdev_warn(usbdev->net, "setting encr mode failed (%08X)\n",
tmp = cpu_to_le32(mode);
ret = rndis_set_oid(usbdev,
- cpu_to_le32(RNDIS_OID_802_11_INFRASTRUCTURE_MODE),
+ RNDIS_OID_802_11_INFRASTRUCTURE_MODE,
&tmp, sizeof(tmp));
if (ret != 0) {
netdev_warn(usbdev->net, "setting infra mode failed (%08X)\n",
tmp = cpu_to_le32(rts_threshold);
return rndis_set_oid(usbdev,
- cpu_to_le32(RNDIS_OID_802_11_RTS_THRESHOLD),
+ RNDIS_OID_802_11_RTS_THRESHOLD,
&tmp, sizeof(tmp));
}
tmp = cpu_to_le32(frag_threshold);
return rndis_set_oid(usbdev,
- cpu_to_le32(RNDIS_OID_802_11_FRAGMENTATION_THRESHOLD),
+ RNDIS_OID_802_11_FRAGMENTATION_THRESHOLD,
&tmp, sizeof(tmp));
}
len = sizeof(config);
ret = rndis_query_oid(usbdev,
- cpu_to_le32(RNDIS_OID_802_11_CONFIGURATION),
+ RNDIS_OID_802_11_CONFIGURATION,
&config, &len);
if (ret < 0) {
netdev_dbg(usbdev->net, "%s(): querying configuration failed\n",
config.ds_config = cpu_to_le32(dsconfig);
ret = rndis_set_oid(usbdev,
- cpu_to_le32(RNDIS_OID_802_11_CONFIGURATION),
+ RNDIS_OID_802_11_CONFIGURATION,
&config, sizeof(config));
netdev_dbg(usbdev->net, "%s(): %d -> %d\n", __func__, channel, ret);
/* Get channel and beacon interval */
len = sizeof(config);
ret = rndis_query_oid(usbdev,
- cpu_to_le32(RNDIS_OID_802_11_CONFIGURATION),
+ RNDIS_OID_802_11_CONFIGURATION,
&config, &len);
netdev_dbg(usbdev->net, "%s(): RNDIS_OID_802_11_CONFIGURATION -> %d\n",
__func__, ret);
}
ret = rndis_set_oid(usbdev,
- cpu_to_le32(RNDIS_OID_802_11_ADD_WEP), &ndis_key,
+ RNDIS_OID_802_11_ADD_WEP, &ndis_key,
sizeof(ndis_key));
if (ret != 0) {
netdev_warn(usbdev->net, "adding encryption key %d failed (%08X)\n",
}
ret = rndis_set_oid(usbdev,
- cpu_to_le32(RNDIS_OID_802_11_ADD_KEY), &ndis_key,
+ RNDIS_OID_802_11_ADD_KEY, &ndis_key,
le32_to_cpu(ndis_key.size));
netdev_dbg(usbdev->net, "%s(): RNDIS_OID_802_11_ADD_KEY -> %08X\n",
__func__, ret);
sizeof(remove_key.bssid));
ret = rndis_set_oid(usbdev,
- cpu_to_le32(RNDIS_OID_802_11_REMOVE_KEY),
+ RNDIS_OID_802_11_REMOVE_KEY,
&remove_key, sizeof(remove_key));
if (ret != 0)
return ret;
} else {
keyindex = cpu_to_le32(index);
ret = rndis_set_oid(usbdev,
- cpu_to_le32(RNDIS_OID_802_11_REMOVE_WEP),
+ RNDIS_OID_802_11_REMOVE_WEP,
&keyindex, sizeof(keyindex));
if (ret != 0) {
netdev_warn(usbdev->net,
if (mc_count) {
ret = rndis_set_oid(usbdev,
- cpu_to_le32(RNDIS_OID_802_3_MULTICAST_LIST),
+ RNDIS_OID_802_3_MULTICAST_LIST,
mc_addrs, mc_count * ETH_ALEN);
kfree(mc_addrs);
if (ret == 0)
}
set_filter:
- ret = rndis_set_oid(usbdev, cpu_to_le32(RNDIS_OID_GEN_CURRENT_PACKET_FILTER), &filter,
+ ret = rndis_set_oid(usbdev, RNDIS_OID_GEN_CURRENT_PACKET_FILTER, &filter,
sizeof(filter));
if (ret < 0) {
netdev_warn(usbdev->net, "couldn't set packet filter: %08x\n",
pmkids->length = cpu_to_le32(len);
pmkids->bssid_info_count = cpu_to_le32(max_pmkids);
- ret = rndis_query_oid(usbdev, cpu_to_le32(RNDIS_OID_802_11_PMKID),
+ ret = rndis_query_oid(usbdev, RNDIS_OID_802_11_PMKID,
pmkids, &len);
if (ret < 0) {
netdev_dbg(usbdev->net, "%s(): RNDIS_OID_802_11_PMKID(%d, %d)"
debug_print_pmkids(usbdev, pmkids, __func__);
- ret = rndis_set_oid(usbdev, cpu_to_le32(RNDIS_OID_802_11_PMKID), pmkids,
+ ret = rndis_set_oid(usbdev, RNDIS_OID_802_11_PMKID, pmkids,
le32_to_cpu(pmkids->length));
if (ret < 0) {
netdev_dbg(usbdev->net, "%s(): RNDIS_OID_802_11_PMKID(%d, %d) -> %d"
* resizing until it won't get any bigger.
*/
new_len = len;
- ret = rndis_query_oid(usbdev, cpu_to_le32(RNDIS_OID_802_11_BSSID_LIST),
+ ret = rndis_query_oid(usbdev, RNDIS_OID_802_11_BSSID_LIST,
buf, &new_len);
if (ret != 0 || new_len < sizeof(struct ndis_80211_bssid_list_ex))
goto out;
memset(sinfo, 0, sizeof(*sinfo));
len = sizeof(linkspeed);
- ret = rndis_query_oid(usbdev, cpu_to_le32(RNDIS_OID_GEN_LINK_SPEED), &linkspeed, &len);
+ ret = rndis_query_oid(usbdev, RNDIS_OID_GEN_LINK_SPEED, &linkspeed, &len);
if (ret == 0) {
sinfo->txrate.legacy = le32_to_cpu(linkspeed) / 1000;
sinfo->filled |= STATION_INFO_TX_BITRATE;
}
len = sizeof(rssi);
- ret = rndis_query_oid(usbdev, cpu_to_le32(RNDIS_OID_802_11_RSSI),
+ ret = rndis_query_oid(usbdev, RNDIS_OID_802_11_RSSI,
&rssi, &len);
if (ret == 0) {
sinfo->signal = level_to_qual(le32_to_cpu(rssi));
pmkid.length = cpu_to_le32(sizeof(pmkid));
pmkid.bssid_info_count = cpu_to_le32(0);
- return rndis_set_oid(usbdev, cpu_to_le32(RNDIS_OID_802_11_PMKID),
+ return rndis_set_oid(usbdev, RNDIS_OID_802_11_PMKID,
&pmkid, sizeof(pmkid));
}
priv->power_mode = power_mode;
mode = cpu_to_le32(power_mode);
- ret = rndis_set_oid(usbdev, cpu_to_le32(RNDIS_OID_802_11_POWER_MODE),
+ ret = rndis_set_oid(usbdev, RNDIS_OID_802_11_POWER_MODE,
&mode, sizeof(mode));
netdev_dbg(usbdev->net, "%s(): RNDIS_OID_802_11_POWER_MODE -> %d\n",
/* Get signal quality, in case of error use rssi=0 and ignore error. */
len = sizeof(rssi);
rssi = 0;
- ret = rndis_query_oid(usbdev, cpu_to_le32(RNDIS_OID_802_11_RSSI),
+ ret = rndis_query_oid(usbdev, RNDIS_OID_802_11_RSSI,
&rssi, &len);
signal = level_to_qual(le32_to_cpu(rssi));
/* Get SSID, in case of error, use zero length SSID and ignore error. */
len = sizeof(ssid);
memset(&ssid, 0, sizeof(ssid));
- ret = rndis_query_oid(usbdev, cpu_to_le32(RNDIS_OID_802_11_SSID),
+ ret = rndis_query_oid(usbdev, RNDIS_OID_802_11_SSID,
&ssid, &len);
netdev_dbg(usbdev->net, "%s(): RNDIS_OID_802_11_SSID -> %d, len: %d, ssid: "
"'%.32s'\n", __func__, ret,
switch (le32_to_cpu(msg->status)) {
case RNDIS_STATUS_MEDIA_CONNECT:
- if (priv->current_command_oid == cpu_to_le32(RNDIS_OID_802_11_ADD_KEY)) {
- /* OID_802_11_ADD_KEY causes sometimes extra
+ if (priv->current_command_oid == RNDIS_OID_802_11_ADD_KEY) {
+ /* RNDIS_OID_802_11_ADD_KEY causes sometimes extra
* "media connect" indications which confuses driver
* and userspace to think that device is
* roaming/reassociating when it isn't.
/* determine supported modes */
len = sizeof(networks_supported);
retval = rndis_query_oid(usbdev,
- cpu_to_le32(RNDIS_OID_802_11_NETWORK_TYPES_SUPPORTED),
+ RNDIS_OID_802_11_NETWORK_TYPES_SUPPORTED,
&networks_supported, &len);
if (retval >= 0) {
n = le32_to_cpu(networks_supported.num_items);
caps = (struct ndis_80211_capability *)caps_buf;
len = sizeof(caps_buf);
retval = rndis_query_oid(usbdev,
- cpu_to_le32(RNDIS_OID_802_11_CAPABILITY),
+ RNDIS_OID_802_11_CAPABILITY,
caps, &len);
if (retval >= 0) {
netdev_dbg(usbdev->net, "RNDIS_OID_802_11_CAPABILITY -> len %d, "
}
len = sizeof(rssi);
- ret = rndis_query_oid(usbdev, cpu_to_le32(RNDIS_OID_802_11_RSSI),
+ ret = rndis_query_oid(usbdev, RNDIS_OID_802_11_RSSI,
&rssi, &len);
if (ret == 0) {
priv->last_qual = level_to_qual(le32_to_cpu(rssi));
*/
tmp = cpu_to_le32(1);
rndis_set_oid(usbdev,
- cpu_to_le32(RNDIS_OID_802_11_BSSID_LIST_SCAN),
+ RNDIS_OID_802_11_BSSID_LIST_SCAN,
&tmp, sizeof(tmp));
len = CONTROL_BUFFER_SIZE;
goto end;
rndis_query_oid(usbdev,
- cpu_to_le32(RNDIS_OID_802_11_BSSID_LIST),
+ RNDIS_OID_802_11_BSSID_LIST,
buf, &len);
kfree(buf);
}
tmp = cpu_to_le32(RNDIS_PACKET_TYPE_DIRECTED | RNDIS_PACKET_TYPE_BROADCAST);
retval = rndis_set_oid(usbdev,
- cpu_to_le32(RNDIS_OID_GEN_CURRENT_PACKET_FILTER),
+ RNDIS_OID_GEN_CURRENT_PACKET_FILTER,
&tmp, sizeof(tmp));
len = sizeof(tmp);
retval = rndis_query_oid(usbdev,
- cpu_to_le32(RNDIS_OID_802_3_MAXIMUM_LIST_SIZE),
+ RNDIS_OID_802_3_MAXIMUM_LIST_SIZE,
&tmp, &len);
priv->multicast_size = le32_to_cpu(tmp);
if (retval < 0 || priv->multicast_size < 0)
/* Set current packet filter zero to block receiving data packets from
device. */
filter = 0;
- rndis_set_oid(usbdev, cpu_to_le32(RNDIS_OID_GEN_CURRENT_PACKET_FILTER), &filter,
+ rndis_set_oid(usbdev, RNDIS_OID_GEN_CURRENT_PACKET_FILTER, &filter,
sizeof(filter));
return retval;