Lines Matching refs:db

141 #define dm9000_dbg(db, lev, msg...) do {		\  argument
143 (lev) < db->debug_level) { \
144 dev_dbg(db->dev, msg); \
156 dm9000_reset(board_info_t * db) in dm9000_reset() argument
158 dev_dbg(db->dev, "resetting device\n"); in dm9000_reset()
161 writeb(DM9000_NCR, db->io_addr); in dm9000_reset()
163 writeb(NCR_RST, db->io_data); in dm9000_reset()
171 ior(board_info_t * db, int reg) in ior() argument
173 writeb(reg, db->io_addr); in ior()
174 return readb(db->io_data); in ior()
182 iow(board_info_t * db, int reg, int value) in iow() argument
184 writeb(reg, db->io_addr); in iow()
185 writeb(value, db->io_data); in iow()
262 static void dm9000_set_io(struct board_info *db, int byte_width) in dm9000_set_io() argument
270 db->dumpblk = dm9000_dumpblk_8bit; in dm9000_set_io()
271 db->outblk = dm9000_outblk_8bit; in dm9000_set_io()
272 db->inblk = dm9000_inblk_8bit; in dm9000_set_io()
277 dev_dbg(db->dev, ": 3 byte IO, falling back to 16bit\n"); in dm9000_set_io()
279 db->dumpblk = dm9000_dumpblk_16bit; in dm9000_set_io()
280 db->outblk = dm9000_outblk_16bit; in dm9000_set_io()
281 db->inblk = dm9000_inblk_16bit; in dm9000_set_io()
286 db->dumpblk = dm9000_dumpblk_32bit; in dm9000_set_io()
287 db->outblk = dm9000_outblk_32bit; in dm9000_set_io()
288 db->inblk = dm9000_inblk_32bit; in dm9000_set_io()
293 static void dm9000_schedule_poll(board_info_t *db) in dm9000_schedule_poll() argument
295 if (db->type == TYPE_DM9000E) in dm9000_schedule_poll()
296 schedule_delayed_work(&db->phy_poll, HZ * 2); in dm9000_schedule_poll()
310 dm9000_read_locked(board_info_t *db, int reg) in dm9000_read_locked() argument
315 spin_lock_irqsave(&db->lock, flags); in dm9000_read_locked()
316 ret = ior(db, reg); in dm9000_read_locked()
317 spin_unlock_irqrestore(&db->lock, flags); in dm9000_read_locked()
322 static int dm9000_wait_eeprom(board_info_t *db) in dm9000_wait_eeprom() argument
339 status = dm9000_read_locked(db, DM9000_EPCR); in dm9000_wait_eeprom()
347 dev_dbg(db->dev, "timeout waiting EEPROM\n"); in dm9000_wait_eeprom()
359 dm9000_read_eeprom(board_info_t *db, int offset, u8 *to) in dm9000_read_eeprom() argument
363 if (db->flags & DM9000_PLATF_NO_EEPROM) { in dm9000_read_eeprom()
369 mutex_lock(&db->addr_lock); in dm9000_read_eeprom()
371 spin_lock_irqsave(&db->lock, flags); in dm9000_read_eeprom()
373 iow(db, DM9000_EPAR, offset); in dm9000_read_eeprom()
374 iow(db, DM9000_EPCR, EPCR_ERPRR); in dm9000_read_eeprom()
376 spin_unlock_irqrestore(&db->lock, flags); in dm9000_read_eeprom()
378 dm9000_wait_eeprom(db); in dm9000_read_eeprom()
383 spin_lock_irqsave(&db->lock, flags); in dm9000_read_eeprom()
385 iow(db, DM9000_EPCR, 0x0); in dm9000_read_eeprom()
387 to[0] = ior(db, DM9000_EPDRL); in dm9000_read_eeprom()
388 to[1] = ior(db, DM9000_EPDRH); in dm9000_read_eeprom()
390 spin_unlock_irqrestore(&db->lock, flags); in dm9000_read_eeprom()
392 mutex_unlock(&db->addr_lock); in dm9000_read_eeprom()
399 dm9000_write_eeprom(board_info_t *db, int offset, u8 *data) in dm9000_write_eeprom() argument
403 if (db->flags & DM9000_PLATF_NO_EEPROM) in dm9000_write_eeprom()
406 mutex_lock(&db->addr_lock); in dm9000_write_eeprom()
408 spin_lock_irqsave(&db->lock, flags); in dm9000_write_eeprom()
409 iow(db, DM9000_EPAR, offset); in dm9000_write_eeprom()
410 iow(db, DM9000_EPDRH, data[1]); in dm9000_write_eeprom()
411 iow(db, DM9000_EPDRL, data[0]); in dm9000_write_eeprom()
412 iow(db, DM9000_EPCR, EPCR_WEP | EPCR_ERPRW); in dm9000_write_eeprom()
413 spin_unlock_irqrestore(&db->lock, flags); in dm9000_write_eeprom()
415 dm9000_wait_eeprom(db); in dm9000_write_eeprom()
419 spin_lock_irqsave(&db->lock, flags); in dm9000_write_eeprom()
420 iow(db, DM9000_EPCR, 0); in dm9000_write_eeprom()
421 spin_unlock_irqrestore(&db->lock, flags); in dm9000_write_eeprom()
423 mutex_unlock(&db->addr_lock); in dm9000_write_eeprom()
652 static void dm9000_show_carrier(board_info_t *db, in dm9000_show_carrier() argument
655 struct net_device *ndev = db->ndev; in dm9000_show_carrier()
656 unsigned ncr = dm9000_read_locked(db, DM9000_NCR); in dm9000_show_carrier()
659 dev_info(db->dev, "%s: link up, %dMbps, %s-duplex, no LPA\n", in dm9000_show_carrier()
663 dev_info(db->dev, "%s: link down\n", ndev->name); in dm9000_show_carrier()
670 board_info_t *db = container_of(dw, board_info_t, phy_poll); in dm9000_poll_work() local
671 struct net_device *ndev = db->ndev; in dm9000_poll_work()
673 if (db->flags & DM9000_PLATF_SIMPLE_PHY && in dm9000_poll_work()
674 !(db->flags & DM9000_PLATF_EXT_PHY)) { in dm9000_poll_work()
675 unsigned nsr = dm9000_read_locked(db, DM9000_NSR); in dm9000_poll_work()
682 if (netif_msg_link(db)) in dm9000_poll_work()
683 dm9000_show_carrier(db, new_carrier, nsr); in dm9000_poll_work()
691 mii_check_media(&db->mii, netif_msg_link(db), 0); in dm9000_poll_work()
694 dm9000_schedule_poll(db); in dm9000_poll_work()
703 dm9000_release_board(struct platform_device *pdev, struct board_info *db) in dm9000_release_board() argument
707 iounmap(db->io_addr); in dm9000_release_board()
708 iounmap(db->io_data); in dm9000_release_board()
712 release_resource(db->data_req); in dm9000_release_board()
713 kfree(db->data_req); in dm9000_release_board()
715 release_resource(db->addr_req); in dm9000_release_board()
716 kfree(db->addr_req); in dm9000_release_board()
736 board_info_t *db = netdev_priv(dev); in dm9000_hash_table_unlocked() local
743 dm9000_dbg(db, 1, "entering %s\n", __func__); in dm9000_hash_table_unlocked()
746 iow(db, oft, dev->dev_addr[i]); in dm9000_hash_table_unlocked()
769 iow(db, oft++, hash_table[i]); in dm9000_hash_table_unlocked()
770 iow(db, oft++, hash_table[i] >> 8); in dm9000_hash_table_unlocked()
773 iow(db, DM9000_RCR, rcr); in dm9000_hash_table_unlocked()
779 board_info_t *db = netdev_priv(dev); in dm9000_hash_table() local
782 spin_lock_irqsave(&db->lock, flags); in dm9000_hash_table()
784 spin_unlock_irqrestore(&db->lock, flags); in dm9000_hash_table()
793 board_info_t *db = netdev_priv(dev); in dm9000_init_dm9000() local
797 dm9000_dbg(db, 1, "entering %s\n", __func__); in dm9000_init_dm9000()
800 db->io_mode = ior(db, DM9000_ISR) >> 6; /* ISR bit7:6 keeps I/O mode */ in dm9000_init_dm9000()
803 dm9000_set_rx_csum_unlocked(dev, db->rx_csum); in dm9000_init_dm9000()
805 iow(db, DM9000_GPCR, GPCR_GEP_CNTL); /* Let GPIO0 output */ in dm9000_init_dm9000()
807 ncr = (db->flags & DM9000_PLATF_EXT_PHY) ? NCR_EXT_PHY : 0; in dm9000_init_dm9000()
812 if (db->wake_supported) in dm9000_init_dm9000()
815 iow(db, DM9000_NCR, ncr); in dm9000_init_dm9000()
818 iow(db, DM9000_TCR, 0); /* TX Polling clear */ in dm9000_init_dm9000()
819 iow(db, DM9000_BPTR, 0x3f); /* Less 3Kb, 200us */ in dm9000_init_dm9000()
820 iow(db, DM9000_FCR, 0xff); /* Flow Control */ in dm9000_init_dm9000()
821 iow(db, DM9000_SMCR, 0); /* Special Mode */ in dm9000_init_dm9000()
823 iow(db, DM9000_NSR, NSR_WAKEST | NSR_TX2END | NSR_TX1END); in dm9000_init_dm9000()
824 iow(db, DM9000_ISR, ISR_CLR_STATUS); /* Clear interrupt status */ in dm9000_init_dm9000()
830 if (db->type != TYPE_DM9000E) in dm9000_init_dm9000()
833 db->imr_all = imr; in dm9000_init_dm9000()
836 iow(db, DM9000_IMR, imr); in dm9000_init_dm9000()
839 db->tx_pkt_cnt = 0; in dm9000_init_dm9000()
840 db->queue_pkt_len = 0; in dm9000_init_dm9000()
847 board_info_t *db = netdev_priv(dev); in dm9000_timeout() local
852 spin_lock_irqsave(&db->lock, flags); in dm9000_timeout()
853 reg_save = readb(db->io_addr); in dm9000_timeout()
856 dm9000_reset(db); in dm9000_timeout()
863 writeb(reg_save, db->io_addr); in dm9000_timeout()
864 spin_unlock_irqrestore(&db->lock, flags); in dm9000_timeout()
898 board_info_t *db = netdev_priv(dev); in dm9000_start_xmit() local
900 dm9000_dbg(db, 3, "%s:\n", __func__); in dm9000_start_xmit()
902 if (db->tx_pkt_cnt > 1) in dm9000_start_xmit()
905 spin_lock_irqsave(&db->lock, flags); in dm9000_start_xmit()
908 writeb(DM9000_MWCMD, db->io_addr); in dm9000_start_xmit()
910 (db->outblk)(db->io_data, skb->data, skb->len); in dm9000_start_xmit()
913 db->tx_pkt_cnt++; in dm9000_start_xmit()
915 if (db->tx_pkt_cnt == 1) { in dm9000_start_xmit()
919 db->queue_pkt_len = skb->len; in dm9000_start_xmit()
920 db->queue_ip_summed = skb->ip_summed; in dm9000_start_xmit()
924 spin_unlock_irqrestore(&db->lock, flags); in dm9000_start_xmit()
937 static void dm9000_tx_done(struct net_device *dev, board_info_t *db) in dm9000_tx_done() argument
939 int tx_status = ior(db, DM9000_NSR); /* Got TX status */ in dm9000_tx_done()
943 db->tx_pkt_cnt--; in dm9000_tx_done()
946 if (netif_msg_tx_done(db)) in dm9000_tx_done()
947 dev_dbg(db->dev, "tx done, NSR %02x\n", tx_status); in dm9000_tx_done()
950 if (db->tx_pkt_cnt > 0) in dm9000_tx_done()
951 dm9000_send_packet(dev, db->queue_ip_summed, in dm9000_tx_done()
952 db->queue_pkt_len); in dm9000_tx_done()
969 board_info_t *db = netdev_priv(dev); in dm9000_rx() local
978 ior(db, DM9000_MRCMDX); /* Dummy read */ in dm9000_rx()
981 rxbyte = readb(db->io_data); in dm9000_rx()
985 dev_warn(db->dev, "status check fail: %d\n", rxbyte); in dm9000_rx()
986 iow(db, DM9000_RCR, 0x00); /* Stop Device */ in dm9000_rx()
987 iow(db, DM9000_ISR, IMR_PAR); /* Stop INT request */ in dm9000_rx()
996 writeb(DM9000_MRCMD, db->io_addr); in dm9000_rx()
998 (db->inblk)(db->io_data, &rxhdr, sizeof(rxhdr)); in dm9000_rx()
1002 if (netif_msg_rx_status(db)) in dm9000_rx()
1003 dev_dbg(db->dev, "RX: status %02x, length %04x\n", in dm9000_rx()
1009 if (netif_msg_rx_err(db)) in dm9000_rx()
1010 dev_dbg(db->dev, "RX: Bad Packet (runt)\n"); in dm9000_rx()
1014 dev_dbg(db->dev, "RST: RX Len:%x\n", RxLen); in dm9000_rx()
1023 if (netif_msg_rx_err(db)) in dm9000_rx()
1024 dev_dbg(db->dev, "fifo error\n"); in dm9000_rx()
1028 if (netif_msg_rx_err(db)) in dm9000_rx()
1029 dev_dbg(db->dev, "crc error\n"); in dm9000_rx()
1033 if (netif_msg_rx_err(db)) in dm9000_rx()
1034 dev_dbg(db->dev, "length error\n"); in dm9000_rx()
1047 (db->inblk)(db->io_data, rdptr, RxLen); in dm9000_rx()
1052 if (db->rx_csum) { in dm9000_rx()
1064 (db->dumpblk)(db->io_data, RxLen); in dm9000_rx()
1072 board_info_t *db = netdev_priv(dev); in dm9000_interrupt() local
1077 dm9000_dbg(db, 3, "entering %s\n", __func__); in dm9000_interrupt()
1082 spin_lock_irqsave(&db->lock, flags); in dm9000_interrupt()
1085 reg_save = readb(db->io_addr); in dm9000_interrupt()
1088 iow(db, DM9000_IMR, IMR_PAR); in dm9000_interrupt()
1091 int_status = ior(db, DM9000_ISR); /* Got ISR */ in dm9000_interrupt()
1092 iow(db, DM9000_ISR, int_status); /* Clear ISR status */ in dm9000_interrupt()
1094 if (netif_msg_intr(db)) in dm9000_interrupt()
1095 dev_dbg(db->dev, "interrupt status %02x\n", int_status); in dm9000_interrupt()
1103 dm9000_tx_done(dev, db); in dm9000_interrupt()
1105 if (db->type != TYPE_DM9000E) { in dm9000_interrupt()
1108 schedule_delayed_work(&db->phy_poll, 1); in dm9000_interrupt()
1113 iow(db, DM9000_IMR, db->imr_all); in dm9000_interrupt()
1116 writeb(reg_save, db->io_addr); in dm9000_interrupt()
1118 spin_unlock_irqrestore(&db->lock, flags); in dm9000_interrupt()
1126 board_info_t *db = netdev_priv(dev); in dm9000_wol_interrupt() local
1130 spin_lock_irqsave(&db->lock, flags); in dm9000_wol_interrupt()
1132 nsr = ior(db, DM9000_NSR); in dm9000_wol_interrupt()
1133 wcr = ior(db, DM9000_WCR); in dm9000_wol_interrupt()
1135 dev_dbg(db->dev, "%s: NSR=0x%02x, WCR=0x%02x\n", __func__, nsr, wcr); in dm9000_wol_interrupt()
1139 iow(db, DM9000_NSR, NSR_WAKEST); in dm9000_wol_interrupt()
1142 dev_info(db->dev, "wake by link status change\n"); in dm9000_wol_interrupt()
1144 dev_info(db->dev, "wake by sample packet\n"); in dm9000_wol_interrupt()
1146 dev_info(db->dev, "wake by magic packet\n"); in dm9000_wol_interrupt()
1148 dev_err(db->dev, "wake signalled with no reason? " in dm9000_wol_interrupt()
1153 spin_unlock_irqrestore(&db->lock, flags); in dm9000_wol_interrupt()
1177 board_info_t *db = netdev_priv(dev); in dm9000_open() local
1178 unsigned long irqflags = db->irq_res->flags & IRQF_TRIGGER_MASK; in dm9000_open()
1180 if (netif_msg_ifup(db)) in dm9000_open()
1181 dev_dbg(db->dev, "enabling %s\n", dev->name); in dm9000_open()
1187 dev_warn(db->dev, "WARNING: no IRQ resource flags set.\n"); in dm9000_open()
1195 iow(db, DM9000_GPR, 0); /* REG_1F bit0 activate phyxcer */ in dm9000_open()
1199 dm9000_reset(db); in dm9000_open()
1203 db->dbug_cnt = 0; in dm9000_open()
1205 mii_check_media(&db->mii, netif_msg_link(db), 1); in dm9000_open()
1208 dm9000_schedule_poll(db); in dm9000_open()
1217 static void dm9000_msleep(board_info_t *db, unsigned int ms) in dm9000_msleep() argument
1219 if (db->in_suspend) in dm9000_msleep()
1231 board_info_t *db = netdev_priv(dev); in dm9000_phy_read() local
1236 mutex_lock(&db->addr_lock); in dm9000_phy_read()
1238 spin_lock_irqsave(&db->lock,flags); in dm9000_phy_read()
1241 reg_save = readb(db->io_addr); in dm9000_phy_read()
1244 iow(db, DM9000_EPAR, DM9000_PHY | reg); in dm9000_phy_read()
1246 iow(db, DM9000_EPCR, EPCR_ERPRR | EPCR_EPOS); /* Issue phyxcer read command */ in dm9000_phy_read()
1248 writeb(reg_save, db->io_addr); in dm9000_phy_read()
1249 spin_unlock_irqrestore(&db->lock,flags); in dm9000_phy_read()
1251 dm9000_msleep(db, 1); /* Wait read complete */ in dm9000_phy_read()
1253 spin_lock_irqsave(&db->lock,flags); in dm9000_phy_read()
1254 reg_save = readb(db->io_addr); in dm9000_phy_read()
1256 iow(db, DM9000_EPCR, 0x0); /* Clear phyxcer read command */ in dm9000_phy_read()
1259 ret = (ior(db, DM9000_EPDRH) << 8) | ior(db, DM9000_EPDRL); in dm9000_phy_read()
1262 writeb(reg_save, db->io_addr); in dm9000_phy_read()
1263 spin_unlock_irqrestore(&db->lock,flags); in dm9000_phy_read()
1265 mutex_unlock(&db->addr_lock); in dm9000_phy_read()
1267 dm9000_dbg(db, 5, "phy_read[%02x] -> %04x\n", reg, ret); in dm9000_phy_read()
1278 board_info_t *db = netdev_priv(dev); in dm9000_phy_write() local
1282 dm9000_dbg(db, 5, "phy_write[%02x] = %04x\n", reg, value); in dm9000_phy_write()
1283 mutex_lock(&db->addr_lock); in dm9000_phy_write()
1285 spin_lock_irqsave(&db->lock,flags); in dm9000_phy_write()
1288 reg_save = readb(db->io_addr); in dm9000_phy_write()
1291 iow(db, DM9000_EPAR, DM9000_PHY | reg); in dm9000_phy_write()
1294 iow(db, DM9000_EPDRL, value); in dm9000_phy_write()
1295 iow(db, DM9000_EPDRH, value >> 8); in dm9000_phy_write()
1297 iow(db, DM9000_EPCR, EPCR_EPOS | EPCR_ERPRW); /* Issue phyxcer write command */ in dm9000_phy_write()
1299 writeb(reg_save, db->io_addr); in dm9000_phy_write()
1300 spin_unlock_irqrestore(&db->lock, flags); in dm9000_phy_write()
1302 dm9000_msleep(db, 1); /* Wait write complete */ in dm9000_phy_write()
1304 spin_lock_irqsave(&db->lock,flags); in dm9000_phy_write()
1305 reg_save = readb(db->io_addr); in dm9000_phy_write()
1307 iow(db, DM9000_EPCR, 0x0); /* Clear phyxcer write command */ in dm9000_phy_write()
1310 writeb(reg_save, db->io_addr); in dm9000_phy_write()
1312 spin_unlock_irqrestore(&db->lock, flags); in dm9000_phy_write()
1313 mutex_unlock(&db->addr_lock); in dm9000_phy_write()
1319 board_info_t *db = netdev_priv(dev); in dm9000_shutdown() local
1323 iow(db, DM9000_GPR, 0x01); /* Power-Down PHY */ in dm9000_shutdown()
1324 iow(db, DM9000_IMR, IMR_PAR); /* Disable all interrupt */ in dm9000_shutdown()
1325 iow(db, DM9000_RCR, 0x00); /* Disable RX */ in dm9000_shutdown()
1335 board_info_t *db = netdev_priv(ndev); in dm9000_stop() local
1337 if (netif_msg_ifdown(db)) in dm9000_stop()
1338 dev_dbg(db->dev, "shutting down %s\n", ndev->name); in dm9000_stop()
1340 cancel_delayed_work_sync(&db->phy_poll); in dm9000_stop()
1375 struct board_info *db; /* Point a board information structure */ in dm9000_probe() local
1395 db = netdev_priv(ndev); in dm9000_probe()
1397 db->dev = &pdev->dev; in dm9000_probe()
1398 db->ndev = ndev; in dm9000_probe()
1400 spin_lock_init(&db->lock); in dm9000_probe()
1401 mutex_init(&db->addr_lock); in dm9000_probe()
1403 INIT_DELAYED_WORK(&db->phy_poll, dm9000_poll_work); in dm9000_probe()
1405 db->addr_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); in dm9000_probe()
1406 db->data_res = platform_get_resource(pdev, IORESOURCE_MEM, 1); in dm9000_probe()
1407 db->irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); in dm9000_probe()
1409 if (db->addr_res == NULL || db->data_res == NULL || in dm9000_probe()
1410 db->irq_res == NULL) { in dm9000_probe()
1411 dev_err(db->dev, "insufficient resources\n"); in dm9000_probe()
1416 db->irq_wake = platform_get_irq(pdev, 1); in dm9000_probe()
1417 if (db->irq_wake >= 0) { in dm9000_probe()
1418 dev_dbg(db->dev, "wakeup irq %d\n", db->irq_wake); in dm9000_probe()
1420 ret = request_irq(db->irq_wake, dm9000_wol_interrupt, in dm9000_probe()
1421 IRQF_SHARED, dev_name(db->dev), ndev); in dm9000_probe()
1423 dev_err(db->dev, "cannot get wakeup irq (%d)\n", ret); in dm9000_probe()
1427 ret = irq_set_irq_wake(db->irq_wake, 1); in dm9000_probe()
1429 dev_err(db->dev, "irq %d cannot set wakeup (%d)\n", in dm9000_probe()
1430 db->irq_wake, ret); in dm9000_probe()
1433 irq_set_irq_wake(db->irq_wake, 0); in dm9000_probe()
1434 db->wake_supported = 1; in dm9000_probe()
1439 iosize = resource_size(db->addr_res); in dm9000_probe()
1440 db->addr_req = request_mem_region(db->addr_res->start, iosize, in dm9000_probe()
1443 if (db->addr_req == NULL) { in dm9000_probe()
1444 dev_err(db->dev, "cannot claim address reg area\n"); in dm9000_probe()
1449 db->io_addr = ioremap(db->addr_res->start, iosize); in dm9000_probe()
1451 if (db->io_addr == NULL) { in dm9000_probe()
1452 dev_err(db->dev, "failed to ioremap address reg\n"); in dm9000_probe()
1457 iosize = resource_size(db->data_res); in dm9000_probe()
1458 db->data_req = request_mem_region(db->data_res->start, iosize, in dm9000_probe()
1461 if (db->data_req == NULL) { in dm9000_probe()
1462 dev_err(db->dev, "cannot claim data reg area\n"); in dm9000_probe()
1467 db->io_data = ioremap(db->data_res->start, iosize); in dm9000_probe()
1469 if (db->io_data == NULL) { in dm9000_probe()
1470 dev_err(db->dev, "failed to ioremap data reg\n"); in dm9000_probe()
1476 ndev->base_addr = (unsigned long)db->io_addr; in dm9000_probe()
1477 ndev->irq = db->irq_res->start; in dm9000_probe()
1480 dm9000_set_io(db, iosize); in dm9000_probe()
1488 dm9000_set_io(db, 1); in dm9000_probe()
1491 dm9000_set_io(db, 2); in dm9000_probe()
1494 dm9000_set_io(db, 4); in dm9000_probe()
1500 db->inblk = pdata->inblk; in dm9000_probe()
1503 db->outblk = pdata->outblk; in dm9000_probe()
1506 db->dumpblk = pdata->dumpblk; in dm9000_probe()
1508 db->flags = pdata->flags; in dm9000_probe()
1512 db->flags |= DM9000_PLATF_SIMPLE_PHY; in dm9000_probe()
1515 dm9000_reset(db); in dm9000_probe()
1519 id_val = ior(db, DM9000_VIDL); in dm9000_probe()
1520 id_val |= (u32)ior(db, DM9000_VIDH) << 8; in dm9000_probe()
1521 id_val |= (u32)ior(db, DM9000_PIDL) << 16; in dm9000_probe()
1522 id_val |= (u32)ior(db, DM9000_PIDH) << 24; in dm9000_probe()
1526 dev_err(db->dev, "read wrong id 0x%08x\n", id_val); in dm9000_probe()
1530 dev_err(db->dev, "wrong id: 0x%08x\n", id_val); in dm9000_probe()
1537 id_val = ior(db, DM9000_CHIPR); in dm9000_probe()
1538 dev_dbg(db->dev, "dm9000 revision 0x%02x\n", id_val); in dm9000_probe()
1542 db->type = TYPE_DM9000A; in dm9000_probe()
1545 db->type = TYPE_DM9000B; in dm9000_probe()
1548 dev_dbg(db->dev, "ID %02x => defaulting to DM9000E\n", id_val); in dm9000_probe()
1549 db->type = TYPE_DM9000E; in dm9000_probe()
1553 if (db->type == TYPE_DM9000A || db->type == TYPE_DM9000B) { in dm9000_probe()
1554 db->can_csum = 1; in dm9000_probe()
1555 db->rx_csum = 1; in dm9000_probe()
1568 db->msg_enable = NETIF_MSG_LINK; in dm9000_probe()
1569 db->mii.phy_id_mask = 0x1f; in dm9000_probe()
1570 db->mii.reg_num_mask = 0x1f; in dm9000_probe()
1571 db->mii.force_media = 0; in dm9000_probe()
1572 db->mii.full_duplex = 0; in dm9000_probe()
1573 db->mii.dev = ndev; in dm9000_probe()
1574 db->mii.mdio_read = dm9000_phy_read; in dm9000_probe()
1575 db->mii.mdio_write = dm9000_phy_write; in dm9000_probe()
1581 dm9000_read_eeprom(db, i / 2, ndev->dev_addr+i); in dm9000_probe()
1593 ndev->dev_addr[i] = ior(db, i+DM9000_PAR); in dm9000_probe()
1597 dev_warn(db->dev, "%s: Invalid ethernet MAC address. Please " in dm9000_probe()
1610 ndev->name, dm9000_type_to_char(db->type), in dm9000_probe()
1611 db->io_addr, db->io_data, ndev->irq, in dm9000_probe()
1616 dev_err(db->dev, "not found (%d).\n", ret); in dm9000_probe()
1618 dm9000_release_board(pdev, db); in dm9000_probe()
1629 board_info_t *db; in dm9000_drv_suspend() local
1632 db = netdev_priv(ndev); in dm9000_drv_suspend()
1633 db->in_suspend = 1; in dm9000_drv_suspend()
1641 if (!db->wake_state) in dm9000_drv_suspend()
1652 board_info_t *db = netdev_priv(ndev); in dm9000_drv_resume() local
1658 if (!db->wake_state) { in dm9000_drv_resume()
1659 dm9000_reset(db); in dm9000_drv_resume()
1666 db->in_suspend = 0; in dm9000_drv_resume()