Home | History | Annotate | Download | only in usb

Lines Matching refs:un

282 	struct usbnet * const	un = &sc->aue_un;
287 if (usbnet_isdying(un))
296 err = usbd_do_request(un->un_udev, &req, &val);
301 device_unit(un->un_dev), reg, err, 0);
311 struct usbnet * const un = &sc->aue_un;
316 if (usbnet_isdying(un))
325 err = usbd_do_request(un->un_udev, &req, &val);
330 device_unit(un->un_dev), reg, err, 0);
340 struct usbnet * const un = &sc->aue_un;
345 if (usbnet_isdying(un))
355 err = usbd_do_request(un->un_udev, &req, &val);
360 device_unit(un->un_dev), reg, err, 0);
370 struct usbnet * const un = &sc->aue_un;
375 if (usbnet_isdying(un))
385 err = usbd_do_request(un->un_udev, &req, &val);
390 device_unit(un->un_dev), reg, err, 0);
403 struct usbnet * const un = &sc->aue_un;
418 device_xname(un->un_dev));
428 aue_read_mac(struct usbnet *un)
430 struct aue_softc *sc = usbnet_softc(un);
437 device_unit(un->un_dev), 0, 0, 0);
441 un->un_eaddr[2 * i] = (u_char)word;
442 un->un_eaddr[2 * i + 1] = (u_char)(word >> 8);
447 aue_uno_mii_read_reg(struct usbnet *un, int phy, int reg, uint16_t *val)
449 struct aue_softc *sc = usbnet_softc(un);
478 if (usbnet_isdying(un)) {
488 device_unit(un->un_dev), phy, reg, 0);
496 device_unit(un->un_dev), phy, reg, *val);
502 aue_uno_mii_write_reg(struct usbnet *un, int phy, int reg, uint16_t val)
504 struct aue_softc *sc = usbnet_softc(un);
509 device_unit(un->un_dev), phy, reg, val);
524 if (usbnet_isdying(un))
532 device_unit(un->un_dev), phy, reg, val);
542 struct usbnet *un = ifp->if_softc;
543 struct aue_softc *sc = usbnet_softc(un);
544 struct mii_data *mii = usbnet_mii(un);
545 const bool hadlink __diagused = usbnet_havelink(un);
549 device_unit(un->un_dev), (uintptr_t)ifp, hadlink, 0);
568 usbnet_set_link(un, true);
576 if (!usbnet_isdying(un) && (un->un_flags & LSYS)) {
578 aue_uno_mii_read_reg(un, 0, 0x1b, &auxmode);
579 aue_uno_mii_write_reg(un, 0, 0x1b, auxmode | 0x04);
582 if (usbnet_havelink(un) != hadlink) {
584 device_unit(un->un_dev), usbnet_havelink(un), 0, 0);
611 struct usbnet * const un = ifp->if_softc;
612 struct aue_softc * const sc = usbnet_softc(un);
613 struct ethercom * ec = usbnet_ec(un);
620 AUEHIST_CALLARGSN(5, "aue%jd: enter", device_unit(un->un_dev), 0, 0, 0);
622 if (usbnet_ispromisc(un)) {
661 if ((un->un_flags & PNA) && mii_mode)
671 struct usbnet * const un = &sc->aue_un;
675 AUEHIST_CALLARGSN(2, "aue%jd: enter", device_unit(un->un_dev), 0, 0, 0);
680 if (usbnet_isdying(un))
687 printf("%s: reset failed\n", device_xname(un->un_dev));
691 if (sc->sc_mii_mode && (un->un_flags & PNA))
706 if (un->un_flags & LSYS) {
717 if (un->un_flags & PII)
722 //usbd_delay_ms(un->un_udev, 10); /* XXX */
724 DPRINTFN(2, "aue%jd: exit", device_unit(un->un_dev), 0, 0, 0);
768 struct usbnet * const un = &sc->aue_un;
781 KASSERT((void *)sc == un);
789 un->un_dev = self;
790 un->un_udev = dev;
791 un->un_sc = sc;
792 un->un_ops = &aue_ops;
793 un->un_intr = &sc->aue_intr;
794 un->un_rx_xfer_flags = USBD_SHORT_XFER_OK;
795 un->un_tx_xfer_flags = USBD_FORCE_SHORT_XFER;
796 un->un_rx_list_cnt = AUE_RX_LIST_CNT;
797 un->un_tx_list_cnt = AUE_RX_LIST_CNT;
798 un->un_rx_bufsz = AUE_BUFSZ;
799 un->un_tx_bufsz = AUE_BUFSZ;
812 err = usbd_device2interface_handle(dev, AUE_IFACE_IDX, &un->un_iface);
818 un->un_flags = aue_lookup(uaa->uaa_vendor, uaa->uaa_product)->aue_flags;
820 id = usbd_get_interface_descriptor(un->un_iface);
824 ed = usbd_interface2endpoint_descriptor(un->un_iface, i);
832 un->un_ed[USBNET_ENDPT_RX] = ed->bEndpointAddress;
835 un->un_ed[USBNET_ENDPT_TX] = ed->bEndpointAddress;
838 un->un_ed[USBNET_ENDPT_INTR] = ed->bEndpointAddress;
842 if (un->un_ed[USBNET_ENDPT_RX] == 0 ||
843 un->un_ed[USBNET_ENDPT_TX] == 0 ||
844 un->un_ed[USBNET_ENDPT_INTR] == 0) {
850 usbnet_attach(un);
854 aue_read_mac(un);
856 usbnet_attach_ifp(un, IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST,
861 aue_uno_intr(struct usbnet *un, usbd_status status)
863 struct ifnet *ifp = usbnet_ifp(un);
864 struct aue_softc *sc = usbnet_softc(un);
869 device_unit(un->un_dev), p->aue_txstat0, 0, 0);
879 aue_uno_rx_loop(struct usbnet *un, struct usbnet_chain *c, uint32_t total_len)
881 struct ifnet *ifp = usbnet_ifp(un);
888 device_unit(un->un_dev), total_len, 0, 0);
907 usbnet_enqueue(un, buf, pktlen, 0, 0, 0);
911 aue_uno_tx_prepare(struct usbnet *un, struct mbuf *m, struct usbnet_chain *c)
918 device_unit(un->un_dev), m->m_pkthdr.len, 0, 0);
920 if ((unsigned)m->m_pkthdr.len > un->un_tx_bufsz - 2)
940 device_unit(un->un_dev), total_len, 0, 0);
948 struct usbnet * const un = ifp->if_softc;
949 struct aue_softc *sc = usbnet_softc(un);
955 device_unit(un->un_dev), usbnet_havelink(un), 0, 0);
965 if (usbnet_ispromisc(un))
981 struct usbnet * const un = ifp->if_softc;
982 struct aue_softc * const sc = usbnet_softc(un);
985 AUEHIST_CALLARGSN(5, "aue%jd: enter", device_unit(un->un_dev), 0, 0, 0);