diff options
Diffstat (limited to 'drivers/net/tokenring/olympic.c')
-rw-r--r-- | drivers/net/tokenring/olympic.c | 52 |
1 files changed, 17 insertions, 35 deletions
diff --git a/drivers/net/tokenring/olympic.c b/drivers/net/tokenring/olympic.c index 0ab51a0f35fc..ecb5c7c96910 100644 --- a/drivers/net/tokenring/olympic.c +++ b/drivers/net/tokenring/olympic.c | |||
@@ -421,10 +421,7 @@ static int olympic_init(struct net_device *dev) | |||
421 | memcpy_fromio(&dev->dev_addr[0], adapter_addr,6); | 421 | memcpy_fromio(&dev->dev_addr[0], adapter_addr,6); |
422 | 422 | ||
423 | #if OLYMPIC_DEBUG | 423 | #if OLYMPIC_DEBUG |
424 | { | 424 | printk("adapter address: %pM\n", dev->dev_addr); |
425 | DECLARE_MAC_BUF(mac); | ||
426 | printk("adapter address: %s\n", print_mac(mac, dev->dev_addr)); | ||
427 | } | ||
428 | #endif | 425 | #endif |
429 | 426 | ||
430 | olympic_priv->olympic_addr_table_addr = swab16(readw(init_srb + 12)); | 427 | olympic_priv->olympic_addr_table_addr = swab16(readw(init_srb + 12)); |
@@ -441,7 +438,6 @@ static int olympic_open(struct net_device *dev) | |||
441 | unsigned long flags, t; | 438 | unsigned long flags, t; |
442 | int i, open_finished = 1 ; | 439 | int i, open_finished = 1 ; |
443 | u8 resp, err; | 440 | u8 resp, err; |
444 | DECLARE_MAC_BUF(mac); | ||
445 | 441 | ||
446 | DECLARE_WAITQUEUE(wait,current) ; | 442 | DECLARE_WAITQUEUE(wait,current) ; |
447 | 443 | ||
@@ -569,8 +565,8 @@ static int olympic_open(struct net_device *dev) | |||
569 | goto out; | 565 | goto out; |
570 | 566 | ||
571 | case 0x32: | 567 | case 0x32: |
572 | printk(KERN_WARNING "%s: Invalid LAA: %s\n", | 568 | printk(KERN_WARNING "%s: Invalid LAA: %pM\n", |
573 | dev->name, print_mac(mac, olympic_priv->olympic_laa)); | 569 | dev->name, olympic_priv->olympic_laa); |
574 | goto out; | 570 | goto out; |
575 | 571 | ||
576 | default: | 572 | default: |
@@ -704,13 +700,12 @@ static int olympic_open(struct net_device *dev) | |||
704 | u8 __iomem *opt; | 700 | u8 __iomem *opt; |
705 | int i; | 701 | int i; |
706 | u8 addr[6]; | 702 | u8 addr[6]; |
707 | DECLARE_MAC_BUF(mac); | ||
708 | oat = (olympic_priv->olympic_lap + olympic_priv->olympic_addr_table_addr); | 703 | oat = (olympic_priv->olympic_lap + olympic_priv->olympic_addr_table_addr); |
709 | opt = (olympic_priv->olympic_lap + olympic_priv->olympic_parms_addr); | 704 | opt = (olympic_priv->olympic_lap + olympic_priv->olympic_parms_addr); |
710 | 705 | ||
711 | for (i = 0; i < 6; i++) | 706 | for (i = 0; i < 6; i++) |
712 | addr[i] = readb(oat+offsetof(struct olympic_adapter_addr_table,node_addr)+i); | 707 | addr[i] = readb(oat+offsetof(struct olympic_adapter_addr_table,node_addr)+i); |
713 | printk("%s: Node Address: %s\n",dev->name, print_mac(mac, addr)); | 708 | printk("%s: Node Address: %pM\n", dev->name, addr); |
714 | printk("%s: Functional Address: %02x:%02x:%02x:%02x\n",dev->name, | 709 | printk("%s: Functional Address: %02x:%02x:%02x:%02x\n",dev->name, |
715 | readb(oat+offsetof(struct olympic_adapter_addr_table,func_addr)), | 710 | readb(oat+offsetof(struct olympic_adapter_addr_table,func_addr)), |
716 | readb(oat+offsetof(struct olympic_adapter_addr_table,func_addr)+1), | 711 | readb(oat+offsetof(struct olympic_adapter_addr_table,func_addr)+1), |
@@ -719,7 +714,7 @@ static int olympic_open(struct net_device *dev) | |||
719 | 714 | ||
720 | for (i = 0; i < 6; i++) | 715 | for (i = 0; i < 6; i++) |
721 | addr[i] = readb(opt+offsetof(struct olympic_parameters_table, up_node_addr)+i); | 716 | addr[i] = readb(opt+offsetof(struct olympic_parameters_table, up_node_addr)+i); |
722 | printk("%s: NAUN Address: %s\n",dev->name, print_mac(mac, addr)); | 717 | printk("%s: NAUN Address: %pM\n", dev->name, addr); |
723 | } | 718 | } |
724 | 719 | ||
725 | netif_start_queue(dev); | 720 | netif_start_queue(dev); |
@@ -867,7 +862,6 @@ static void olympic_rx(struct net_device *dev) | |||
867 | skb->protocol = tr_type_trans(skb,dev); | 862 | skb->protocol = tr_type_trans(skb,dev); |
868 | netif_rx(skb) ; | 863 | netif_rx(skb) ; |
869 | } | 864 | } |
870 | dev->last_rx = jiffies ; | ||
871 | olympic_priv->olympic_stats.rx_packets++ ; | 865 | olympic_priv->olympic_stats.rx_packets++ ; |
872 | olympic_priv->olympic_stats.rx_bytes += length ; | 866 | olympic_priv->olympic_stats.rx_bytes += length ; |
873 | } /* if skb == null */ | 867 | } /* if skb == null */ |
@@ -1440,19 +1434,12 @@ static void olympic_arb_cmd(struct net_device *dev) | |||
1440 | struct trh_hdr *mac_hdr; | 1434 | struct trh_hdr *mac_hdr; |
1441 | printk(KERN_WARNING "%s: Received MAC Frame, details: \n",dev->name); | 1435 | printk(KERN_WARNING "%s: Received MAC Frame, details: \n",dev->name); |
1442 | mac_hdr = tr_hdr(mac_frame); | 1436 | mac_hdr = tr_hdr(mac_frame); |
1443 | printk(KERN_WARNING "%s: MAC Frame Dest. Addr: " | 1437 | printk(KERN_WARNING "%s: MAC Frame Dest. Addr: %pM\n", |
1444 | MAC_FMT " \n", dev->name, | 1438 | dev->name, mac_hdr->daddr); |
1445 | mac_hdr->daddr[0], mac_hdr->daddr[1], | 1439 | printk(KERN_WARNING "%s: MAC Frame Srce. Addr: %pM\n", |
1446 | mac_hdr->daddr[2], mac_hdr->daddr[3], | 1440 | dev->name, mac_hdr->saddr); |
1447 | mac_hdr->daddr[4], mac_hdr->daddr[5]); | ||
1448 | printk(KERN_WARNING "%s: MAC Frame Srce. Addr: " | ||
1449 | MAC_FMT " \n", dev->name, | ||
1450 | mac_hdr->saddr[0], mac_hdr->saddr[1], | ||
1451 | mac_hdr->saddr[2], mac_hdr->saddr[3], | ||
1452 | mac_hdr->saddr[4], mac_hdr->saddr[5]); | ||
1453 | } | 1441 | } |
1454 | netif_rx(mac_frame); | 1442 | netif_rx(mac_frame); |
1455 | dev->last_rx = jiffies; | ||
1456 | 1443 | ||
1457 | drop_frame: | 1444 | drop_frame: |
1458 | /* Now tell the card we have dealt with the received frame */ | 1445 | /* Now tell the card we have dealt with the received frame */ |
@@ -1647,8 +1634,6 @@ static int olympic_proc_info(char *buffer, char **start, off_t offset, int lengt | |||
1647 | u8 addr[6]; | 1634 | u8 addr[6]; |
1648 | u8 addr2[6]; | 1635 | u8 addr2[6]; |
1649 | int i; | 1636 | int i; |
1650 | DECLARE_MAC_BUF(mac); | ||
1651 | DECLARE_MAC_BUF(mac2); | ||
1652 | 1637 | ||
1653 | size = sprintf(buffer, | 1638 | size = sprintf(buffer, |
1654 | "IBM Pit/Pit-Phy/Olympic Chipset Token Ring Adapter %s\n",dev->name); | 1639 | "IBM Pit/Pit-Phy/Olympic Chipset Token Ring Adapter %s\n",dev->name); |
@@ -1658,10 +1643,9 @@ static int olympic_proc_info(char *buffer, char **start, off_t offset, int lengt | |||
1658 | for (i = 0 ; i < 6 ; i++) | 1643 | for (i = 0 ; i < 6 ; i++) |
1659 | addr[i] = readb(oat+offsetof(struct olympic_adapter_addr_table,node_addr) + i); | 1644 | addr[i] = readb(oat+offsetof(struct olympic_adapter_addr_table,node_addr) + i); |
1660 | 1645 | ||
1661 | size += sprintf(buffer+size, "%6s: %s : %s : %02x:%02x:%02x:%02x\n", | 1646 | size += sprintf(buffer+size, "%6s: %pM : %pM : %02x:%02x:%02x:%02x\n", |
1662 | dev->name, | 1647 | dev->name, |
1663 | print_mac(mac, dev->dev_addr), | 1648 | dev->dev_addr, addr, |
1664 | print_mac(mac2, addr), | ||
1665 | readb(oat+offsetof(struct olympic_adapter_addr_table,func_addr)), | 1649 | readb(oat+offsetof(struct olympic_adapter_addr_table,func_addr)), |
1666 | readb(oat+offsetof(struct olympic_adapter_addr_table,func_addr)+1), | 1650 | readb(oat+offsetof(struct olympic_adapter_addr_table,func_addr)+1), |
1667 | readb(oat+offsetof(struct olympic_adapter_addr_table,func_addr)+2), | 1651 | readb(oat+offsetof(struct olympic_adapter_addr_table,func_addr)+2), |
@@ -1677,14 +1661,13 @@ static int olympic_proc_info(char *buffer, char **start, off_t offset, int lengt | |||
1677 | for (i = 0 ; i < 6 ; i++) | 1661 | for (i = 0 ; i < 6 ; i++) |
1678 | addr2[i] = readb(opt+offsetof(struct olympic_parameters_table, poll_addr) + i); | 1662 | addr2[i] = readb(opt+offsetof(struct olympic_parameters_table, poll_addr) + i); |
1679 | 1663 | ||
1680 | size += sprintf(buffer+size, "%6s: %02x:%02x:%02x:%02x : %s : %s : %04x : %04x : %04x :\n", | 1664 | size += sprintf(buffer+size, "%6s: %02x:%02x:%02x:%02x : %pM : %pM : %04x : %04x : %04x :\n", |
1681 | dev->name, | 1665 | dev->name, |
1682 | readb(opt+offsetof(struct olympic_parameters_table, phys_addr)), | 1666 | readb(opt+offsetof(struct olympic_parameters_table, phys_addr)), |
1683 | readb(opt+offsetof(struct olympic_parameters_table, phys_addr)+1), | 1667 | readb(opt+offsetof(struct olympic_parameters_table, phys_addr)+1), |
1684 | readb(opt+offsetof(struct olympic_parameters_table, phys_addr)+2), | 1668 | readb(opt+offsetof(struct olympic_parameters_table, phys_addr)+2), |
1685 | readb(opt+offsetof(struct olympic_parameters_table, phys_addr)+3), | 1669 | readb(opt+offsetof(struct olympic_parameters_table, phys_addr)+3), |
1686 | print_mac(mac, addr), | 1670 | addr, addr2, |
1687 | print_mac(mac2, addr2), | ||
1688 | swab16(readw(opt+offsetof(struct olympic_parameters_table, acc_priority))), | 1671 | swab16(readw(opt+offsetof(struct olympic_parameters_table, acc_priority))), |
1689 | swab16(readw(opt+offsetof(struct olympic_parameters_table, auth_source_class))), | 1672 | swab16(readw(opt+offsetof(struct olympic_parameters_table, auth_source_class))), |
1690 | swab16(readw(opt+offsetof(struct olympic_parameters_table, att_code)))); | 1673 | swab16(readw(opt+offsetof(struct olympic_parameters_table, att_code)))); |
@@ -1694,9 +1677,8 @@ static int olympic_proc_info(char *buffer, char **start, off_t offset, int lengt | |||
1694 | 1677 | ||
1695 | for (i = 0 ; i < 6 ; i++) | 1678 | for (i = 0 ; i < 6 ; i++) |
1696 | addr[i] = readb(opt+offsetof(struct olympic_parameters_table, source_addr) + i); | 1679 | addr[i] = readb(opt+offsetof(struct olympic_parameters_table, source_addr) + i); |
1697 | size += sprintf(buffer+size, "%6s: %s : %04x : %04x : %04x : %04x : %04x : %04x : \n", | 1680 | size += sprintf(buffer+size, "%6s: %pM : %04x : %04x : %04x : %04x : %04x : %04x : \n", |
1698 | dev->name, | 1681 | dev->name, addr, |
1699 | print_mac(mac, addr), | ||
1700 | swab16(readw(opt+offsetof(struct olympic_parameters_table, beacon_type))), | 1682 | swab16(readw(opt+offsetof(struct olympic_parameters_table, beacon_type))), |
1701 | swab16(readw(opt+offsetof(struct olympic_parameters_table, major_vector))), | 1683 | swab16(readw(opt+offsetof(struct olympic_parameters_table, major_vector))), |
1702 | swab16(readw(opt+offsetof(struct olympic_parameters_table, lan_status))), | 1684 | swab16(readw(opt+offsetof(struct olympic_parameters_table, lan_status))), |
@@ -1709,11 +1691,11 @@ static int olympic_proc_info(char *buffer, char **start, off_t offset, int lengt | |||
1709 | 1691 | ||
1710 | for (i = 0 ; i < 6 ; i++) | 1692 | for (i = 0 ; i < 6 ; i++) |
1711 | addr[i] = readb(opt+offsetof(struct olympic_parameters_table, beacon_naun) + i); | 1693 | addr[i] = readb(opt+offsetof(struct olympic_parameters_table, beacon_naun) + i); |
1712 | size += sprintf(buffer+size, "%6s: : %02x : %02x : %s : %02x:%02x:%02x:%02x : \n", | 1694 | size += sprintf(buffer+size, "%6s: : %02x : %02x : %pM : %02x:%02x:%02x:%02x : \n", |
1713 | dev->name, | 1695 | dev->name, |
1714 | swab16(readw(opt+offsetof(struct olympic_parameters_table, beacon_transmit))), | 1696 | swab16(readw(opt+offsetof(struct olympic_parameters_table, beacon_transmit))), |
1715 | swab16(readw(opt+offsetof(struct olympic_parameters_table, beacon_receive))), | 1697 | swab16(readw(opt+offsetof(struct olympic_parameters_table, beacon_receive))), |
1716 | print_mac(mac, addr), | 1698 | addr, |
1717 | readb(opt+offsetof(struct olympic_parameters_table, beacon_phys)), | 1699 | readb(opt+offsetof(struct olympic_parameters_table, beacon_phys)), |
1718 | readb(opt+offsetof(struct olympic_parameters_table, beacon_phys)+1), | 1700 | readb(opt+offsetof(struct olympic_parameters_table, beacon_phys)+1), |
1719 | readb(opt+offsetof(struct olympic_parameters_table, beacon_phys)+2), | 1701 | readb(opt+offsetof(struct olympic_parameters_table, beacon_phys)+2), |