usb_dev.c (231378) | usb_dev.c (233774) |
---|---|
1/* $FreeBSD: head/sys/dev/usb/usb_dev.c 231378 2012-02-10 12:35:57Z ed $ */ | 1/* $FreeBSD: head/sys/dev/usb/usb_dev.c 233774 2012-04-02 10:50:42Z hselasky $ */ |
2/*- 3 * Copyright (c) 2006-2008 Hans Petter Selasky. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. --- 1638 unchanged lines hidden (view full) --- 1648 * 1649 * Return values: 1650 * 0: Success. 1651 * Else: Failure. 1652 *------------------------------------------------------------------------*/ 1653int 1654usb_fifo_attach(struct usb_device *udev, void *priv_sc, 1655 struct mtx *priv_mtx, struct usb_fifo_methods *pm, | 2/*- 3 * Copyright (c) 2006-2008 Hans Petter Selasky. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. --- 1638 unchanged lines hidden (view full) --- 1648 * 1649 * Return values: 1650 * 0: Success. 1651 * Else: Failure. 1652 *------------------------------------------------------------------------*/ 1653int 1654usb_fifo_attach(struct usb_device *udev, void *priv_sc, 1655 struct mtx *priv_mtx, struct usb_fifo_methods *pm, |
1656 struct usb_fifo_sc *f_sc, uint16_t unit, uint16_t subunit, | 1656 struct usb_fifo_sc *f_sc, uint16_t unit, int16_t subunit, |
1657 uint8_t iface_index, uid_t uid, gid_t gid, int mode) 1658{ 1659 struct usb_fifo *f_tx; 1660 struct usb_fifo *f_rx; 1661 char devname[32]; 1662 uint8_t n; 1663 1664 f_sc->fp[USB_FIFO_TX] = NULL; --- 60 unchanged lines hidden (view full) --- 1725 udev->fifo[f_rx->fifo_index] = f_rx; 1726 mtx_unlock(&usb_ref_lock); 1727 1728 for (n = 0; n != 4; n++) { 1729 1730 if (pm->basename[n] == NULL) { 1731 continue; 1732 } | 1657 uint8_t iface_index, uid_t uid, gid_t gid, int mode) 1658{ 1659 struct usb_fifo *f_tx; 1660 struct usb_fifo *f_rx; 1661 char devname[32]; 1662 uint8_t n; 1663 1664 f_sc->fp[USB_FIFO_TX] = NULL; --- 60 unchanged lines hidden (view full) --- 1725 udev->fifo[f_rx->fifo_index] = f_rx; 1726 mtx_unlock(&usb_ref_lock); 1727 1728 for (n = 0; n != 4; n++) { 1729 1730 if (pm->basename[n] == NULL) { 1731 continue; 1732 } |
1733 if (subunit == 0xFFFF) { | 1733 if (subunit < 0) { |
1734 if (snprintf(devname, sizeof(devname), 1735 "%s%u%s", pm->basename[n], 1736 unit, pm->postfix[n] ? 1737 pm->postfix[n] : "")) { 1738 /* ignore */ 1739 } 1740 } else { 1741 if (snprintf(devname, sizeof(devname), | 1734 if (snprintf(devname, sizeof(devname), 1735 "%s%u%s", pm->basename[n], 1736 unit, pm->postfix[n] ? 1737 pm->postfix[n] : "")) { 1738 /* ignore */ 1739 } 1740 } else { 1741 if (snprintf(devname, sizeof(devname), |
1742 "%s%u.%u%s", pm->basename[n], | 1742 "%s%u.%d%s", pm->basename[n], |
1743 unit, subunit, pm->postfix[n] ? 1744 pm->postfix[n] : "")) { 1745 /* ignore */ 1746 } 1747 } 1748 1749 /* 1750 * Distribute the symbolic links into two FIFO structures: --- 545 unchanged lines hidden --- | 1743 unit, subunit, pm->postfix[n] ? 1744 pm->postfix[n] : "")) { 1745 /* ignore */ 1746 } 1747 } 1748 1749 /* 1750 * Distribute the symbolic links into two FIFO structures: --- 545 unchanged lines hidden --- |