diff options
Diffstat (limited to 'drivers/net/wireless/ray_cs.c')
-rw-r--r-- | drivers/net/wireless/ray_cs.c | 257 |
1 files changed, 112 insertions, 145 deletions
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c index 11865ea21875..abff8934db13 100644 --- a/drivers/net/wireless/ray_cs.c +++ b/drivers/net/wireless/ray_cs.c | |||
@@ -51,7 +51,6 @@ | |||
51 | #include <pcmcia/cistpl.h> | 51 | #include <pcmcia/cistpl.h> |
52 | #include <pcmcia/cisreg.h> | 52 | #include <pcmcia/cisreg.h> |
53 | #include <pcmcia/ds.h> | 53 | #include <pcmcia/ds.h> |
54 | #include <pcmcia/mem_op.h> | ||
55 | 54 | ||
56 | #include <linux/wireless.h> | 55 | #include <linux/wireless.h> |
57 | #include <net/iw_handler.h> | 56 | #include <net/iw_handler.h> |
@@ -321,10 +320,6 @@ static int ray_probe(struct pcmcia_device *p_dev) | |||
321 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; | 320 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; |
322 | p_dev->io.IOAddrLines = 5; | 321 | p_dev->io.IOAddrLines = 5; |
323 | 322 | ||
324 | /* Interrupt setup. For PCMCIA, driver takes what's given */ | ||
325 | p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; | ||
326 | p_dev->irq.Handler = &ray_interrupt; | ||
327 | |||
328 | /* General socket configuration */ | 323 | /* General socket configuration */ |
329 | p_dev->conf.Attributes = CONF_ENABLE_IRQ; | 324 | p_dev->conf.Attributes = CONF_ENABLE_IRQ; |
330 | p_dev->conf.IntType = INT_MEMORY_AND_IO; | 325 | p_dev->conf.IntType = INT_MEMORY_AND_IO; |
@@ -383,8 +378,7 @@ static void ray_detach(struct pcmcia_device *link) | |||
383 | del_timer(&local->timer); | 378 | del_timer(&local->timer); |
384 | 379 | ||
385 | if (link->priv) { | 380 | if (link->priv) { |
386 | if (link->dev_node) | 381 | unregister_netdev(dev); |
387 | unregister_netdev(dev); | ||
388 | free_netdev(dev); | 382 | free_netdev(dev); |
389 | } | 383 | } |
390 | dev_dbg(&link->dev, "ray_cs ray_detach ending\n"); | 384 | dev_dbg(&link->dev, "ray_cs ray_detach ending\n"); |
@@ -417,10 +411,10 @@ static int ray_config(struct pcmcia_device *link) | |||
417 | /* Now allocate an interrupt line. Note that this does not | 411 | /* Now allocate an interrupt line. Note that this does not |
418 | actually assign a handler to the interrupt. | 412 | actually assign a handler to the interrupt. |
419 | */ | 413 | */ |
420 | ret = pcmcia_request_irq(link, &link->irq); | 414 | ret = pcmcia_request_irq(link, ray_interrupt); |
421 | if (ret) | 415 | if (ret) |
422 | goto failed; | 416 | goto failed; |
423 | dev->irq = link->irq.AssignedIRQ; | 417 | dev->irq = link->irq; |
424 | 418 | ||
425 | /* This actually configures the PCMCIA socket -- setting up | 419 | /* This actually configures the PCMCIA socket -- setting up |
426 | the I/O windows and the interrupt mapping. | 420 | the I/O windows and the interrupt mapping. |
@@ -493,9 +487,6 @@ static int ray_config(struct pcmcia_device *link) | |||
493 | return i; | 487 | return i; |
494 | } | 488 | } |
495 | 489 | ||
496 | strcpy(local->node.dev_name, dev->name); | ||
497 | link->dev_node = &local->node; | ||
498 | |||
499 | printk(KERN_INFO "%s: RayLink, irq %d, hw_addr %pM\n", | 490 | printk(KERN_INFO "%s: RayLink, irq %d, hw_addr %pM\n", |
500 | dev->name, dev->irq, dev->dev_addr); | 491 | dev->name, dev->irq, dev->dev_addr); |
501 | 492 | ||
@@ -555,7 +546,7 @@ static int ray_init(struct net_device *dev) | |||
555 | local->fw_ver = local->startup_res.firmware_version[0]; | 546 | local->fw_ver = local->startup_res.firmware_version[0]; |
556 | local->fw_bld = local->startup_res.firmware_version[1]; | 547 | local->fw_bld = local->startup_res.firmware_version[1]; |
557 | local->fw_var = local->startup_res.firmware_version[2]; | 548 | local->fw_var = local->startup_res.firmware_version[2]; |
558 | 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, |
559 | local->fw_bld); | 550 | local->fw_bld); |
560 | 551 | ||
561 | local->tib_length = 0x20; | 552 | local->tib_length = 0x20; |
@@ -735,8 +726,6 @@ static void verify_dl_startup(u_long data) | |||
735 | start_net((u_long) local); | 726 | start_net((u_long) local); |
736 | else | 727 | else |
737 | join_net((u_long) local); | 728 | join_net((u_long) local); |
738 | |||
739 | return; | ||
740 | } /* end verify_dl_startup */ | 729 | } /* end verify_dl_startup */ |
741 | 730 | ||
742 | /*===========================================================================*/ | 731 | /*===========================================================================*/ |
@@ -764,7 +753,6 @@ static void start_net(u_long data) | |||
764 | return; | 753 | return; |
765 | } | 754 | } |
766 | local->card_status = CARD_DOING_ACQ; | 755 | local->card_status = CARD_DOING_ACQ; |
767 | return; | ||
768 | } /* end start_net */ | 756 | } /* end start_net */ |
769 | 757 | ||
770 | /*===========================================================================*/ | 758 | /*===========================================================================*/ |
@@ -795,7 +783,6 @@ static void join_net(u_long data) | |||
795 | return; | 783 | return; |
796 | } | 784 | } |
797 | local->card_status = CARD_DOING_ACQ; | 785 | local->card_status = CARD_DOING_ACQ; |
798 | return; | ||
799 | } | 786 | } |
800 | 787 | ||
801 | /*============================================================================ | 788 | /*============================================================================ |
@@ -941,7 +928,6 @@ static netdev_tx_t ray_dev_start_xmit(struct sk_buff *skb, | |||
941 | case XMIT_MSG_BAD: | 928 | case XMIT_MSG_BAD: |
942 | case XMIT_OK: | 929 | case XMIT_OK: |
943 | default: | 930 | default: |
944 | dev->trans_start = jiffies; | ||
945 | dev_kfree_skb(skb); | 931 | dev_kfree_skb(skb); |
946 | } | 932 | } |
947 | 933 | ||
@@ -1112,10 +1098,10 @@ static const struct ethtool_ops netdev_ethtool_ops = { | |||
1112 | /* | 1098 | /* |
1113 | * Wireless Handler : get protocol name | 1099 | * Wireless Handler : get protocol name |
1114 | */ | 1100 | */ |
1115 | static int ray_get_name(struct net_device *dev, | 1101 | static int ray_get_name(struct net_device *dev, struct iw_request_info *info, |
1116 | struct iw_request_info *info, char *cwrq, char *extra) | 1102 | union iwreq_data *wrqu, char *extra) |
1117 | { | 1103 | { |
1118 | strcpy(cwrq, "IEEE 802.11-FH"); | 1104 | strcpy(wrqu->name, "IEEE 802.11-FH"); |
1119 | return 0; | 1105 | return 0; |
1120 | } | 1106 | } |
1121 | 1107 | ||
@@ -1123,9 +1109,8 @@ static int ray_get_name(struct net_device *dev, | |||
1123 | /* | 1109 | /* |
1124 | * Wireless Handler : set frequency | 1110 | * Wireless Handler : set frequency |
1125 | */ | 1111 | */ |
1126 | static int ray_set_freq(struct net_device *dev, | 1112 | static int ray_set_freq(struct net_device *dev, struct iw_request_info *info, |
1127 | struct iw_request_info *info, | 1113 | union iwreq_data *wrqu, char *extra) |
1128 | struct iw_freq *fwrq, char *extra) | ||
1129 | { | 1114 | { |
1130 | ray_dev_t *local = netdev_priv(dev); | 1115 | ray_dev_t *local = netdev_priv(dev); |
1131 | int err = -EINPROGRESS; /* Call commit handler */ | 1116 | int err = -EINPROGRESS; /* Call commit handler */ |
@@ -1135,10 +1120,10 @@ static int ray_set_freq(struct net_device *dev, | |||
1135 | return -EBUSY; | 1120 | return -EBUSY; |
1136 | 1121 | ||
1137 | /* Setting by channel number */ | 1122 | /* Setting by channel number */ |
1138 | if ((fwrq->m > USA_HOP_MOD) || (fwrq->e > 0)) | 1123 | if ((wrqu->freq.m > USA_HOP_MOD) || (wrqu->freq.e > 0)) |
1139 | err = -EOPNOTSUPP; | 1124 | err = -EOPNOTSUPP; |
1140 | else | 1125 | else |
1141 | local->sparm.b5.a_hop_pattern = fwrq->m; | 1126 | local->sparm.b5.a_hop_pattern = wrqu->freq.m; |
1142 | 1127 | ||
1143 | return err; | 1128 | return err; |
1144 | } | 1129 | } |
@@ -1147,14 +1132,13 @@ static int ray_set_freq(struct net_device *dev, | |||
1147 | /* | 1132 | /* |
1148 | * Wireless Handler : get frequency | 1133 | * Wireless Handler : get frequency |
1149 | */ | 1134 | */ |
1150 | static int ray_get_freq(struct net_device *dev, | 1135 | static int ray_get_freq(struct net_device *dev, struct iw_request_info *info, |
1151 | struct iw_request_info *info, | 1136 | union iwreq_data *wrqu, char *extra) |
1152 | struct iw_freq *fwrq, char *extra) | ||
1153 | { | 1137 | { |
1154 | ray_dev_t *local = netdev_priv(dev); | 1138 | ray_dev_t *local = netdev_priv(dev); |
1155 | 1139 | ||
1156 | fwrq->m = local->sparm.b5.a_hop_pattern; | 1140 | wrqu->freq.m = local->sparm.b5.a_hop_pattern; |
1157 | fwrq->e = 0; | 1141 | wrqu->freq.e = 0; |
1158 | return 0; | 1142 | return 0; |
1159 | } | 1143 | } |
1160 | 1144 | ||
@@ -1162,9 +1146,8 @@ static int ray_get_freq(struct net_device *dev, | |||
1162 | /* | 1146 | /* |
1163 | * Wireless Handler : set ESSID | 1147 | * Wireless Handler : set ESSID |
1164 | */ | 1148 | */ |
1165 | static int ray_set_essid(struct net_device *dev, | 1149 | static int ray_set_essid(struct net_device *dev, struct iw_request_info *info, |
1166 | struct iw_request_info *info, | 1150 | union iwreq_data *wrqu, char *extra) |
1167 | struct iw_point *dwrq, char *extra) | ||
1168 | { | 1151 | { |
1169 | ray_dev_t *local = netdev_priv(dev); | 1152 | ray_dev_t *local = netdev_priv(dev); |
1170 | 1153 | ||
@@ -1173,19 +1156,17 @@ static int ray_set_essid(struct net_device *dev, | |||
1173 | return -EBUSY; | 1156 | return -EBUSY; |
1174 | 1157 | ||
1175 | /* Check if we asked for `any' */ | 1158 | /* Check if we asked for `any' */ |
1176 | if (dwrq->flags == 0) { | 1159 | if (wrqu->essid.flags == 0) |
1177 | /* Corey : can you do that ? */ | 1160 | /* Corey : can you do that ? */ |
1178 | return -EOPNOTSUPP; | 1161 | return -EOPNOTSUPP; |
1179 | } else { | ||
1180 | /* Check the size of the string */ | ||
1181 | if (dwrq->length > IW_ESSID_MAX_SIZE) { | ||
1182 | return -E2BIG; | ||
1183 | } | ||
1184 | 1162 | ||
1185 | /* Set the ESSID in the card */ | 1163 | /* Check the size of the string */ |
1186 | memset(local->sparm.b5.a_current_ess_id, 0, IW_ESSID_MAX_SIZE); | 1164 | if (wrqu->essid.length > IW_ESSID_MAX_SIZE) |
1187 | memcpy(local->sparm.b5.a_current_ess_id, extra, dwrq->length); | 1165 | return -E2BIG; |
1188 | } | 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); | ||
1189 | 1170 | ||
1190 | return -EINPROGRESS; /* Call commit handler */ | 1171 | return -EINPROGRESS; /* Call commit handler */ |
1191 | } | 1172 | } |
@@ -1194,9 +1175,8 @@ static int ray_set_essid(struct net_device *dev, | |||
1194 | /* | 1175 | /* |
1195 | * Wireless Handler : get ESSID | 1176 | * Wireless Handler : get ESSID |
1196 | */ | 1177 | */ |
1197 | static int ray_get_essid(struct net_device *dev, | 1178 | static int ray_get_essid(struct net_device *dev, struct iw_request_info *info, |
1198 | struct iw_request_info *info, | 1179 | union iwreq_data *wrqu, char *extra) |
1199 | struct iw_point *dwrq, char *extra) | ||
1200 | { | 1180 | { |
1201 | ray_dev_t *local = netdev_priv(dev); | 1181 | ray_dev_t *local = netdev_priv(dev); |
1202 | 1182 | ||
@@ -1204,8 +1184,8 @@ static int ray_get_essid(struct net_device *dev, | |||
1204 | 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); |
1205 | 1185 | ||
1206 | /* Push it out ! */ | 1186 | /* Push it out ! */ |
1207 | dwrq->length = strlen(extra); | 1187 | wrqu->essid.length = strlen(extra); |
1208 | dwrq->flags = 1; /* active */ | 1188 | wrqu->essid.flags = 1; /* active */ |
1209 | 1189 | ||
1210 | return 0; | 1190 | return 0; |
1211 | } | 1191 | } |
@@ -1214,14 +1194,13 @@ static int ray_get_essid(struct net_device *dev, | |||
1214 | /* | 1194 | /* |
1215 | * Wireless Handler : get AP address | 1195 | * Wireless Handler : get AP address |
1216 | */ | 1196 | */ |
1217 | static int ray_get_wap(struct net_device *dev, | 1197 | static int ray_get_wap(struct net_device *dev, struct iw_request_info *info, |
1218 | struct iw_request_info *info, | 1198 | union iwreq_data *wrqu, char *extra) |
1219 | struct sockaddr *awrq, char *extra) | ||
1220 | { | 1199 | { |
1221 | ray_dev_t *local = netdev_priv(dev); | 1200 | ray_dev_t *local = netdev_priv(dev); |
1222 | 1201 | ||
1223 | memcpy(awrq->sa_data, local->bss_id, ETH_ALEN); | 1202 | memcpy(wrqu->ap_addr.sa_data, local->bss_id, ETH_ALEN); |
1224 | awrq->sa_family = ARPHRD_ETHER; | 1203 | wrqu->ap_addr.sa_family = ARPHRD_ETHER; |
1225 | 1204 | ||
1226 | return 0; | 1205 | return 0; |
1227 | } | 1206 | } |
@@ -1230,9 +1209,8 @@ static int ray_get_wap(struct net_device *dev, | |||
1230 | /* | 1209 | /* |
1231 | * Wireless Handler : set Bit-Rate | 1210 | * Wireless Handler : set Bit-Rate |
1232 | */ | 1211 | */ |
1233 | static int ray_set_rate(struct net_device *dev, | 1212 | static int ray_set_rate(struct net_device *dev, struct iw_request_info *info, |
1234 | struct iw_request_info *info, | 1213 | union iwreq_data *wrqu, char *extra) |
1235 | struct iw_param *vwrq, char *extra) | ||
1236 | { | 1214 | { |
1237 | ray_dev_t *local = netdev_priv(dev); | 1215 | ray_dev_t *local = netdev_priv(dev); |
1238 | 1216 | ||
@@ -1241,15 +1219,15 @@ static int ray_set_rate(struct net_device *dev, | |||
1241 | return -EBUSY; | 1219 | return -EBUSY; |
1242 | 1220 | ||
1243 | /* Check if rate is in range */ | 1221 | /* Check if rate is in range */ |
1244 | if ((vwrq->value != 1000000) && (vwrq->value != 2000000)) | 1222 | if ((wrqu->bitrate.value != 1000000) && (wrqu->bitrate.value != 2000000)) |
1245 | return -EINVAL; | 1223 | return -EINVAL; |
1246 | 1224 | ||
1247 | /* Hack for 1.5 Mb/s instead of 2 Mb/s */ | 1225 | /* Hack for 1.5 Mb/s instead of 2 Mb/s */ |
1248 | if ((local->fw_ver == 0x55) && /* Please check */ | 1226 | if ((local->fw_ver == 0x55) && /* Please check */ |
1249 | (vwrq->value == 2000000)) | 1227 | (wrqu->bitrate.value == 2000000)) |
1250 | local->net_default_tx_rate = 3; | 1228 | local->net_default_tx_rate = 3; |
1251 | else | 1229 | else |
1252 | local->net_default_tx_rate = vwrq->value / 500000; | 1230 | local->net_default_tx_rate = wrqu->bitrate.value / 500000; |
1253 | 1231 | ||
1254 | return 0; | 1232 | return 0; |
1255 | } | 1233 | } |
@@ -1258,17 +1236,16 @@ static int ray_set_rate(struct net_device *dev, | |||
1258 | /* | 1236 | /* |
1259 | * Wireless Handler : get Bit-Rate | 1237 | * Wireless Handler : get Bit-Rate |
1260 | */ | 1238 | */ |
1261 | static int ray_get_rate(struct net_device *dev, | 1239 | static int ray_get_rate(struct net_device *dev, struct iw_request_info *info, |
1262 | struct iw_request_info *info, | 1240 | union iwreq_data *wrqu, char *extra) |
1263 | struct iw_param *vwrq, char *extra) | ||
1264 | { | 1241 | { |
1265 | ray_dev_t *local = netdev_priv(dev); | 1242 | ray_dev_t *local = netdev_priv(dev); |
1266 | 1243 | ||
1267 | if (local->net_default_tx_rate == 3) | 1244 | if (local->net_default_tx_rate == 3) |
1268 | vwrq->value = 2000000; /* Hum... */ | 1245 | wrqu->bitrate.value = 2000000; /* Hum... */ |
1269 | else | 1246 | else |
1270 | vwrq->value = local->net_default_tx_rate * 500000; | 1247 | wrqu->bitrate.value = local->net_default_tx_rate * 500000; |
1271 | vwrq->fixed = 0; /* We are in auto mode */ | 1248 | wrqu->bitrate.fixed = 0; /* We are in auto mode */ |
1272 | 1249 | ||
1273 | return 0; | 1250 | return 0; |
1274 | } | 1251 | } |
@@ -1277,19 +1254,18 @@ static int ray_get_rate(struct net_device *dev, | |||
1277 | /* | 1254 | /* |
1278 | * Wireless Handler : set RTS threshold | 1255 | * Wireless Handler : set RTS threshold |
1279 | */ | 1256 | */ |
1280 | static int ray_set_rts(struct net_device *dev, | 1257 | static int ray_set_rts(struct net_device *dev, struct iw_request_info *info, |
1281 | struct iw_request_info *info, | 1258 | union iwreq_data *wrqu, char *extra) |
1282 | struct iw_param *vwrq, char *extra) | ||
1283 | { | 1259 | { |
1284 | ray_dev_t *local = netdev_priv(dev); | 1260 | ray_dev_t *local = netdev_priv(dev); |
1285 | int rthr = vwrq->value; | 1261 | int rthr = wrqu->rts.value; |
1286 | 1262 | ||
1287 | /* Reject if card is already initialised */ | 1263 | /* Reject if card is already initialised */ |
1288 | if (local->card_status != CARD_AWAITING_PARAM) | 1264 | if (local->card_status != CARD_AWAITING_PARAM) |
1289 | return -EBUSY; | 1265 | return -EBUSY; |
1290 | 1266 | ||
1291 | /* if(wrq->u.rts.fixed == 0) we should complain */ | 1267 | /* if(wrq->u.rts.fixed == 0) we should complain */ |
1292 | if (vwrq->disabled) | 1268 | if (wrqu->rts.disabled) |
1293 | rthr = 32767; | 1269 | rthr = 32767; |
1294 | else { | 1270 | else { |
1295 | if ((rthr < 0) || (rthr > 2347)) /* What's the max packet size ??? */ | 1271 | if ((rthr < 0) || (rthr > 2347)) /* What's the max packet size ??? */ |
@@ -1305,16 +1281,15 @@ static int ray_set_rts(struct net_device *dev, | |||
1305 | /* | 1281 | /* |
1306 | * Wireless Handler : get RTS threshold | 1282 | * Wireless Handler : get RTS threshold |
1307 | */ | 1283 | */ |
1308 | static int ray_get_rts(struct net_device *dev, | 1284 | static int ray_get_rts(struct net_device *dev, struct iw_request_info *info, |
1309 | struct iw_request_info *info, | 1285 | union iwreq_data *wrqu, char *extra) |
1310 | struct iw_param *vwrq, char *extra) | ||
1311 | { | 1286 | { |
1312 | ray_dev_t *local = netdev_priv(dev); | 1287 | ray_dev_t *local = netdev_priv(dev); |
1313 | 1288 | ||
1314 | vwrq->value = (local->sparm.b5.a_rts_threshold[0] << 8) | 1289 | wrqu->rts.value = (local->sparm.b5.a_rts_threshold[0] << 8) |
1315 | + local->sparm.b5.a_rts_threshold[1]; | 1290 | + local->sparm.b5.a_rts_threshold[1]; |
1316 | vwrq->disabled = (vwrq->value == 32767); | 1291 | wrqu->rts.disabled = (wrqu->rts.value == 32767); |
1317 | vwrq->fixed = 1; | 1292 | wrqu->rts.fixed = 1; |
1318 | 1293 | ||
1319 | return 0; | 1294 | return 0; |
1320 | } | 1295 | } |
@@ -1323,19 +1298,18 @@ static int ray_get_rts(struct net_device *dev, | |||
1323 | /* | 1298 | /* |
1324 | * Wireless Handler : set Fragmentation threshold | 1299 | * Wireless Handler : set Fragmentation threshold |
1325 | */ | 1300 | */ |
1326 | static int ray_set_frag(struct net_device *dev, | 1301 | static int ray_set_frag(struct net_device *dev, struct iw_request_info *info, |
1327 | struct iw_request_info *info, | 1302 | union iwreq_data *wrqu, char *extra) |
1328 | struct iw_param *vwrq, char *extra) | ||
1329 | { | 1303 | { |
1330 | ray_dev_t *local = netdev_priv(dev); | 1304 | ray_dev_t *local = netdev_priv(dev); |
1331 | int fthr = vwrq->value; | 1305 | int fthr = wrqu->frag.value; |
1332 | 1306 | ||
1333 | /* Reject if card is already initialised */ | 1307 | /* Reject if card is already initialised */ |
1334 | if (local->card_status != CARD_AWAITING_PARAM) | 1308 | if (local->card_status != CARD_AWAITING_PARAM) |
1335 | return -EBUSY; | 1309 | return -EBUSY; |
1336 | 1310 | ||
1337 | /* if(wrq->u.frag.fixed == 0) should complain */ | 1311 | /* if(wrq->u.frag.fixed == 0) should complain */ |
1338 | if (vwrq->disabled) | 1312 | if (wrqu->frag.disabled) |
1339 | fthr = 32767; | 1313 | fthr = 32767; |
1340 | else { | 1314 | else { |
1341 | if ((fthr < 256) || (fthr > 2347)) /* To check out ! */ | 1315 | if ((fthr < 256) || (fthr > 2347)) /* To check out ! */ |
@@ -1351,16 +1325,15 @@ static int ray_set_frag(struct net_device *dev, | |||
1351 | /* | 1325 | /* |
1352 | * Wireless Handler : get Fragmentation threshold | 1326 | * Wireless Handler : get Fragmentation threshold |
1353 | */ | 1327 | */ |
1354 | static int ray_get_frag(struct net_device *dev, | 1328 | static int ray_get_frag(struct net_device *dev, struct iw_request_info *info, |
1355 | struct iw_request_info *info, | 1329 | union iwreq_data *wrqu, char *extra) |
1356 | struct iw_param *vwrq, char *extra) | ||
1357 | { | 1330 | { |
1358 | ray_dev_t *local = netdev_priv(dev); | 1331 | ray_dev_t *local = netdev_priv(dev); |
1359 | 1332 | ||
1360 | vwrq->value = (local->sparm.b5.a_frag_threshold[0] << 8) | 1333 | wrqu->frag.value = (local->sparm.b5.a_frag_threshold[0] << 8) |
1361 | + local->sparm.b5.a_frag_threshold[1]; | 1334 | + local->sparm.b5.a_frag_threshold[1]; |
1362 | vwrq->disabled = (vwrq->value == 32767); | 1335 | wrqu->frag.disabled = (wrqu->frag.value == 32767); |
1363 | vwrq->fixed = 1; | 1336 | wrqu->frag.fixed = 1; |
1364 | 1337 | ||
1365 | return 0; | 1338 | return 0; |
1366 | } | 1339 | } |
@@ -1369,8 +1342,8 @@ static int ray_get_frag(struct net_device *dev, | |||
1369 | /* | 1342 | /* |
1370 | * Wireless Handler : set Mode of Operation | 1343 | * Wireless Handler : set Mode of Operation |
1371 | */ | 1344 | */ |
1372 | static int ray_set_mode(struct net_device *dev, | 1345 | static int ray_set_mode(struct net_device *dev, struct iw_request_info *info, |
1373 | struct iw_request_info *info, __u32 *uwrq, char *extra) | 1346 | union iwreq_data *wrqu, char *extra) |
1374 | { | 1347 | { |
1375 | ray_dev_t *local = netdev_priv(dev); | 1348 | ray_dev_t *local = netdev_priv(dev); |
1376 | int err = -EINPROGRESS; /* Call commit handler */ | 1349 | int err = -EINPROGRESS; /* Call commit handler */ |
@@ -1380,7 +1353,7 @@ static int ray_set_mode(struct net_device *dev, | |||
1380 | if (local->card_status != CARD_AWAITING_PARAM) | 1353 | if (local->card_status != CARD_AWAITING_PARAM) |
1381 | return -EBUSY; | 1354 | return -EBUSY; |
1382 | 1355 | ||
1383 | switch (*uwrq) { | 1356 | switch (wrqu->mode) { |
1384 | case IW_MODE_ADHOC: | 1357 | case IW_MODE_ADHOC: |
1385 | card_mode = 0; | 1358 | card_mode = 0; |
1386 | /* Fall through */ | 1359 | /* Fall through */ |
@@ -1398,15 +1371,15 @@ static int ray_set_mode(struct net_device *dev, | |||
1398 | /* | 1371 | /* |
1399 | * Wireless Handler : get Mode of Operation | 1372 | * Wireless Handler : get Mode of Operation |
1400 | */ | 1373 | */ |
1401 | static int ray_get_mode(struct net_device *dev, | 1374 | static int ray_get_mode(struct net_device *dev, struct iw_request_info *info, |
1402 | struct iw_request_info *info, __u32 *uwrq, char *extra) | 1375 | union iwreq_data *wrqu, char *extra) |
1403 | { | 1376 | { |
1404 | ray_dev_t *local = netdev_priv(dev); | 1377 | ray_dev_t *local = netdev_priv(dev); |
1405 | 1378 | ||
1406 | if (local->sparm.b5.a_network_type) | 1379 | if (local->sparm.b5.a_network_type) |
1407 | *uwrq = IW_MODE_INFRA; | 1380 | wrqu->mode = IW_MODE_INFRA; |
1408 | else | 1381 | else |
1409 | *uwrq = IW_MODE_ADHOC; | 1382 | wrqu->mode = IW_MODE_ADHOC; |
1410 | 1383 | ||
1411 | return 0; | 1384 | return 0; |
1412 | } | 1385 | } |
@@ -1415,16 +1388,15 @@ static int ray_get_mode(struct net_device *dev, | |||
1415 | /* | 1388 | /* |
1416 | * Wireless Handler : get range info | 1389 | * Wireless Handler : get range info |
1417 | */ | 1390 | */ |
1418 | static int ray_get_range(struct net_device *dev, | 1391 | static int ray_get_range(struct net_device *dev, struct iw_request_info *info, |
1419 | struct iw_request_info *info, | 1392 | union iwreq_data *wrqu, char *extra) |
1420 | struct iw_point *dwrq, char *extra) | ||
1421 | { | 1393 | { |
1422 | struct iw_range *range = (struct iw_range *)extra; | 1394 | struct iw_range *range = (struct iw_range *)extra; |
1423 | 1395 | ||
1424 | memset((char *)range, 0, sizeof(struct iw_range)); | 1396 | memset(range, 0, sizeof(struct iw_range)); |
1425 | 1397 | ||
1426 | /* Set the length (very important for backward compatibility) */ | 1398 | /* Set the length (very important for backward compatibility) */ |
1427 | dwrq->length = sizeof(struct iw_range); | 1399 | wrqu->data.length = sizeof(struct iw_range); |
1428 | 1400 | ||
1429 | /* Set the Wireless Extension versions */ | 1401 | /* Set the Wireless Extension versions */ |
1430 | range->we_version_compiled = WIRELESS_EXT; | 1402 | range->we_version_compiled = WIRELESS_EXT; |
@@ -1447,8 +1419,7 @@ static int ray_get_range(struct net_device *dev, | |||
1447 | /* | 1419 | /* |
1448 | * Wireless Private Handler : set framing mode | 1420 | * Wireless Private Handler : set framing mode |
1449 | */ | 1421 | */ |
1450 | static int ray_set_framing(struct net_device *dev, | 1422 | static int ray_set_framing(struct net_device *dev, struct iw_request_info *info, |
1451 | struct iw_request_info *info, | ||
1452 | union iwreq_data *wrqu, char *extra) | 1423 | union iwreq_data *wrqu, char *extra) |
1453 | { | 1424 | { |
1454 | translate = *(extra); /* Set framing mode */ | 1425 | translate = *(extra); /* Set framing mode */ |
@@ -1460,8 +1431,7 @@ static int ray_set_framing(struct net_device *dev, | |||
1460 | /* | 1431 | /* |
1461 | * Wireless Private Handler : get framing mode | 1432 | * Wireless Private Handler : get framing mode |
1462 | */ | 1433 | */ |
1463 | static int ray_get_framing(struct net_device *dev, | 1434 | static int ray_get_framing(struct net_device *dev, struct iw_request_info *info, |
1464 | struct iw_request_info *info, | ||
1465 | union iwreq_data *wrqu, char *extra) | 1435 | union iwreq_data *wrqu, char *extra) |
1466 | { | 1436 | { |
1467 | *(extra) = translate; | 1437 | *(extra) = translate; |
@@ -1473,8 +1443,7 @@ static int ray_get_framing(struct net_device *dev, | |||
1473 | /* | 1443 | /* |
1474 | * Wireless Private Handler : get country | 1444 | * Wireless Private Handler : get country |
1475 | */ | 1445 | */ |
1476 | static int ray_get_country(struct net_device *dev, | 1446 | static int ray_get_country(struct net_device *dev, struct iw_request_info *info, |
1477 | struct iw_request_info *info, | ||
1478 | union iwreq_data *wrqu, char *extra) | 1447 | union iwreq_data *wrqu, char *extra) |
1479 | { | 1448 | { |
1480 | *(extra) = country; | 1449 | *(extra) = country; |
@@ -1486,10 +1455,9 @@ static int ray_get_country(struct net_device *dev, | |||
1486 | /* | 1455 | /* |
1487 | * Commit handler : called after a bunch of SET operations | 1456 | * Commit handler : called after a bunch of SET operations |
1488 | */ | 1457 | */ |
1489 | 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, |
1490 | void *zwrq, /* NULL */ | 1459 | union iwreq_data *wrqu, char *extra) |
1491 | char *extra) | 1460 | { |
1492 | { /* NULL */ | ||
1493 | return 0; | 1461 | return 0; |
1494 | } | 1462 | } |
1495 | 1463 | ||
@@ -1530,28 +1498,28 @@ static iw_stats *ray_get_wireless_stats(struct net_device *dev) | |||
1530 | */ | 1498 | */ |
1531 | 1499 | ||
1532 | static const iw_handler ray_handler[] = { | 1500 | static const iw_handler ray_handler[] = { |
1533 | [SIOCSIWCOMMIT - SIOCIWFIRST] = (iw_handler) ray_commit, | 1501 | IW_HANDLER(SIOCSIWCOMMIT, ray_commit), |
1534 | [SIOCGIWNAME - SIOCIWFIRST] = (iw_handler) ray_get_name, | 1502 | IW_HANDLER(SIOCGIWNAME, ray_get_name), |
1535 | [SIOCSIWFREQ - SIOCIWFIRST] = (iw_handler) ray_set_freq, | 1503 | IW_HANDLER(SIOCSIWFREQ, ray_set_freq), |
1536 | [SIOCGIWFREQ - SIOCIWFIRST] = (iw_handler) ray_get_freq, | 1504 | IW_HANDLER(SIOCGIWFREQ, ray_get_freq), |
1537 | [SIOCSIWMODE - SIOCIWFIRST] = (iw_handler) ray_set_mode, | 1505 | IW_HANDLER(SIOCSIWMODE, ray_set_mode), |
1538 | [SIOCGIWMODE - SIOCIWFIRST] = (iw_handler) ray_get_mode, | 1506 | IW_HANDLER(SIOCGIWMODE, ray_get_mode), |
1539 | [SIOCGIWRANGE - SIOCIWFIRST] = (iw_handler) ray_get_range, | 1507 | IW_HANDLER(SIOCGIWRANGE, ray_get_range), |
1540 | #ifdef WIRELESS_SPY | 1508 | #ifdef WIRELESS_SPY |
1541 | [SIOCSIWSPY - SIOCIWFIRST] = (iw_handler) iw_handler_set_spy, | 1509 | IW_HANDLER(SIOCSIWSPY, iw_handler_set_spy), |
1542 | [SIOCGIWSPY - SIOCIWFIRST] = (iw_handler) iw_handler_get_spy, | 1510 | IW_HANDLER(SIOCGIWSPY, iw_handler_get_spy), |
1543 | [SIOCSIWTHRSPY - SIOCIWFIRST] = (iw_handler) iw_handler_set_thrspy, | 1511 | IW_HANDLER(SIOCSIWTHRSPY, iw_handler_set_thrspy), |
1544 | [SIOCGIWTHRSPY - SIOCIWFIRST] = (iw_handler) iw_handler_get_thrspy, | 1512 | IW_HANDLER(SIOCGIWTHRSPY, iw_handler_get_thrspy), |
1545 | #endif /* WIRELESS_SPY */ | 1513 | #endif /* WIRELESS_SPY */ |
1546 | [SIOCGIWAP - SIOCIWFIRST] = (iw_handler) ray_get_wap, | 1514 | IW_HANDLER(SIOCGIWAP, ray_get_wap), |
1547 | [SIOCSIWESSID - SIOCIWFIRST] = (iw_handler) ray_set_essid, | 1515 | IW_HANDLER(SIOCSIWESSID, ray_set_essid), |
1548 | [SIOCGIWESSID - SIOCIWFIRST] = (iw_handler) ray_get_essid, | 1516 | IW_HANDLER(SIOCGIWESSID, ray_get_essid), |
1549 | [SIOCSIWRATE - SIOCIWFIRST] = (iw_handler) ray_set_rate, | 1517 | IW_HANDLER(SIOCSIWRATE, ray_set_rate), |
1550 | [SIOCGIWRATE - SIOCIWFIRST] = (iw_handler) ray_get_rate, | 1518 | IW_HANDLER(SIOCGIWRATE, ray_get_rate), |
1551 | [SIOCSIWRTS - SIOCIWFIRST] = (iw_handler) ray_set_rts, | 1519 | IW_HANDLER(SIOCSIWRTS, ray_set_rts), |
1552 | [SIOCGIWRTS - SIOCIWFIRST] = (iw_handler) ray_get_rts, | 1520 | IW_HANDLER(SIOCGIWRTS, ray_get_rts), |
1553 | [SIOCSIWFRAG - SIOCIWFIRST] = (iw_handler) ray_set_frag, | 1521 | IW_HANDLER(SIOCSIWFRAG, ray_set_frag), |
1554 | [SIOCGIWFRAG - SIOCIWFIRST] = (iw_handler) ray_get_frag, | 1522 | IW_HANDLER(SIOCGIWFRAG, ray_get_frag), |
1555 | }; | 1523 | }; |
1556 | 1524 | ||
1557 | #define SIOCSIPFRAMING SIOCIWFIRSTPRIV /* Set framing mode */ | 1525 | #define SIOCSIPFRAMING SIOCIWFIRSTPRIV /* Set framing mode */ |
@@ -1559,9 +1527,9 @@ static const iw_handler ray_handler[] = { | |||
1559 | #define SIOCGIPCOUNTRY SIOCIWFIRSTPRIV + 3 /* Get country code */ | 1527 | #define SIOCGIPCOUNTRY SIOCIWFIRSTPRIV + 3 /* Get country code */ |
1560 | 1528 | ||
1561 | static const iw_handler ray_private_handler[] = { | 1529 | static const iw_handler ray_private_handler[] = { |
1562 | [0] = (iw_handler) ray_set_framing, | 1530 | [0] = ray_set_framing, |
1563 | [1] = (iw_handler) ray_get_framing, | 1531 | [1] = ray_get_framing, |
1564 | [3] = (iw_handler) ray_get_country, | 1532 | [3] = ray_get_country, |
1565 | }; | 1533 | }; |
1566 | 1534 | ||
1567 | static const struct iw_priv_args ray_private_args[] = { | 1535 | static const struct iw_priv_args ray_private_args[] = { |
@@ -1645,7 +1613,6 @@ static int ray_dev_close(struct net_device *dev) | |||
1645 | static void ray_reset(struct net_device *dev) | 1613 | static void ray_reset(struct net_device *dev) |
1646 | { | 1614 | { |
1647 | pr_debug("ray_reset entered\n"); | 1615 | pr_debug("ray_reset entered\n"); |
1648 | return; | ||
1649 | } | 1616 | } |
1650 | 1617 | ||
1651 | /*===========================================================================*/ | 1618 | /*===========================================================================*/ |
@@ -1892,17 +1859,17 @@ static void ray_update_multi_list(struct net_device *dev, int all) | |||
1892 | writeb(0xff, &pccs->var); | 1859 | writeb(0xff, &pccs->var); |
1893 | local->num_multi = 0xff; | 1860 | local->num_multi = 0xff; |
1894 | } else { | 1861 | } else { |
1895 | struct dev_mc_list *dmi; | 1862 | struct netdev_hw_addr *ha; |
1896 | int i = 0; | 1863 | int i = 0; |
1897 | 1864 | ||
1898 | /* Copy the kernel's list of MC addresses to card */ | 1865 | /* Copy the kernel's list of MC addresses to card */ |
1899 | netdev_for_each_mc_addr(dmi, dev) { | 1866 | netdev_for_each_mc_addr(ha, dev) { |
1900 | memcpy_toio(p, dmi->dmi_addr, ETH_ALEN); | 1867 | memcpy_toio(p, ha->addr, ETH_ALEN); |
1901 | dev_dbg(&link->dev, | 1868 | dev_dbg(&link->dev, |
1902 | "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", |
1903 | dmi->dmi_addr[0], dmi->dmi_addr[1], | 1870 | ha->addr[0], ha->addr[1], |
1904 | dmi->dmi_addr[2], dmi->dmi_addr[3], | 1871 | ha->addr[2], ha->addr[3], |
1905 | dmi->dmi_addr[4], dmi->dmi_addr[5]); | 1872 | ha->addr[4], ha->addr[5]); |
1906 | p += ETH_ALEN; | 1873 | p += ETH_ALEN; |
1907 | i++; | 1874 | i++; |
1908 | } | 1875 | } |
@@ -2251,7 +2218,7 @@ static void rx_data(struct net_device *dev, struct rcs __iomem *prcs, | |||
2251 | (dev->mtu + RX_MAC_HEADER_LENGTH + ETH_HLEN + | 2218 | (dev->mtu + RX_MAC_HEADER_LENGTH + ETH_HLEN + |
2252 | FCS_LEN)) { | 2219 | FCS_LEN)) { |
2253 | pr_debug( | 2220 | pr_debug( |
2254 | "ray_cs invalid packet length %d received \n", | 2221 | "ray_cs invalid packet length %d received\n", |
2255 | rx_len); | 2222 | rx_len); |
2256 | return; | 2223 | return; |
2257 | } | 2224 | } |
@@ -2262,7 +2229,7 @@ static void rx_data(struct net_device *dev, struct rcs __iomem *prcs, | |||
2262 | (dev->mtu + RX_MAC_HEADER_LENGTH + ETH_HLEN + | 2229 | (dev->mtu + RX_MAC_HEADER_LENGTH + ETH_HLEN + |
2263 | FCS_LEN)) { | 2230 | FCS_LEN)) { |
2264 | pr_debug( | 2231 | pr_debug( |
2265 | "ray_cs invalid packet length %d received \n", | 2232 | "ray_cs invalid packet length %d received\n", |
2266 | rx_len); | 2233 | rx_len); |
2267 | return; | 2234 | return; |
2268 | } | 2235 | } |
@@ -2770,11 +2737,11 @@ static int ray_cs_proc_show(struct seq_file *m, void *v) | |||
2770 | seq_printf(m, "Hop dwell = %d Kus\n", | 2737 | seq_printf(m, "Hop dwell = %d Kus\n", |
2771 | pfh->dwell_time[0] + | 2738 | pfh->dwell_time[0] + |
2772 | 256 * pfh->dwell_time[1]); | 2739 | 256 * pfh->dwell_time[1]); |
2773 | seq_printf(m, "Hop set = %d \n", | 2740 | seq_printf(m, "Hop set = %d\n", |
2774 | pfh->hop_set); | 2741 | pfh->hop_set); |
2775 | seq_printf(m, "Hop pattern = %d \n", | 2742 | seq_printf(m, "Hop pattern = %d\n", |
2776 | pfh->hop_pattern); | 2743 | pfh->hop_pattern); |
2777 | seq_printf(m, "Hop index = %d \n", | 2744 | seq_printf(m, "Hop index = %d\n", |
2778 | pfh->hop_index); | 2745 | pfh->hop_index); |
2779 | p += p[1] + 2; | 2746 | p += p[1] + 2; |
2780 | } else { | 2747 | } else { |