dm9000.c (9edd576d89a5b6d3e136d7dcab654d887c0d25b7) | dm9000.c (f2cedb63df14342ad40a8b5b324fc5d94a60b665) |
---|---|
1/* 2 * Davicom DM9000 Fast Ethernet driver for Linux. 3 * Copyright (C) 1997 Sten Wang 4 * 5 * This program is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU General Public License 7 * as published by the Free Software Foundation; either version 2 8 * of the License, or (at your option) any later version. --- 1014 unchanged lines hidden (view full) --- 1023 if (netif_msg_rx_err(db)) 1024 dev_dbg(db->dev, "length error\n"); 1025 dev->stats.rx_length_errors++; 1026 } 1027 } 1028 1029 /* Move data from DM9000 */ 1030 if (GoodPacket && | 1/* 2 * Davicom DM9000 Fast Ethernet driver for Linux. 3 * Copyright (C) 1997 Sten Wang 4 * 5 * This program is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU General Public License 7 * as published by the Free Software Foundation; either version 2 8 * of the License, or (at your option) any later version. --- 1014 unchanged lines hidden (view full) --- 1023 if (netif_msg_rx_err(db)) 1024 dev_dbg(db->dev, "length error\n"); 1025 dev->stats.rx_length_errors++; 1026 } 1027 } 1028 1029 /* Move data from DM9000 */ 1030 if (GoodPacket && |
1031 ((skb = dev_alloc_skb(RxLen + 4)) != NULL)) { | 1031 ((skb = netdev_alloc_skb(dev, RxLen + 4)) != NULL)) { |
1032 skb_reserve(skb, 2); 1033 rdptr = (u8 *) skb_put(skb, RxLen - 4); 1034 1035 /* Read received packet from RX SRAM */ 1036 1037 (db->inblk)(db->io_data, rdptr, RxLen); 1038 dev->stats.rx_bytes += RxLen; 1039 --- 328 unchanged lines hidden (view full) --- 1368 const unsigned char *mac_src; 1369 int ret = 0; 1370 int iosize; 1371 int i; 1372 u32 id_val; 1373 1374 /* Init network device */ 1375 ndev = alloc_etherdev(sizeof(struct board_info)); | 1032 skb_reserve(skb, 2); 1033 rdptr = (u8 *) skb_put(skb, RxLen - 4); 1034 1035 /* Read received packet from RX SRAM */ 1036 1037 (db->inblk)(db->io_data, rdptr, RxLen); 1038 dev->stats.rx_bytes += RxLen; 1039 --- 328 unchanged lines hidden (view full) --- 1368 const unsigned char *mac_src; 1369 int ret = 0; 1370 int iosize; 1371 int i; 1372 u32 id_val; 1373 1374 /* Init network device */ 1375 ndev = alloc_etherdev(sizeof(struct board_info)); |
1376 if (!ndev) { 1377 dev_err(&pdev->dev, "could not allocate device.\n"); | 1376 if (!ndev) |
1378 return -ENOMEM; | 1377 return -ENOMEM; |
1379 } | |
1380 1381 SET_NETDEV_DEV(ndev, &pdev->dev); 1382 1383 dev_dbg(&pdev->dev, "dm9000_probe()\n"); 1384 1385 /* setup board info structure */ 1386 db = netdev_priv(ndev); 1387 --- 194 unchanged lines hidden (view full) --- 1582 for (i = 0; i < 6; i++) 1583 ndev->dev_addr[i] = ior(db, i+DM9000_PAR); 1584 } 1585 1586 if (!is_valid_ether_addr(ndev->dev_addr)) { 1587 dev_warn(db->dev, "%s: Invalid ethernet MAC address. Please " 1588 "set using ifconfig\n", ndev->name); 1589 | 1378 1379 SET_NETDEV_DEV(ndev, &pdev->dev); 1380 1381 dev_dbg(&pdev->dev, "dm9000_probe()\n"); 1382 1383 /* setup board info structure */ 1384 db = netdev_priv(ndev); 1385 --- 194 unchanged lines hidden (view full) --- 1580 for (i = 0; i < 6; i++) 1581 ndev->dev_addr[i] = ior(db, i+DM9000_PAR); 1582 } 1583 1584 if (!is_valid_ether_addr(ndev->dev_addr)) { 1585 dev_warn(db->dev, "%s: Invalid ethernet MAC address. Please " 1586 "set using ifconfig\n", ndev->name); 1587 |
1590 random_ether_addr(ndev->dev_addr); | 1588 eth_hw_addr_random(ndev); |
1591 mac_src = "random"; 1592 } 1593 1594 1595 platform_set_drvdata(pdev, ndev); 1596 ret = register_netdev(ndev); 1597 1598 if (ret == 0) --- 113 unchanged lines hidden --- | 1589 mac_src = "random"; 1590 } 1591 1592 1593 platform_set_drvdata(pdev, ndev); 1594 ret = register_netdev(ndev); 1595 1596 if (ret == 0) --- 113 unchanged lines hidden --- |