diff options
Diffstat (limited to 'drivers/net/ethernet/dlink/dl2k.c')
-rw-r--r-- | drivers/net/ethernet/dlink/dl2k.c | 52 |
1 files changed, 9 insertions, 43 deletions
diff --git a/drivers/net/ethernet/dlink/dl2k.c b/drivers/net/ethernet/dlink/dl2k.c index b2dc2c81a147..2e09edb9cdf8 100644 --- a/drivers/net/ethernet/dlink/dl2k.c +++ b/drivers/net/ethernet/dlink/dl2k.c | |||
@@ -1259,55 +1259,21 @@ rio_ioctl (struct net_device *dev, struct ifreq *rq, int cmd) | |||
1259 | { | 1259 | { |
1260 | int phy_addr; | 1260 | int phy_addr; |
1261 | struct netdev_private *np = netdev_priv(dev); | 1261 | struct netdev_private *np = netdev_priv(dev); |
1262 | struct mii_data *miidata = (struct mii_data *) &rq->ifr_ifru; | 1262 | struct mii_ioctl_data *miidata = if_mii(rq); |
1263 | |||
1264 | struct netdev_desc *desc; | ||
1265 | int i; | ||
1266 | 1263 | ||
1267 | phy_addr = np->phy_addr; | 1264 | phy_addr = np->phy_addr; |
1268 | switch (cmd) { | 1265 | switch (cmd) { |
1269 | case SIOCDEVPRIVATE: | 1266 | case SIOCGMIIPHY: |
1270 | break; | 1267 | miidata->phy_id = phy_addr; |
1271 | |||
1272 | case SIOCDEVPRIVATE + 1: | ||
1273 | miidata->out_value = mii_read (dev, phy_addr, miidata->reg_num); | ||
1274 | break; | 1268 | break; |
1275 | case SIOCDEVPRIVATE + 2: | 1269 | case SIOCGMIIREG: |
1276 | mii_write (dev, phy_addr, miidata->reg_num, miidata->in_value); | 1270 | miidata->val_out = mii_read (dev, phy_addr, miidata->reg_num); |
1277 | break; | 1271 | break; |
1278 | case SIOCDEVPRIVATE + 3: | 1272 | case SIOCSMIIREG: |
1279 | break; | 1273 | if (!capable(CAP_NET_ADMIN)) |
1280 | case SIOCDEVPRIVATE + 4: | 1274 | return -EPERM; |
1281 | break; | 1275 | mii_write (dev, phy_addr, miidata->reg_num, miidata->val_in); |
1282 | case SIOCDEVPRIVATE + 5: | ||
1283 | netif_stop_queue (dev); | ||
1284 | break; | 1276 | break; |
1285 | case SIOCDEVPRIVATE + 6: | ||
1286 | netif_wake_queue (dev); | ||
1287 | break; | ||
1288 | case SIOCDEVPRIVATE + 7: | ||
1289 | printk | ||
1290 | ("tx_full=%x cur_tx=%lx old_tx=%lx cur_rx=%lx old_rx=%lx\n", | ||
1291 | netif_queue_stopped(dev), np->cur_tx, np->old_tx, np->cur_rx, | ||
1292 | np->old_rx); | ||
1293 | break; | ||
1294 | case SIOCDEVPRIVATE + 8: | ||
1295 | printk("TX ring:\n"); | ||
1296 | for (i = 0; i < TX_RING_SIZE; i++) { | ||
1297 | desc = &np->tx_ring[i]; | ||
1298 | printk | ||
1299 | ("%02x:cur:%08x next:%08x status:%08x frag1:%08x frag0:%08x", | ||
1300 | i, | ||
1301 | (u32) (np->tx_ring_dma + i * sizeof (*desc)), | ||
1302 | (u32)le64_to_cpu(desc->next_desc), | ||
1303 | (u32)le64_to_cpu(desc->status), | ||
1304 | (u32)(le64_to_cpu(desc->fraginfo) >> 32), | ||
1305 | (u32)le64_to_cpu(desc->fraginfo)); | ||
1306 | printk ("\n"); | ||
1307 | } | ||
1308 | printk ("\n"); | ||
1309 | break; | ||
1310 | |||
1311 | default: | 1277 | default: |
1312 | return -EOPNOTSUPP; | 1278 | return -EOPNOTSUPP; |
1313 | } | 1279 | } |