Lines Matching refs:udev

105 static int mcs7830_read_reg(struct usb_device *udev, uint8_t idx,  in mcs7830_read_reg()  argument
113 len = usb_control_msg(udev, in mcs7830_read_reg()
114 usb_rcvctrlpipe(udev, 0), in mcs7830_read_reg()
135 static int mcs7830_write_reg(struct usb_device *udev, uint8_t idx, in mcs7830_write_reg() argument
144 len = usb_control_msg(udev, in mcs7830_write_reg()
145 usb_sndctrlpipe(udev, 0), in mcs7830_write_reg()
164 static int mcs7830_phy_emit_wait(struct usb_device *udev, in mcs7830_phy_emit_wait() argument
174 rc = mcs7830_write_reg(udev, REG_PHY_CMD, sizeof(cmd), cmd); in mcs7830_phy_emit_wait()
181 rc = mcs7830_read_reg(udev, REG_PHY_CMD, sizeof(cmd), cmd); in mcs7830_phy_emit_wait()
199 static int mcs7830_read_phy(struct usb_device *udev, uint8_t index) in mcs7830_read_phy() argument
205 rc = mcs7830_phy_emit_wait(udev, PHY_CMD1_READ, index); in mcs7830_read_phy()
210 rc = mcs7830_read_reg(udev, REG_PHY_DATA, sizeof(val), &val); in mcs7830_read_phy()
225 static int mcs7830_write_phy(struct usb_device *udev, uint8_t index, in mcs7830_write_phy() argument
234 rc = mcs7830_write_reg(udev, REG_PHY_DATA, sizeof(val), &val); in mcs7830_write_phy()
239 rc = mcs7830_phy_emit_wait(udev, PHY_CMD1_WRITE, index); in mcs7830_write_phy()
255 static int mcs7830_write_config(struct usb_device *udev, in mcs7830_write_config() argument
262 rc = mcs7830_write_reg(udev, REG_CONFIG, in mcs7830_write_config()
281 static int mcs7830_write_mchash(struct usb_device *udev, in mcs7830_write_mchash() argument
288 rc = mcs7830_write_reg(udev, REG_MULTICAST_HASH, in mcs7830_write_mchash()
305 static int mcs7830_set_autoneg(struct usb_device *udev) in mcs7830_set_autoneg() argument
321 rc = mcs7830_write_phy(udev, MII_ADVERTISE, adv); in mcs7830_set_autoneg()
325 rc = mcs7830_write_phy(udev, MII_BMCR, flg); in mcs7830_set_autoneg()
329 rc = mcs7830_write_phy(udev, MII_BMCR, flg); in mcs7830_set_autoneg()
333 rc = mcs7830_write_phy(udev, MII_BMCR, flg); in mcs7830_set_autoneg()
346 static int mcs7830_get_rev(struct usb_device *udev) in mcs7830_get_rev() argument
353 rc = mcs7830_read_reg(udev, REG_FRAME_DROP_COUNTER, sizeof(buf), buf); in mcs7830_get_rev()
370 static int mcs7830_apply_fixup(struct usb_device *udev) in mcs7830_apply_fixup() argument
376 rev = mcs7830_get_rev(udev); in mcs7830_apply_fixup()
388 (void)mcs7830_write_reg(udev, REG_PAUSE_THRESHOLD, in mcs7830_apply_fixup()
406 static int mcs7830_basic_reset(struct usb_device *udev, in mcs7830_basic_reset() argument
421 rc = mcs7830_set_autoneg(udev); in mcs7830_basic_reset()
427 rc = mcs7830_write_mchash(udev, priv); in mcs7830_basic_reset()
433 rc = mcs7830_write_config(udev, priv); in mcs7830_basic_reset()
439 rc = mcs7830_apply_fixup(udev); in mcs7830_basic_reset()
457 static int mcs7830_read_mac(struct usb_device *udev, unsigned char enetaddr[]) in mcs7830_read_mac() argument
464 rc = mcs7830_read_reg(udev, REG_ETHER_ADDR, ETH_ALEN, buf); in mcs7830_read_mac()
474 static int mcs7830_write_mac_common(struct usb_device *udev, in mcs7830_write_mac_common() argument
481 rc = mcs7830_write_reg(udev, REG_ETHER_ADDR, ETH_ALEN, enetaddr); in mcs7830_write_mac_common()
489 static int mcs7830_init_common(struct usb_device *udev) in mcs7830_init_common() argument
498 have_link = mcs7830_read_phy(udev, MII_BMSR) & BMSR_LSTATUS; in mcs7830_init_common()
514 struct usb_device *udev = ueth->pusb_dev; in mcs7830_send_common() local
521 rc = usb_bulk_msg(udev, in mcs7830_send_common()
522 usb_sndbulkpipe(udev, ueth->ep_out), in mcs7830_send_common()
853 struct usb_device *udev = dev_get_parent_priv(dev); in mcs7830_eth_start() local
855 return mcs7830_init_common(udev); in mcs7830_eth_start()
895 struct usb_device *udev = dev_get_parent_priv(dev); in mcs7830_write_hwaddr() local
898 return mcs7830_write_mac_common(udev, pdata->enetaddr); in mcs7830_write_hwaddr()
903 struct usb_device *udev = dev_get_parent_priv(dev); in mcs7830_eth_probe() local
908 if (mcs7830_basic_reset(udev, priv)) in mcs7830_eth_probe()
911 if (mcs7830_read_mac(udev, pdata->enetaddr)) in mcs7830_eth_probe()