diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-21 00:04:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-21 00:04:44 -0400 |
commit | f8965467f366fd18f01feafb5db10512d7b4422c (patch) | |
tree | 3706a9cd779859271ca61b85c63a1bc3f82d626e /drivers/net/wireless/ray_cs.c | |
parent | a26272e5200765691e67d6780e52b32498fdb659 (diff) | |
parent | 2ec8c6bb5d8f3a62a79f463525054bae1e3d4487 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1674 commits)
qlcnic: adding co maintainer
ixgbe: add support for active DA cables
ixgbe: dcb, do not tag tc_prio_control frames
ixgbe: fix ixgbe_tx_is_paused logic
ixgbe: always enable vlan strip/insert when DCB is enabled
ixgbe: remove some redundant code in setting FCoE FIP filter
ixgbe: fix wrong offset to fc_frame_header in ixgbe_fcoe_ddp
ixgbe: fix header len when unsplit packet overflows to data buffer
ipv6: Never schedule DAD timer on dead address
ipv6: Use POSTDAD state
ipv6: Use state_lock to protect ifa state
ipv6: Replace inet6_ifaddr->dead with state
cxgb4: notify upper drivers if the device is already up when they load
cxgb4: keep interrupts available when the ports are brought down
cxgb4: fix initial addition of MAC address
cnic: Return SPQ credit to bnx2x after ring setup and shutdown.
cnic: Convert cnic_local_flags to atomic ops.
can: Fix SJA1000 command register writes on SMP systems
bridge: fix build for CONFIG_SYSFS disabled
ARCNET: Limit com20020 PCI ID matches for SOHARD cards
...
Fix up various conflicts with pcmcia tree drivers/net/
{pcmcia/3c589_cs.c, wireless/orinoco/orinoco_cs.c and
wireless/orinoco/spectrum_cs.c} and feature removal
(Documentation/feature-removal-schedule.txt).
Also fix a non-content conflict due to pm_qos_requirement getting
renamed in the PM tree (now pm_qos_request) in net/mac80211/scan.c
Diffstat (limited to 'drivers/net/wireless/ray_cs.c')
-rw-r--r-- | drivers/net/wireless/ray_cs.c | 242 |
1 files changed, 109 insertions, 133 deletions
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c index f7d2a34ca53..abff8934db1 100644 --- a/drivers/net/wireless/ray_cs.c +++ b/drivers/net/wireless/ray_cs.c | |||
@@ -546,7 +546,7 @@ static int ray_init(struct net_device *dev) | |||
546 | local->fw_ver = local->startup_res.firmware_version[0]; | 546 | local->fw_ver = local->startup_res.firmware_version[0]; |
547 | local->fw_bld = local->startup_res.firmware_version[1]; | 547 | local->fw_bld = local->startup_res.firmware_version[1]; |
548 | local->fw_var = local->startup_res.firmware_version[2]; | 548 | local->fw_var = local->startup_res.firmware_version[2]; |
549 | dev_dbg(&link->dev, "ray_init firmware version %d.%d \n", local->fw_ver, | 549 | dev_dbg(&link->dev, "ray_init firmware version %d.%d\n", local->fw_ver, |
550 | local->fw_bld); | 550 | local->fw_bld); |
551 | 551 | ||
552 | local->tib_length = 0x20; | 552 | local->tib_length = 0x20; |
@@ -726,8 +726,6 @@ static void verify_dl_startup(u_long data) | |||
726 | start_net((u_long) local); | 726 | start_net((u_long) local); |
727 | else | 727 | else |
728 | join_net((u_long) local); | 728 | join_net((u_long) local); |
729 | |||
730 | return; | ||
731 | } /* end verify_dl_startup */ | 729 | } /* end verify_dl_startup */ |
732 | 730 | ||
733 | /*===========================================================================*/ | 731 | /*===========================================================================*/ |
@@ -755,7 +753,6 @@ static void start_net(u_long data) | |||
755 | return; | 753 | return; |
756 | } | 754 | } |
757 | local->card_status = CARD_DOING_ACQ; | 755 | local->card_status = CARD_DOING_ACQ; |
758 | return; | ||
759 | } /* end start_net */ | 756 | } /* end start_net */ |
760 | 757 | ||
761 | /*===========================================================================*/ | 758 | /*===========================================================================*/ |
@@ -786,7 +783,6 @@ static void join_net(u_long data) | |||
786 | return; | 783 | return; |
787 | } | 784 | } |
788 | local->card_status = CARD_DOING_ACQ; | 785 | local->card_status = CARD_DOING_ACQ; |
789 | return; | ||
790 | } | 786 | } |
791 | 787 | ||
792 | /*============================================================================ | 788 | /*============================================================================ |
@@ -932,7 +928,6 @@ static netdev_tx_t ray_dev_start_xmit(struct sk_buff *skb, | |||
932 | case XMIT_MSG_BAD: | 928 | case XMIT_MSG_BAD: |
933 | case XMIT_OK: | 929 | case XMIT_OK: |
934 | default: | 930 | default: |
935 | dev->trans_start = jiffies; | ||
936 | dev_kfree_skb(skb); | 931 | dev_kfree_skb(skb); |
937 | } | 932 | } |
938 | 933 | ||
@@ -1103,10 +1098,10 @@ static const struct ethtool_ops netdev_ethtool_ops = { | |||
1103 | /* | 1098 | /* |
1104 | * Wireless Handler : get protocol name | 1099 | * Wireless Handler : get protocol name |
1105 | */ | 1100 | */ |
1106 | static int ray_get_name(struct net_device *dev, | 1101 | static int ray_get_name(struct net_device *dev, struct iw_request_info *info, |
1107 | struct iw_request_info *info, char *cwrq, char *extra) | 1102 | union iwreq_data *wrqu, char *extra) |
1108 | { | 1103 | { |
1109 | strcpy(cwrq, "IEEE 802.11-FH"); | 1104 | strcpy(wrqu->name, "IEEE 802.11-FH"); |
1110 | return 0; | 1105 | return 0; |
1111 | } | 1106 | } |
1112 | 1107 | ||
@@ -1114,9 +1109,8 @@ static int ray_get_name(struct net_device *dev, | |||
1114 | /* | 1109 | /* |
1115 | * Wireless Handler : set frequency | 1110 | * Wireless Handler : set frequency |
1116 | */ | 1111 | */ |
1117 | static int ray_set_freq(struct net_device *dev, | 1112 | static int ray_set_freq(struct net_device *dev, struct iw_request_info *info, |
1118 | struct iw_request_info *info, | 1113 | union iwreq_data *wrqu, char *extra) |
1119 | struct iw_freq *fwrq, char *extra) | ||
1120 | { | 1114 | { |
1121 | ray_dev_t *local = netdev_priv(dev); | 1115 | ray_dev_t *local = netdev_priv(dev); |
1122 | int err = -EINPROGRESS; /* Call commit handler */ | 1116 | int err = -EINPROGRESS; /* Call commit handler */ |
@@ -1126,10 +1120,10 @@ static int ray_set_freq(struct net_device *dev, | |||
1126 | return -EBUSY; | 1120 | return -EBUSY; |
1127 | 1121 | ||
1128 | /* Setting by channel number */ | 1122 | /* Setting by channel number */ |
1129 | if ((fwrq->m > USA_HOP_MOD) || (fwrq->e > 0)) | 1123 | if ((wrqu->freq.m > USA_HOP_MOD) || (wrqu->freq.e > 0)) |
1130 | err = -EOPNOTSUPP; | 1124 | err = -EOPNOTSUPP; |
1131 | else | 1125 | else |
1132 | local->sparm.b5.a_hop_pattern = fwrq->m; | 1126 | local->sparm.b5.a_hop_pattern = wrqu->freq.m; |
1133 | 1127 | ||
1134 | return err; | 1128 | return err; |
1135 | } | 1129 | } |
@@ -1138,14 +1132,13 @@ static int ray_set_freq(struct net_device *dev, | |||
1138 | /* | 1132 | /* |
1139 | * Wireless Handler : get frequency | 1133 | * Wireless Handler : get frequency |
1140 | */ | 1134 | */ |
1141 | static int ray_get_freq(struct net_device *dev, | 1135 | static int ray_get_freq(struct net_device *dev, struct iw_request_info *info, |
1142 | struct iw_request_info *info, | 1136 | union iwreq_data *wrqu, char *extra) |
1143 | struct iw_freq *fwrq, char *extra) | ||
1144 | { | 1137 | { |
1145 | ray_dev_t *local = netdev_priv(dev); | 1138 | ray_dev_t *local = netdev_priv(dev); |
1146 | 1139 | ||
1147 | fwrq->m = local->sparm.b5.a_hop_pattern; | 1140 | wrqu->freq.m = local->sparm.b5.a_hop_pattern; |
1148 | fwrq->e = 0; | 1141 | wrqu->freq.e = 0; |
1149 | return 0; | 1142 | return 0; |
1150 | } | 1143 | } |
1151 | 1144 | ||
@@ -1153,9 +1146,8 @@ static int ray_get_freq(struct net_device *dev, | |||
1153 | /* | 1146 | /* |
1154 | * Wireless Handler : set ESSID | 1147 | * Wireless Handler : set ESSID |
1155 | */ | 1148 | */ |
1156 | static int ray_set_essid(struct net_device *dev, | 1149 | static int ray_set_essid(struct net_device *dev, struct iw_request_info *info, |
1157 | struct iw_request_info *info, | 1150 | union iwreq_data *wrqu, char *extra) |
1158 | struct iw_point *dwrq, char *extra) | ||
1159 | { | 1151 | { |
1160 | ray_dev_t *local = netdev_priv(dev); | 1152 | ray_dev_t *local = netdev_priv(dev); |
1161 | 1153 | ||
@@ -1164,19 +1156,17 @@ static int ray_set_essid(struct net_device *dev, | |||
1164 | return -EBUSY; | 1156 | return -EBUSY; |
1165 | 1157 | ||
1166 | /* Check if we asked for `any' */ | 1158 | /* Check if we asked for `any' */ |
1167 | if (dwrq->flags == 0) { | 1159 | if (wrqu->essid.flags == 0) |
1168 | /* Corey : can you do that ? */ | 1160 | /* Corey : can you do that ? */ |
1169 | return -EOPNOTSUPP; | 1161 | return -EOPNOTSUPP; |
1170 | } else { | ||
1171 | /* Check the size of the string */ | ||
1172 | if (dwrq->length > IW_ESSID_MAX_SIZE) { | ||
1173 | return -E2BIG; | ||
1174 | } | ||
1175 | 1162 | ||
1176 | /* Set the ESSID in the card */ | 1163 | /* Check the size of the string */ |
1177 | memset(local->sparm.b5.a_current_ess_id, 0, IW_ESSID_MAX_SIZE); | 1164 | if (wrqu->essid.length > IW_ESSID_MAX_SIZE) |
1178 | memcpy(local->sparm.b5.a_current_ess_id, extra, dwrq->length); | 1165 | return -E2BIG; |
1179 | } | 1166 | |
1167 | /* Set the ESSID in the card */ | ||
1168 | memset(local->sparm.b5.a_current_ess_id, 0, IW_ESSID_MAX_SIZE); | ||
1169 | memcpy(local->sparm.b5.a_current_ess_id, extra, wrqu->essid.length); | ||
1180 | 1170 | ||
1181 | return -EINPROGRESS; /* Call commit handler */ | 1171 | return -EINPROGRESS; /* Call commit handler */ |
1182 | } | 1172 | } |
@@ -1185,9 +1175,8 @@ static int ray_set_essid(struct net_device *dev, | |||
1185 | /* | 1175 | /* |
1186 | * Wireless Handler : get ESSID | 1176 | * Wireless Handler : get ESSID |
1187 | */ | 1177 | */ |
1188 | static int ray_get_essid(struct net_device *dev, | 1178 | static int ray_get_essid(struct net_device *dev, struct iw_request_info *info, |
1189 | struct iw_request_info *info, | 1179 | union iwreq_data *wrqu, char *extra) |
1190 | struct iw_point *dwrq, char *extra) | ||
1191 | { | 1180 | { |
1192 | ray_dev_t *local = netdev_priv(dev); | 1181 | ray_dev_t *local = netdev_priv(dev); |
1193 | 1182 | ||
@@ -1195,8 +1184,8 @@ static int ray_get_essid(struct net_device *dev, | |||
1195 | memcpy(extra, local->sparm.b5.a_current_ess_id, IW_ESSID_MAX_SIZE); | 1184 | memcpy(extra, local->sparm.b5.a_current_ess_id, IW_ESSID_MAX_SIZE); |
1196 | 1185 | ||
1197 | /* Push it out ! */ | 1186 | /* Push it out ! */ |
1198 | dwrq->length = strlen(extra); | 1187 | wrqu->essid.length = strlen(extra); |
1199 | dwrq->flags = 1; /* active */ | 1188 | wrqu->essid.flags = 1; /* active */ |
1200 | 1189 | ||
1201 | return 0; | 1190 | return 0; |
1202 | } | 1191 | } |
@@ -1205,14 +1194,13 @@ static int ray_get_essid(struct net_device *dev, | |||
1205 | /* | 1194 | /* |
1206 | * Wireless Handler : get AP address | 1195 | * Wireless Handler : get AP address |
1207 | */ | 1196 | */ |
1208 | static int ray_get_wap(struct net_device *dev, | 1197 | static int ray_get_wap(struct net_device *dev, struct iw_request_info *info, |
1209 | struct iw_request_info *info, | 1198 | union iwreq_data *wrqu, char *extra) |
1210 | struct sockaddr *awrq, char *extra) | ||
1211 | { | 1199 | { |
1212 | ray_dev_t *local = netdev_priv(dev); | 1200 | ray_dev_t *local = netdev_priv(dev); |
1213 | 1201 | ||
1214 | memcpy(awrq->sa_data, local->bss_id, ETH_ALEN); | 1202 | memcpy(wrqu->ap_addr.sa_data, local->bss_id, ETH_ALEN); |
1215 | awrq->sa_family = ARPHRD_ETHER; | 1203 | wrqu->ap_addr.sa_family = ARPHRD_ETHER; |
1216 | 1204 | ||
1217 | return 0; | 1205 | return 0; |
1218 | } | 1206 | } |
@@ -1221,9 +1209,8 @@ static int ray_get_wap(struct net_device *dev, | |||
1221 | /* | 1209 | /* |
1222 | * Wireless Handler : set Bit-Rate | 1210 | * Wireless Handler : set Bit-Rate |
1223 | */ | 1211 | */ |
1224 | static int ray_set_rate(struct net_device *dev, | 1212 | static int ray_set_rate(struct net_device *dev, struct iw_request_info *info, |
1225 | struct iw_request_info *info, | 1213 | union iwreq_data *wrqu, char *extra) |
1226 | struct iw_param *vwrq, char *extra) | ||
1227 | { | 1214 | { |
1228 | ray_dev_t *local = netdev_priv(dev); | 1215 | ray_dev_t *local = netdev_priv(dev); |
1229 | 1216 | ||
@@ -1232,15 +1219,15 @@ static int ray_set_rate(struct net_device *dev, | |||
1232 | return -EBUSY; | 1219 | return -EBUSY; |
1233 | 1220 | ||
1234 | /* Check if rate is in range */ | 1221 | /* Check if rate is in range */ |
1235 | if ((vwrq->value != 1000000) && (vwrq->value != 2000000)) | 1222 | if ((wrqu->bitrate.value != 1000000) && (wrqu->bitrate.value != 2000000)) |
1236 | return -EINVAL; | 1223 | return -EINVAL; |
1237 | 1224 | ||
1238 | /* Hack for 1.5 Mb/s instead of 2 Mb/s */ | 1225 | /* Hack for 1.5 Mb/s instead of 2 Mb/s */ |
1239 | if ((local->fw_ver == 0x55) && /* Please check */ | 1226 | if ((local->fw_ver == 0x55) && /* Please check */ |
1240 | (vwrq->value == 2000000)) | 1227 | (wrqu->bitrate.value == 2000000)) |
1241 | local->net_default_tx_rate = 3; | 1228 | local->net_default_tx_rate = 3; |
1242 | else | 1229 | else |
1243 | local->net_default_tx_rate = vwrq->value / 500000; | 1230 | local->net_default_tx_rate = wrqu->bitrate.value / 500000; |
1244 | 1231 | ||
1245 | return 0; | 1232 | return 0; |
1246 | } | 1233 | } |
@@ -1249,17 +1236,16 @@ static int ray_set_rate(struct net_device *dev, | |||
1249 | /* | 1236 | /* |
1250 | * Wireless Handler : get Bit-Rate | 1237 | * Wireless Handler : get Bit-Rate |
1251 | */ | 1238 | */ |
1252 | static int ray_get_rate(struct net_device *dev, | 1239 | static int ray_get_rate(struct net_device *dev, struct iw_request_info *info, |
1253 | struct iw_request_info *info, | 1240 | union iwreq_data *wrqu, char *extra) |
1254 | struct iw_param *vwrq, char *extra) | ||
1255 | { | 1241 | { |
1256 | ray_dev_t *local = netdev_priv(dev); | 1242 | ray_dev_t *local = netdev_priv(dev); |
1257 | 1243 | ||
1258 | if (local->net_default_tx_rate == 3) | 1244 | if (local->net_default_tx_rate == 3) |
1259 | vwrq->value = 2000000; /* Hum... */ | 1245 | wrqu->bitrate.value = 2000000; /* Hum... */ |
1260 | else | 1246 | else |
1261 | vwrq->value = local->net_default_tx_rate * 500000; | 1247 | wrqu->bitrate.value = local->net_default_tx_rate * 500000; |
1262 | vwrq->fixed = 0; /* We are in auto mode */ | 1248 | wrqu->bitrate.fixed = 0; /* We are in auto mode */ |
1263 | 1249 | ||
1264 | return 0; | 1250 | return 0; |
1265 | } | 1251 | } |
@@ -1268,19 +1254,18 @@ static int ray_get_rate(struct net_device *dev, | |||
1268 | /* | 1254 | /* |
1269 | * Wireless Handler : set RTS threshold | 1255 | * Wireless Handler : set RTS threshold |
1270 | */ | 1256 | */ |
1271 | static int ray_set_rts(struct net_device *dev, | 1257 | static int ray_set_rts(struct net_device *dev, struct iw_request_info *info, |
1272 | struct iw_request_info *info, | 1258 | union iwreq_data *wrqu, char *extra) |
1273 | struct iw_param *vwrq, char *extra) | ||
1274 | { | 1259 | { |
1275 | ray_dev_t *local = netdev_priv(dev); | 1260 | ray_dev_t *local = netdev_priv(dev); |
1276 | int rthr = vwrq->value; | 1261 | int rthr = wrqu->rts.value; |
1277 | 1262 | ||
1278 | /* Reject if card is already initialised */ | 1263 | /* Reject if card is already initialised */ |
1279 | if (local->card_status != CARD_AWAITING_PARAM) | 1264 | if (local->card_status != CARD_AWAITING_PARAM) |
1280 | return -EBUSY; | 1265 | return -EBUSY; |
1281 | 1266 | ||
1282 | /* if(wrq->u.rts.fixed == 0) we should complain */ | 1267 | /* if(wrq->u.rts.fixed == 0) we should complain */ |
1283 | if (vwrq->disabled) | 1268 | if (wrqu->rts.disabled) |
1284 | rthr = 32767; | 1269 | rthr = 32767; |
1285 | else { | 1270 | else { |
1286 | if ((rthr < 0) || (rthr > 2347)) /* What's the max packet size ??? */ | 1271 | if ((rthr < 0) || (rthr > 2347)) /* What's the max packet size ??? */ |
@@ -1296,16 +1281,15 @@ static int ray_set_rts(struct net_device *dev, | |||
1296 | /* | 1281 | /* |
1297 | * Wireless Handler : get RTS threshold | 1282 | * Wireless Handler : get RTS threshold |
1298 | */ | 1283 | */ |
1299 | static int ray_get_rts(struct net_device *dev, | 1284 | static int ray_get_rts(struct net_device *dev, struct iw_request_info *info, |
1300 | struct iw_request_info *info, | 1285 | union iwreq_data *wrqu, char *extra) |
1301 | struct iw_param *vwrq, char *extra) | ||
1302 | { | 1286 | { |
1303 | ray_dev_t *local = netdev_priv(dev); | 1287 | ray_dev_t *local = netdev_priv(dev); |
1304 | 1288 | ||
1305 | vwrq->value = (local->sparm.b5.a_rts_threshold[0] << 8) | 1289 | wrqu->rts.value = (local->sparm.b5.a_rts_threshold[0] << 8) |
1306 | + local->sparm.b5.a_rts_threshold[1]; | 1290 | + local->sparm.b5.a_rts_threshold[1]; |
1307 | vwrq->disabled = (vwrq->value == 32767); | 1291 | wrqu->rts.disabled = (wrqu->rts.value == 32767); |
1308 | vwrq->fixed = 1; | 1292 | wrqu->rts.fixed = 1; |
1309 | 1293 | ||
1310 | return 0; | 1294 | return 0; |
1311 | } | 1295 | } |
@@ -1314,19 +1298,18 @@ static int ray_get_rts(struct net_device *dev, | |||
1314 | /* | 1298 | /* |
1315 | * Wireless Handler : set Fragmentation threshold | 1299 | * Wireless Handler : set Fragmentation threshold |
1316 | */ | 1300 | */ |
1317 | static int ray_set_frag(struct net_device *dev, | 1301 | static int ray_set_frag(struct net_device *dev, struct iw_request_info *info, |
1318 | struct iw_request_info *info, | 1302 | union iwreq_data *wrqu, char *extra) |
1319 | struct iw_param *vwrq, char *extra) | ||
1320 | { | 1303 | { |
1321 | ray_dev_t *local = netdev_priv(dev); | 1304 | ray_dev_t *local = netdev_priv(dev); |
1322 | int fthr = vwrq->value; | 1305 | int fthr = wrqu->frag.value; |
1323 | 1306 | ||
1324 | /* Reject if card is already initialised */ | 1307 | /* Reject if card is already initialised */ |
1325 | if (local->card_status != CARD_AWAITING_PARAM) | 1308 | if (local->card_status != CARD_AWAITING_PARAM) |
1326 | return -EBUSY; | 1309 | return -EBUSY; |
1327 | 1310 | ||
1328 | /* if(wrq->u.frag.fixed == 0) should complain */ | 1311 | /* if(wrq->u.frag.fixed == 0) should complain */ |
1329 | if (vwrq->disabled) | 1312 | if (wrqu->frag.disabled) |
1330 | fthr = 32767; | 1313 | fthr = 32767; |
1331 | else { | 1314 | else { |
1332 | if ((fthr < 256) || (fthr > 2347)) /* To check out ! */ | 1315 | if ((fthr < 256) || (fthr > 2347)) /* To check out ! */ |
@@ -1342,16 +1325,15 @@ static int ray_set_frag(struct net_device *dev, | |||
1342 | /* | 1325 | /* |
1343 | * Wireless Handler : get Fragmentation threshold | 1326 | * Wireless Handler : get Fragmentation threshold |
1344 | */ | 1327 | */ |
1345 | static int ray_get_frag(struct net_device *dev, | 1328 | static int ray_get_frag(struct net_device *dev, struct iw_request_info *info, |
1346 | struct iw_request_info *info, | 1329 | union iwreq_data *wrqu, char *extra) |
1347 | struct iw_param *vwrq, char *extra) | ||
1348 | { | 1330 | { |
1349 | ray_dev_t *local = netdev_priv(dev); | 1331 | ray_dev_t *local = netdev_priv(dev); |
1350 | 1332 | ||
1351 | vwrq->value = (local->sparm.b5.a_frag_threshold[0] << 8) | 1333 | wrqu->frag.value = (local->sparm.b5.a_frag_threshold[0] << 8) |
1352 | + local->sparm.b5.a_frag_threshold[1]; | 1334 | + local->sparm.b5.a_frag_threshold[1]; |
1353 | vwrq->disabled = (vwrq->value == 32767); | 1335 | wrqu->frag.disabled = (wrqu->frag.value == 32767); |
1354 | vwrq->fixed = 1; | 1336 | wrqu->frag.fixed = 1; |
1355 | 1337 | ||
1356 | return 0; | 1338 | return 0; |
1357 | } | 1339 | } |
@@ -1360,8 +1342,8 @@ static int ray_get_frag(struct net_device *dev, | |||
1360 | /* | 1342 | /* |
1361 | * Wireless Handler : set Mode of Operation | 1343 | * Wireless Handler : set Mode of Operation |
1362 | */ | 1344 | */ |
1363 | static int ray_set_mode(struct net_device *dev, | 1345 | static int ray_set_mode(struct net_device *dev, struct iw_request_info *info, |
1364 | struct iw_request_info *info, __u32 *uwrq, char *extra) | 1346 | union iwreq_data *wrqu, char *extra) |
1365 | { | 1347 | { |
1366 | ray_dev_t *local = netdev_priv(dev); | 1348 | ray_dev_t *local = netdev_priv(dev); |
1367 | int err = -EINPROGRESS; /* Call commit handler */ | 1349 | int err = -EINPROGRESS; /* Call commit handler */ |
@@ -1371,7 +1353,7 @@ static int ray_set_mode(struct net_device *dev, | |||
1371 | if (local->card_status != CARD_AWAITING_PARAM) | 1353 | if (local->card_status != CARD_AWAITING_PARAM) |
1372 | return -EBUSY; | 1354 | return -EBUSY; |
1373 | 1355 | ||
1374 | switch (*uwrq) { | 1356 | switch (wrqu->mode) { |
1375 | case IW_MODE_ADHOC: | 1357 | case IW_MODE_ADHOC: |
1376 | card_mode = 0; | 1358 | card_mode = 0; |
1377 | /* Fall through */ | 1359 | /* Fall through */ |
@@ -1389,15 +1371,15 @@ static int ray_set_mode(struct net_device *dev, | |||
1389 | /* | 1371 | /* |
1390 | * Wireless Handler : get Mode of Operation | 1372 | * Wireless Handler : get Mode of Operation |
1391 | */ | 1373 | */ |
1392 | static int ray_get_mode(struct net_device *dev, | 1374 | static int ray_get_mode(struct net_device *dev, struct iw_request_info *info, |
1393 | struct iw_request_info *info, __u32 *uwrq, char *extra) | 1375 | union iwreq_data *wrqu, char *extra) |
1394 | { | 1376 | { |
1395 | ray_dev_t *local = netdev_priv(dev); | 1377 | ray_dev_t *local = netdev_priv(dev); |
1396 | 1378 | ||
1397 | if (local->sparm.b5.a_network_type) | 1379 | if (local->sparm.b5.a_network_type) |
1398 | *uwrq = IW_MODE_INFRA; | 1380 | wrqu->mode = IW_MODE_INFRA; |
1399 | else | 1381 | else |
1400 | *uwrq = IW_MODE_ADHOC; | 1382 | wrqu->mode = IW_MODE_ADHOC; |
1401 | 1383 | ||
1402 | return 0; | 1384 | return 0; |
1403 | } | 1385 | } |
@@ -1406,16 +1388,15 @@ static int ray_get_mode(struct net_device *dev, | |||
1406 | /* | 1388 | /* |
1407 | * Wireless Handler : get range info | 1389 | * Wireless Handler : get range info |
1408 | */ | 1390 | */ |
1409 | static int ray_get_range(struct net_device *dev, | 1391 | static int ray_get_range(struct net_device *dev, struct iw_request_info *info, |
1410 | struct iw_request_info *info, | 1392 | union iwreq_data *wrqu, char *extra) |
1411 | struct iw_point *dwrq, char *extra) | ||
1412 | { | 1393 | { |
1413 | struct iw_range *range = (struct iw_range *)extra; | 1394 | struct iw_range *range = (struct iw_range *)extra; |
1414 | 1395 | ||
1415 | memset((char *)range, 0, sizeof(struct iw_range)); | 1396 | memset(range, 0, sizeof(struct iw_range)); |
1416 | 1397 | ||
1417 | /* Set the length (very important for backward compatibility) */ | 1398 | /* Set the length (very important for backward compatibility) */ |
1418 | dwrq->length = sizeof(struct iw_range); | 1399 | wrqu->data.length = sizeof(struct iw_range); |
1419 | 1400 | ||
1420 | /* Set the Wireless Extension versions */ | 1401 | /* Set the Wireless Extension versions */ |
1421 | range->we_version_compiled = WIRELESS_EXT; | 1402 | range->we_version_compiled = WIRELESS_EXT; |
@@ -1438,8 +1419,7 @@ static int ray_get_range(struct net_device *dev, | |||
1438 | /* | 1419 | /* |
1439 | * Wireless Private Handler : set framing mode | 1420 | * Wireless Private Handler : set framing mode |
1440 | */ | 1421 | */ |
1441 | static int ray_set_framing(struct net_device *dev, | 1422 | static int ray_set_framing(struct net_device *dev, struct iw_request_info *info, |
1442 | struct iw_request_info *info, | ||
1443 | union iwreq_data *wrqu, char *extra) | 1423 | union iwreq_data *wrqu, char *extra) |
1444 | { | 1424 | { |
1445 | translate = *(extra); /* Set framing mode */ | 1425 | translate = *(extra); /* Set framing mode */ |
@@ -1451,8 +1431,7 @@ static int ray_set_framing(struct net_device *dev, | |||
1451 | /* | 1431 | /* |
1452 | * Wireless Private Handler : get framing mode | 1432 | * Wireless Private Handler : get framing mode |
1453 | */ | 1433 | */ |
1454 | static int ray_get_framing(struct net_device *dev, | 1434 | static int ray_get_framing(struct net_device *dev, struct iw_request_info *info, |
1455 | struct iw_request_info *info, | ||
1456 | union iwreq_data *wrqu, char *extra) | 1435 | union iwreq_data *wrqu, char *extra) |
1457 | { | 1436 | { |
1458 | *(extra) = translate; | 1437 | *(extra) = translate; |
@@ -1464,8 +1443,7 @@ static int ray_get_framing(struct net_device *dev, | |||
1464 | /* | 1443 | /* |
1465 | * Wireless Private Handler : get country | 1444 | * Wireless Private Handler : get country |
1466 | */ | 1445 | */ |
1467 | static int ray_get_country(struct net_device *dev, | 1446 | static int ray_get_country(struct net_device *dev, struct iw_request_info *info, |
1468 | struct iw_request_info *info, | ||
1469 | union iwreq_data *wrqu, char *extra) | 1447 | union iwreq_data *wrqu, char *extra) |
1470 | { | 1448 | { |
1471 | *(extra) = country; | 1449 | *(extra) = country; |
@@ -1477,10 +1455,9 @@ static int ray_get_country(struct net_device *dev, | |||
1477 | /* | 1455 | /* |
1478 | * Commit handler : called after a bunch of SET operations | 1456 | * Commit handler : called after a bunch of SET operations |
1479 | */ | 1457 | */ |
1480 | static int ray_commit(struct net_device *dev, struct iw_request_info *info, /* NULL */ | 1458 | static int ray_commit(struct net_device *dev, struct iw_request_info *info, |
1481 | void *zwrq, /* NULL */ | 1459 | union iwreq_data *wrqu, char *extra) |
1482 | char *extra) | 1460 | { |
1483 | { /* NULL */ | ||
1484 | return 0; | 1461 | return 0; |
1485 | } | 1462 | } |
1486 | 1463 | ||
@@ -1521,28 +1498,28 @@ static iw_stats *ray_get_wireless_stats(struct net_device *dev) | |||
1521 | */ | 1498 | */ |
1522 | 1499 | ||
1523 | static const iw_handler ray_handler[] = { | 1500 | static const iw_handler ray_handler[] = { |
1524 | [SIOCSIWCOMMIT - SIOCIWFIRST] = (iw_handler) ray_commit, | 1501 | IW_HANDLER(SIOCSIWCOMMIT, ray_commit), |
1525 | [SIOCGIWNAME - SIOCIWFIRST] = (iw_handler) ray_get_name, | 1502 | IW_HANDLER(SIOCGIWNAME, ray_get_name), |
1526 | [SIOCSIWFREQ - SIOCIWFIRST] = (iw_handler) ray_set_freq, | 1503 | IW_HANDLER(SIOCSIWFREQ, ray_set_freq), |
1527 | [SIOCGIWFREQ - SIOCIWFIRST] = (iw_handler) ray_get_freq, | 1504 | IW_HANDLER(SIOCGIWFREQ, ray_get_freq), |
1528 | [SIOCSIWMODE - SIOCIWFIRST] = (iw_handler) ray_set_mode, | 1505 | IW_HANDLER(SIOCSIWMODE, ray_set_mode), |
1529 | [SIOCGIWMODE - SIOCIWFIRST] = (iw_handler) ray_get_mode, | 1506 | IW_HANDLER(SIOCGIWMODE, ray_get_mode), |
1530 | [SIOCGIWRANGE - SIOCIWFIRST] = (iw_handler) ray_get_range, | 1507 | IW_HANDLER(SIOCGIWRANGE, ray_get_range), |
1531 | #ifdef WIRELESS_SPY | 1508 | #ifdef WIRELESS_SPY |
1532 | [SIOCSIWSPY - SIOCIWFIRST] = (iw_handler) iw_handler_set_spy, | 1509 | IW_HANDLER(SIOCSIWSPY, iw_handler_set_spy), |
1533 | [SIOCGIWSPY - SIOCIWFIRST] = (iw_handler) iw_handler_get_spy, | 1510 | IW_HANDLER(SIOCGIWSPY, iw_handler_get_spy), |
1534 | [SIOCSIWTHRSPY - SIOCIWFIRST] = (iw_handler) iw_handler_set_thrspy, | 1511 | IW_HANDLER(SIOCSIWTHRSPY, iw_handler_set_thrspy), |
1535 | [SIOCGIWTHRSPY - SIOCIWFIRST] = (iw_handler) iw_handler_get_thrspy, | 1512 | IW_HANDLER(SIOCGIWTHRSPY, iw_handler_get_thrspy), |
1536 | #endif /* WIRELESS_SPY */ | 1513 | #endif /* WIRELESS_SPY */ |
1537 | [SIOCGIWAP - SIOCIWFIRST] = (iw_handler) ray_get_wap, | 1514 | IW_HANDLER(SIOCGIWAP, ray_get_wap), |
1538 | [SIOCSIWESSID - SIOCIWFIRST] = (iw_handler) ray_set_essid, | 1515 | IW_HANDLER(SIOCSIWESSID, ray_set_essid), |
1539 | [SIOCGIWESSID - SIOCIWFIRST] = (iw_handler) ray_get_essid, | 1516 | IW_HANDLER(SIOCGIWESSID, ray_get_essid), |
1540 | [SIOCSIWRATE - SIOCIWFIRST] = (iw_handler) ray_set_rate, | 1517 | IW_HANDLER(SIOCSIWRATE, ray_set_rate), |
1541 | [SIOCGIWRATE - SIOCIWFIRST] = (iw_handler) ray_get_rate, | 1518 | IW_HANDLER(SIOCGIWRATE, ray_get_rate), |
1542 | [SIOCSIWRTS - SIOCIWFIRST] = (iw_handler) ray_set_rts, | 1519 | IW_HANDLER(SIOCSIWRTS, ray_set_rts), |
1543 | [SIOCGIWRTS - SIOCIWFIRST] = (iw_handler) ray_get_rts, | 1520 | IW_HANDLER(SIOCGIWRTS, ray_get_rts), |
1544 | [SIOCSIWFRAG - SIOCIWFIRST] = (iw_handler) ray_set_frag, | 1521 | IW_HANDLER(SIOCSIWFRAG, ray_set_frag), |
1545 | [SIOCGIWFRAG - SIOCIWFIRST] = (iw_handler) ray_get_frag, | 1522 | IW_HANDLER(SIOCGIWFRAG, ray_get_frag), |
1546 | }; | 1523 | }; |
1547 | 1524 | ||
1548 | #define SIOCSIPFRAMING SIOCIWFIRSTPRIV /* Set framing mode */ | 1525 | #define SIOCSIPFRAMING SIOCIWFIRSTPRIV /* Set framing mode */ |
@@ -1550,9 +1527,9 @@ static const iw_handler ray_handler[] = { | |||
1550 | #define SIOCGIPCOUNTRY SIOCIWFIRSTPRIV + 3 /* Get country code */ | 1527 | #define SIOCGIPCOUNTRY SIOCIWFIRSTPRIV + 3 /* Get country code */ |
1551 | 1528 | ||
1552 | static const iw_handler ray_private_handler[] = { | 1529 | static const iw_handler ray_private_handler[] = { |
1553 | [0] = (iw_handler) ray_set_framing, | 1530 | [0] = ray_set_framing, |
1554 | [1] = (iw_handler) ray_get_framing, | 1531 | [1] = ray_get_framing, |
1555 | [3] = (iw_handler) ray_get_country, | 1532 | [3] = ray_get_country, |
1556 | }; | 1533 | }; |
1557 | 1534 | ||
1558 | static const struct iw_priv_args ray_private_args[] = { | 1535 | static const struct iw_priv_args ray_private_args[] = { |
@@ -1636,7 +1613,6 @@ static int ray_dev_close(struct net_device *dev) | |||
1636 | static void ray_reset(struct net_device *dev) | 1613 | static void ray_reset(struct net_device *dev) |
1637 | { | 1614 | { |
1638 | pr_debug("ray_reset entered\n"); | 1615 | pr_debug("ray_reset entered\n"); |
1639 | return; | ||
1640 | } | 1616 | } |
1641 | 1617 | ||
1642 | /*===========================================================================*/ | 1618 | /*===========================================================================*/ |
@@ -1883,17 +1859,17 @@ static void ray_update_multi_list(struct net_device *dev, int all) | |||
1883 | writeb(0xff, &pccs->var); | 1859 | writeb(0xff, &pccs->var); |
1884 | local->num_multi = 0xff; | 1860 | local->num_multi = 0xff; |
1885 | } else { | 1861 | } else { |
1886 | struct dev_mc_list *dmi; | 1862 | struct netdev_hw_addr *ha; |
1887 | int i = 0; | 1863 | int i = 0; |
1888 | 1864 | ||
1889 | /* Copy the kernel's list of MC addresses to card */ | 1865 | /* Copy the kernel's list of MC addresses to card */ |
1890 | netdev_for_each_mc_addr(dmi, dev) { | 1866 | netdev_for_each_mc_addr(ha, dev) { |
1891 | memcpy_toio(p, dmi->dmi_addr, ETH_ALEN); | 1867 | memcpy_toio(p, ha->addr, ETH_ALEN); |
1892 | dev_dbg(&link->dev, | 1868 | dev_dbg(&link->dev, |
1893 | "ray_update_multi add addr %02x%02x%02x%02x%02x%02x\n", | 1869 | "ray_update_multi add addr %02x%02x%02x%02x%02x%02x\n", |
1894 | dmi->dmi_addr[0], dmi->dmi_addr[1], | 1870 | ha->addr[0], ha->addr[1], |
1895 | dmi->dmi_addr[2], dmi->dmi_addr[3], | 1871 | ha->addr[2], ha->addr[3], |
1896 | dmi->dmi_addr[4], dmi->dmi_addr[5]); | 1872 | ha->addr[4], ha->addr[5]); |
1897 | p += ETH_ALEN; | 1873 | p += ETH_ALEN; |
1898 | i++; | 1874 | i++; |
1899 | } | 1875 | } |
@@ -2242,7 +2218,7 @@ static void rx_data(struct net_device *dev, struct rcs __iomem *prcs, | |||
2242 | (dev->mtu + RX_MAC_HEADER_LENGTH + ETH_HLEN + | 2218 | (dev->mtu + RX_MAC_HEADER_LENGTH + ETH_HLEN + |
2243 | FCS_LEN)) { | 2219 | FCS_LEN)) { |
2244 | pr_debug( | 2220 | pr_debug( |
2245 | "ray_cs invalid packet length %d received \n", | 2221 | "ray_cs invalid packet length %d received\n", |
2246 | rx_len); | 2222 | rx_len); |
2247 | return; | 2223 | return; |
2248 | } | 2224 | } |
@@ -2253,7 +2229,7 @@ static void rx_data(struct net_device *dev, struct rcs __iomem *prcs, | |||
2253 | (dev->mtu + RX_MAC_HEADER_LENGTH + ETH_HLEN + | 2229 | (dev->mtu + RX_MAC_HEADER_LENGTH + ETH_HLEN + |
2254 | FCS_LEN)) { | 2230 | FCS_LEN)) { |
2255 | pr_debug( | 2231 | pr_debug( |
2256 | "ray_cs invalid packet length %d received \n", | 2232 | "ray_cs invalid packet length %d received\n", |
2257 | rx_len); | 2233 | rx_len); |
2258 | return; | 2234 | return; |
2259 | } | 2235 | } |
@@ -2761,11 +2737,11 @@ static int ray_cs_proc_show(struct seq_file *m, void *v) | |||
2761 | seq_printf(m, "Hop dwell = %d Kus\n", | 2737 | seq_printf(m, "Hop dwell = %d Kus\n", |
2762 | pfh->dwell_time[0] + | 2738 | pfh->dwell_time[0] + |
2763 | 256 * pfh->dwell_time[1]); | 2739 | 256 * pfh->dwell_time[1]); |
2764 | seq_printf(m, "Hop set = %d \n", | 2740 | seq_printf(m, "Hop set = %d\n", |
2765 | pfh->hop_set); | 2741 | pfh->hop_set); |
2766 | seq_printf(m, "Hop pattern = %d \n", | 2742 | seq_printf(m, "Hop pattern = %d\n", |
2767 | pfh->hop_pattern); | 2743 | pfh->hop_pattern); |
2768 | seq_printf(m, "Hop index = %d \n", | 2744 | seq_printf(m, "Hop index = %d\n", |
2769 | pfh->hop_index); | 2745 | pfh->hop_index); |
2770 | p += p[1] + 2; | 2746 | p += p[1] + 2; |
2771 | } else { | 2747 | } else { |