Lines Matching +full:fast +full:- +full:read

26  http://ptm2.cc.utu.fi/ftp/network/cards/DM9601/From_NET/DM9601-DS-P01-930914.pdf
68 err = -EINVAL; in dm_read()
85 err = -EINVAL; in dm_write()
115 mutex_lock(&dev->phy_mutex); in dm_read_shared_word()
134 netdev_err(dev->net, "%s read timed out!\n", phy ? "phy" : "eeprom"); in dm_read_shared_word()
135 ret = -EIO; in dm_read_shared_word()
142 netdev_dbg(dev->net, "read shared %d 0x%02x returned 0x%04x, %d\n", in dm_read_shared_word()
146 mutex_unlock(&dev->phy_mutex); in dm_read_shared_word()
154 mutex_lock(&dev->phy_mutex); in dm_write_shared_word()
177 netdev_err(dev->net, "%s write timed out!\n", phy ? "phy" : "eeprom"); in dm_write_shared_word()
178 ret = -EIO; in dm_write_shared_word()
185 mutex_unlock(&dev->phy_mutex); in dm_write_shared_word()
209 if ((eeprom->offset % 2) || (eeprom->len % 2)) in dm9601_get_eeprom()
210 return -EINVAL; in dm9601_get_eeprom()
212 for (i = 0; i < eeprom->len / 2; i++) { in dm9601_get_eeprom()
213 if (dm_read_eeprom_word(dev, eeprom->offset / 2 + i, in dm9601_get_eeprom()
215 return -EINVAL; in dm9601_get_eeprom()
228 netdev_dbg(dev->net, "Only internal phy supported\n"); in dm9601_mdio_read()
234 netdev_err(dev->net, "MDIO read error: %d\n", err); in dm9601_mdio_read()
238 netdev_dbg(dev->net, in dm9601_mdio_read()
252 netdev_dbg(dev->net, "Only internal phy supported\n"); in dm9601_mdio_write()
256 netdev_dbg(dev->net, "dm9601_mdio_write() phy_id=0x%02x, loc=0x%02x, val=0x%04x\n", in dm9601_mdio_write()
273 return mii_link_ok(&dev->mii); in dm9601_get_link()
280 return generic_mii_ioctl(&dev->mii, if_mii(rq), cmd, NULL); in dm9601_ioctl()
298 /* We use the 20 byte dev->data for our 8 byte filter buffer in dm9601_set_multicast()
300 u8 *hashes = (u8 *) & dev->data; in dm9601_set_multicast()
304 hashes[DM_MCAST_SIZE - 1] |= 0x80; /* broadcast address */ in dm9601_set_multicast()
306 if (net->flags & IFF_PROMISC) { in dm9601_set_multicast()
308 } else if (net->flags & IFF_ALLMULTI || in dm9601_set_multicast()
315 u32 crc = ether_crc(ETH_ALEN, ha->addr) >> 26; in dm9601_set_multicast()
326 dm_write_async(dev, DM_PHY_ADDR, ETH_ALEN, dev->net->dev_addr); in __dm9601_set_mac_address()
334 if (!is_valid_ether_addr(addr->sa_data)) { in dm9601_set_mac_address()
335 dev_err(&net->dev, "not setting invalid mac address %pM\n", in dm9601_set_mac_address()
336 addr->sa_data); in dm9601_set_mac_address()
337 return -EINVAL; in dm9601_set_mac_address()
340 eth_hw_addr_set(net, addr->sa_data); in dm9601_set_mac_address()
368 dev->net->netdev_ops = &dm9601_netdev_ops; in dm9601_bind()
369 dev->net->ethtool_ops = &dm9601_ethtool_ops; in dm9601_bind()
370 dev->net->hard_header_len += DM_TX_OVERHEAD; in dm9601_bind()
371 dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len; in dm9601_bind()
377 dev->rx_urb_size = dev->net->mtu + ETH_HLEN + DM_RX_OVERHEAD + 1; in dm9601_bind()
379 dev->mii.dev = dev->net; in dm9601_bind()
380 dev->mii.mdio_read = dm9601_mdio_read; in dm9601_bind()
381 dev->mii.mdio_write = dm9601_mdio_write; in dm9601_bind()
382 dev->mii.phy_id_mask = 0x1f; in dm9601_bind()
383 dev->mii.reg_num_mask = 0x1f; in dm9601_bind()
389 /* read MAC */ in dm9601_bind()
392 ret = -ENODEV; in dm9601_bind()
397 * Overwrite the auto-generated address only with good ones. in dm9601_bind()
400 eth_hw_addr_set(dev->net, mac); in dm9601_bind()
404 dev->net->dev_addr); in dm9601_bind()
409 netdev_err(dev->net, "Error reading chip ID\n"); in dm9601_bind()
410 ret = -ENODEV; in dm9601_bind()
419 netdev_err(dev->net, "Error reading MODE_CTRL\n"); in dm9601_bind()
420 ret = -ENODEV; in dm9601_bind()
431 dm9601_set_multicast(dev->net); in dm9601_bind()
433 dm9601_mdio_write(dev->net, dev->mii.phy_id, MII_BMCR, BMCR_RESET); in dm9601_bind()
434 dm9601_mdio_write(dev->net, dev->mii.phy_id, MII_ADVERTISE, in dm9601_bind()
436 mii_nway_restart(&dev->mii); in dm9601_bind()
451 b4..n-4: packet data in dm9601_rx_fixup()
452 bn-3..bn: ethernet crc in dm9601_rx_fixup()
455 if (unlikely(skb->len < DM_RX_OVERHEAD)) { in dm9601_rx_fixup()
456 dev_err(&dev->udev->dev, "unexpected tiny rx frame\n"); in dm9601_rx_fixup()
460 status = skb->data[0]; in dm9601_rx_fixup()
461 len = (skb->data[1] | (skb->data[2] << 8)) - 4; in dm9601_rx_fixup()
464 if (status & 0x01) dev->net->stats.rx_fifo_errors++; in dm9601_rx_fixup()
465 if (status & 0x02) dev->net->stats.rx_crc_errors++; in dm9601_rx_fixup()
466 if (status & 0x04) dev->net->stats.rx_frame_errors++; in dm9601_rx_fixup()
467 if (status & 0x20) dev->net->stats.rx_missed_errors++; in dm9601_rx_fixup()
468 if (status & 0x90) dev->net->stats.rx_length_errors++; in dm9601_rx_fixup()
489 len = skb->len + DM_TX_OVERHEAD; in dm9601_tx_fixup()
496 while ((len & 1) || !(len % dev->maxpacket)) in dm9601_tx_fixup()
499 len -= DM_TX_OVERHEAD; /* hw header doesn't count as part of length */ in dm9601_tx_fixup()
500 pad = len - skb->len; in dm9601_tx_fixup()
515 memset(skb->data + skb->len, 0, pad); in dm9601_tx_fixup()
519 skb->data[0] = len; in dm9601_tx_fixup()
520 skb->data[1] = len >> 8; in dm9601_tx_fixup()
541 if (urb->actual_length < 8) in dm9601_status()
544 buf = urb->transfer_buffer; in dm9601_status()
547 if (netif_carrier_ok(dev->net) != link) { in dm9601_status()
549 netdev_dbg(dev->net, "Link Status is: %d\n", link); in dm9601_status()
557 mii_check_media(&dev->mii, 1, 1); in dm9601_link_reset()
558 mii_ethtool_gset(&dev->mii, &ecmd); in dm9601_link_reset()
560 netdev_dbg(dev->net, "link_reset() speed: %u duplex: %d\n", in dm9601_link_reset()
579 USB_DEVICE(0x07aa, 0x9601), /* Corega FEther USB-TXC */
583 USB_DEVICE(0x0a46, 0x9601), /* Davicom USB-100 */
599 USB_DEVICE(0x0a47, 0x9601), /* Hirose USB-100 */
603 USB_DEVICE(0x0fe6, 0x8101), /* DM9601 USB to Fast Ethernet Adapter */
607 USB_DEVICE(0x0fe6, 0x9700), /* DM9601 USB to Fast Ethernet Adapter */
615 USB_DEVICE(0x0a46, 0x9620), /* DM9620 USB to Fast Ethernet Adapter */
619 USB_DEVICE(0x0a46, 0x9621), /* DM9621A USB to Fast Ethernet Adapter */
623 USB_DEVICE(0x0a46, 0x9622), /* DM9622 USB to Fast Ethernet Adapter */
627 USB_DEVICE(0x0a46, 0x0269), /* DM962OA USB to Fast Ethernet Adapter */
631 USB_DEVICE(0x0a46, 0x1269), /* DM9621A USB to Fast Ethernet Adapter */