PERFORCE change 140228 for review

Hans Petter Selasky hselasky at FreeBSD.org
Fri Apr 18 21:29:32 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=140228

Change 140228 by hselasky at hselasky_laptop001 on 2008/04/18 21:29:16

	
	Style changes by "usb_style.sh".

Affected files ...

.. //depot/projects/usb/src/sys/dev/usb/uark.c#23 edit
.. //depot/projects/usb/src/sys/dev/usb/ubsa.c#40 edit
.. //depot/projects/usb/src/sys/dev/usb/ucom.c#29 edit
.. //depot/projects/usb/src/sys/dev/usb/uftdi.c#37 edit
.. //depot/projects/usb/src/sys/dev/usb/uhci_pci.c#31 edit
.. //depot/projects/usb/src/sys/dev/usb/umass.c#46 edit
.. //depot/projects/usb/src/sys/dev/usb/ums.c#42 edit
.. //depot/projects/usb/src/sys/dev/usb/uplcom.c#42 edit
.. //depot/projects/usb/src/sys/dev/usb/usb_quirks.c#17 edit
.. //depot/projects/usb/src/sys/dev/usb/usb_template.h#9 edit
.. //depot/projects/usb/src/sys/dev/usb/usb_template_msc.c#2 edit
.. //depot/projects/usb/src/sys/dev/usb/uscanner.c#27 edit
.. //depot/projects/usb/src/sys/dev/usb/uslcom.c#2 edit

Differences ...

==== //depot/projects/usb/src/sys/dev/usb/uark.c#23 (text+ko) ====

@@ -396,9 +396,9 @@
 	uint32_t speed = t->c_ospeed;
 	uint16_t data;
 
-	/* 
-	 * NOTE: When reverse computing the baud rate from the "data"
-	 * all allowed baud rates are within 3% of the initial baud rate.
+	/*
+	 * NOTE: When reverse computing the baud rate from the "data" all
+	 * allowed baud rates are within 3% of the initial baud rate.
 	 */
 	data = (UARK_BAUD_REF + (speed / 2)) / speed;
 

==== //depot/projects/usb/src/sys/dev/usb/ubsa.c#40 (text+ko) ====

@@ -266,9 +266,9 @@
 
 static const struct ubsa_product ubsa_products[] = {
 	/* AnyData ADU-E100A/H */
-	{ USB_VENDOR_ANYDATA, USB_PRODUCT_ANYDATA_ADU_E100X },
+	{USB_VENDOR_ANYDATA, USB_PRODUCT_ANYDATA_ADU_E100X},
 	/* Axesstel MV100H */
-	{ USB_VENDOR_AXESSTEL, USB_PRODUCT_AXESSTEL_DATAMODEM },
+	{USB_VENDOR_AXESSTEL, USB_PRODUCT_AXESSTEL_DATAMODEM},
 	/* BELKIN F5U103 */
 	{USB_VENDOR_BELKIN, USB_PRODUCT_BELKIN_F5U103},
 	/* BELKIN F5U120 */
@@ -280,9 +280,9 @@
 	/* Peracom */
 	{USB_VENDOR_PERACOM, USB_PRODUCT_PERACOM_SERIAL1},
 	/* Novatel Wireless Merlin cards */
-	{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_U740 },
+	{USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_U740},
 	/* Novatel Wireless Merlin v740 */
-	{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_V740 },
+	{USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_V740},
 	/* Option Vodafone MC3G */
 	{USB_VENDOR_OPTION, USB_PRODUCT_OPTION_VODAFONEMC3G},
 	/* Option GlobeTrotter 3G */
@@ -292,10 +292,10 @@
 	/* Option GlobeTrotter 3G QUAD */
 	{USB_VENDOR_OPTION, USB_PRODUCT_OPTION_GT3GQUAD},
 	/* Huawei Mobile */
-	{ USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_MOBILE },
+	{USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_MOBILE},
 	/* Qualcomm, Inc. ZTE CDMA */
-	{ USB_VENDOR_QUALCOMMINC, USB_PRODUCT_QUALCOMMINC_CDMA_MSM },
-	{ 0, 0 }
+	{USB_VENDOR_QUALCOMMINC, USB_PRODUCT_QUALCOMMINC_CDMA_MSM},
+	{0, 0}
 };
 
 static device_method_t ubsa_methods[] = {

==== //depot/projects/usb/src/sys/dev/usb/ucom.c#29 (text+ko) ====

@@ -154,6 +154,7 @@
 static int
 ucom_modevent(module_t mod, int type, void *data)
 {
+	;				/* style fix */
 	switch (type) {
 	case MOD_LOAD:
 		break;

==== //depot/projects/usb/src/sys/dev/usb/uftdi.c#37 (text+ko) ====

@@ -148,7 +148,7 @@
 static void uftdi_stop_read(struct ucom_softc *ucom);
 static void uftdi_start_write(struct ucom_softc *ucom);
 static void uftdi_stop_write(struct ucom_softc *ucom);
-static uint8_t	uftdi_8u232am_getrate(uint32_t speed, uint16_t *rate);
+static uint8_t uftdi_8u232am_getrate(uint32_t speed, uint16_t *rate);
 
 static const struct usbd_config uftdi_config[UFTDI_ENDPT_MAX] = {
 
@@ -928,7 +928,7 @@
 {
 	/* Table of the nearest even powers-of-2 for values 0..15. */
 	static const uint8_t roundoff[16] = {
-		0, 2, 2, 4,  4,  4,  8,  8,
+		0, 2, 2, 4, 4, 4, 8, 8,
 		8, 8, 8, 8, 16, 16, 16, 16,
 	};
 	uint32_t d;
@@ -936,7 +936,7 @@
 	uint16_t result;
 
 	if ((speed < 178) || (speed > ((3000000 * 100) / 97)))
-		return (1); /* prevent numerical overflow */
+		return (1);		/* prevent numerical overflow */
 
 	/* Special cases for 2M and 3M. */
 	if ((speed >= ((3000000 * 100) / 103)) &&
@@ -949,7 +949,6 @@
 		result = 1;
 		goto done;
 	}
-
 	d = (FTDI_8U232AM_FREQ << 4) / speed;
 	d = (d & ~15) + roundoff[d & 15];
 
@@ -958,21 +957,20 @@
 	else if (d > FTDI_8U232AM_MAX_DIV)
 		d = FTDI_8U232AM_MAX_DIV;
 
-	/* 
-	 * Calculate the frequency needed for "d" to exactly divide down
-	 * to our target "speed", and check that the actual frequency is
-	 * within 3% of this.
+	/*
+	 * Calculate the frequency needed for "d" to exactly divide down to
+	 * our target "speed", and check that the actual frequency is within
+	 * 3% of this.
 	 */
 	freq = (speed * d);
 	if ((freq < ((FTDI_8U232AM_FREQ * 1600ULL) / 103)) ||
 	    (freq > ((FTDI_8U232AM_FREQ * 1600ULL) / 97)))
 		return (1);
 
-	/* 
-	 * Pack the divisor into the resultant value.  The lower
-	 * 14-bits hold the integral part, while the upper 2 bits
-	 * encode the fractional component: either 0, 0.5, 0.25, or
-	 * 0.125.
+	/*
+	 * Pack the divisor into the resultant value.  The lower 14-bits
+	 * hold the integral part, while the upper 2 bits encode the
+	 * fractional component: either 0, 0.5, 0.25, or 0.125.
 	 */
 	result = (d >> 4);
 	if (d & 8)

==== //depot/projects/usb/src/sys/dev/usb/uhci_pci.c#31 (text+ko) ====

@@ -183,29 +183,28 @@
 	if (device_id == 0x265b8086) {
 		return ("Intel 82801FB/FR/FW/FRW (ICH6) USB controller USB-D");
 	}
-
 	if (device_id == 0x28308086)
-              return ("Intel 82801H (ICH8) USB controller USB-A");
+		return ("Intel 82801H (ICH8) USB controller USB-A");
 	if (device_id == 0x28318086)
-              return ("Intel 82801H (ICH8) USB controller USB-B");
+		return ("Intel 82801H (ICH8) USB controller USB-B");
 	if (device_id == 0x28328086)
-              return ("Intel 82801H (ICH8) USB controller USB-C");
+		return ("Intel 82801H (ICH8) USB controller USB-C");
 	if (device_id == 0x28348086)
-              return ("Intel 82801H (ICH8) USB controller USB-D");
+		return ("Intel 82801H (ICH8) USB controller USB-D");
 	if (device_id == 0x28358086)
-              return ("Intel 82801H (ICH8) USB controller USB-E");
+		return ("Intel 82801H (ICH8) USB controller USB-E");
 	if (device_id == 0x29348086)
-              return ("Intel 82801I (ICH9) USB controller");
+		return ("Intel 82801I (ICH9) USB controller");
 	if (device_id == 0x29358086)
-              return ("Intel 82801I (ICH9) USB controller");
+		return ("Intel 82801I (ICH9) USB controller");
 	if (device_id == 0x29368086)
-              return ("Intel 82801I (ICH9) USB controller");
+		return ("Intel 82801I (ICH9) USB controller");
 	if (device_id == 0x29378086)
-              return ("Intel 82801I (ICH9) USB controller");
+		return ("Intel 82801I (ICH9) USB controller");
 	if (device_id == 0x29388086)
-              return ("Intel 82801I (ICH9) USB controller");
+		return ("Intel 82801I (ICH9) USB controller");
 	if (device_id == 0x29398086)
-              return ("Intel 82801I (ICH9) USB controller");
+		return ("Intel 82801I (ICH9) USB controller");
 
 	if (device_id == 0x719a8086) {
 		return ("Intel 82443MX USB controller");

==== //depot/projects/usb/src/sys/dev/usb/umass.c#46 (text+ko) ====

@@ -354,13 +354,15 @@
 	 * Device reports number of sectors from READ_CAPACITY, not max
 	 * sector number.
 	 */
-#define READ_CAPACITY_OFFBY1	0x2000
-	/* Device cannot handle a SCSI synchronize cache command.  Normally
+#define	READ_CAPACITY_OFFBY1	0x2000
+	/*
+	 * Device cannot handle a SCSI synchronize cache command.  Normally
 	 * this quirk would be handled in the cam layer, but for IDE bridges
 	 * we need to associate the quirk with the bridge and not the
-	 * underlying disk device.  This is handled by faking a success result.
+	 * underlying disk device.  This is handled by faking a success
+	 * result.
 	 */
-#define NO_SYNCHRONIZE_CACHE	0x4000
+#define	NO_SYNCHRONIZE_CACHE	0x4000
 };
 
 static const struct umass_devdescr umass_devdescr[] = {
@@ -604,9 +606,9 @@
 		UMASS_PROTO_SCSI | UMASS_PROTO_BBB,
 		NO_INQUIRY
 	},
-	{ USB_VENDOR_NETAC, USB_PRODUCT_NETAC_ONLYDISK, RID_WILDCARD,
-	  UMASS_PROTO_SCSI | UMASS_PROTO_BBB,
-	  IGNORE_RESIDUE
+	{USB_VENDOR_NETAC, USB_PRODUCT_NETAC_ONLYDISK, RID_WILDCARD,
+		UMASS_PROTO_SCSI | UMASS_PROTO_BBB,
+		IGNORE_RESIDUE
 	},
 	{USB_VENDOR_NETCHIP, USB_PRODUCT_NETCHIP_CLIK_40, RID_WILDCARD,
 		UMASS_PROTO_ATAPI,
@@ -848,9 +850,9 @@
 		UMASS_PROTO_SCSI | UMASS_PROTO_BBB,
 		NO_QUIRKS
 	},
-	{ USB_VENDOR_VIA, USB_PRODUCT_VIA_USB2IDEBRIDGE, RID_WILDCARD,
-	  UMASS_PROTO_SCSI | UMASS_PROTO_BBB,
-	  NO_SYNCHRONIZE_CACHE
+	{USB_VENDOR_VIA, USB_PRODUCT_VIA_USB2IDEBRIDGE, RID_WILDCARD,
+		UMASS_PROTO_SCSI | UMASS_PROTO_BBB,
+		NO_SYNCHRONIZE_CACHE
 	},
 	{USB_VENDOR_VIVITAR, USB_PRODUCT_VIVITAR_35XX, RID_WILDCARD,
 		UMASS_PROTO_SCSI | UMASS_PROTO_BBB,
@@ -2944,7 +2946,7 @@
 						ccb->csio.dxfer_len = SHORT_INQUIRY_LENGTH;
 					}
 				} else if (sc->sc_transfer.cmd_data[0] == SYNCHRONIZE_CACHE) {
-		  			if (sc->sc_quirks & NO_SYNCHRONIZE_CACHE) {
+					if (sc->sc_quirks & NO_SYNCHRONIZE_CACHE) {
 						ccb->csio.scsi_status = SCSI_STATUS_OK;
 						ccb->ccb_h.status = CAM_REQ_CMP;
 						xpt_done(ccb);

==== //depot/projects/usb/src/sys/dev/usb/ums.c#42 (text+ko) ====

@@ -261,7 +261,6 @@
 		if (sc->sc_flags & UMS_FLAG_REVZ) {
 			dz = -dz;
 		}
-
 		dt = (sc->sc_flags & UMS_FLAG_T_AXIS) ?
 		    -hid_get_data(buf, len, &sc->sc_loc_t): 0;
 
@@ -272,7 +271,7 @@
 		}
 
 		if (dx || dy || dz || dt || dw ||
-			(buttons != sc->sc_status.button)) {
+		    (buttons != sc->sc_status.button)) {
 
 			DPRINTF(5, "x:%d y:%d z:%d t:%d w:%d buttons:0x%08x\n",
 			    dx, dy, dz, dt, dw, buttons);
@@ -376,7 +375,6 @@
 	    (id->bInterfaceClass != UICLASS_HID)) {
 		return (UMATCH_NONE);
 	}
-
 	error = hid_read_report_desc_from_usb
 	    (uaa->device, &usb_global_lock,
 	    &d_ptr, &d_len, M_TEMP, uaa->iface_index);
@@ -384,9 +382,8 @@
 	if (error) {
 		return (UMATCH_NONE);
 	}
-
 	if (hid_is_collection(d_ptr, d_len,
-	      HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_MOUSE))) {
+	    HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_MOUSE))) {
 		error = UMATCH_IFACECLASS;
 	} else if ((id->bInterfaceSubClass == UISUBCLASS_BOOT) &&
 	    (id->bInterfaceProtocol == UIPROTO_MOUSE)) {
@@ -462,34 +459,31 @@
 			sc->sc_flags |= UMS_FLAG_Y_AXIS;
 		}
 	}
-
 	/* Try the wheel first as the Z activator since it's tradition. */
 	if (hid_locate(d_ptr, d_len, HID_USAGE2(HUP_GENERIC_DESKTOP,
-	  HUG_WHEEL), hid_input, &sc->sc_loc_z, &flags)) {
+	    HUG_WHEEL), hid_input, &sc->sc_loc_z, &flags)) {
 
 		if ((flags & MOUSE_FLAGS_MASK) == MOUSE_FLAGS) {
 			sc->sc_flags |= UMS_FLAG_Z_AXIS;
 		}
-
 		/*
 		 * We might have both a wheel and Z direction, if so put
 		 * put the Z on the W coordinate.
 		 */
 		if (hid_locate(d_ptr, d_len, HID_USAGE2(HUP_GENERIC_DESKTOP,
-		      HUG_Z), hid_input, &sc->sc_loc_w, &flags)) {
+		    HUG_Z), hid_input, &sc->sc_loc_w, &flags)) {
 
 			if ((flags & MOUSE_FLAGS_MASK) == MOUSE_FLAGS) {
 				sc->sc_flags |= UMS_FLAG_W_AXIS;
 			}
 		}
-	} else 	if (hid_locate(d_ptr, d_len, HID_USAGE2(HUP_GENERIC_DESKTOP,
-		      HUG_Z), hid_input, &sc->sc_loc_z, &flags)) {
+	} else if (hid_locate(d_ptr, d_len, HID_USAGE2(HUP_GENERIC_DESKTOP,
+	    HUG_Z), hid_input, &sc->sc_loc_z, &flags)) {
 
 		if ((flags & MOUSE_FLAGS_MASK) == MOUSE_FLAGS) {
 			sc->sc_flags |= UMS_FLAG_Z_AXIS;
 		}
 	}
-
 	/*
 	 * The Microsoft Wireless Intellimouse 2.0 reports it's wheel
 	 * using 0x0048, which is HUG_TWHEEL, and seems to expect you

==== //depot/projects/usb/src/sys/dev/usb/uplcom.c#42 (text+ko) ====

@@ -288,9 +288,9 @@
 	/* I/O DATA USB-RSAQ3 */
 	{USB_VENDOR_PROLIFIC, USB_PRODUCT_PROLIFIC_RSAQ3, 0xFFFF, TYPE_PL2303X},
 	/* PLANEX USB-RS232 URS-03 */
-	{ USB_VENDOR_ATEN, USB_PRODUCT_ATEN_UC232A, 0xFFFF, TYPE_PL2303 },
+	{USB_VENDOR_ATEN, USB_PRODUCT_ATEN_UC232A, 0xFFFF, TYPE_PL2303},
 	/* TrendNet TU-S9 */
-	{ USB_VENDOR_PROLIFIC, USB_PRODUCT_PROLIFIC_PL2303, 0x0400, TYPE_PL2303X },
+	{USB_VENDOR_PROLIFIC, USB_PRODUCT_PROLIFIC_PL2303, 0x0400, TYPE_PL2303X},
 	/* ST Lab USB-SERIAL-4 */
 	{USB_VENDOR_PROLIFIC, USB_PRODUCT_PROLIFIC_PL2303, 0x0300, TYPE_PL2303X},
 	/* IOGEAR/ATEN UC-232A (also ST Lab USB-SERIAL-1) */

==== //depot/projects/usb/src/sys/dev/usb/usb_quirks.c#17 (text+ko) ====

@@ -59,7 +59,7 @@
 };
 
 static const struct usbd_quirk_entry usb_quirks[] = {
-	{ USB_VENDOR_ASUS, USB_PRODUCT_ASUS_LCM, ANY, { UQ_HID_IGNORE }},
+	{USB_VENDOR_ASUS, USB_PRODUCT_ASUS_LCM, ANY, {UQ_HID_IGNORE}},
 	{USB_VENDOR_INSIDEOUT, USB_PRODUCT_INSIDEOUT_EDGEPORT4,
 	0x094, {UQ_SWAP_UNICODE}},
 	{USB_VENDOR_DALLAS, USB_PRODUCT_DALLAS_J6502, 0x0a2, {UQ_BAD_ADC}},

==== //depot/projects/usb/src/sys/dev/usb/usb_template.h#9 (text+ko) ====

@@ -89,6 +89,6 @@
 /* prototypes */
 
 extern const struct usb_temp_device_desc usb_template_cdce;
-extern const struct usb_temp_device_desc usb_template_msc; /* Mass Storage Class */
+extern const struct usb_temp_device_desc usb_template_msc;	/* Mass Storage Class */
 
 #endif					/* _USB_TEMPLATE_H_ */

==== //depot/projects/usb/src/sys/dev/usb/usb_template_msc.c#2 (text+ko) ====

@@ -79,7 +79,7 @@
 #define	STRING_MSC_SERIAL \
   'M', 0, 'a', 0, 'r', 0, 'c', 0, \
   'h', 0, ' ', 0, '2', 0, '0', 0, \
-  '0', 0, '8', 0, 
+  '0', 0, '8', 0,
 
 /* make the real string descriptors */
 

==== //depot/projects/usb/src/sys/dev/usb/uscanner.c#27 (text+ko) ====

@@ -250,7 +250,7 @@
 	{{USB_VENDOR_EPSON, USB_PRODUCT_EPSON_RX425}, 0},
 	{{USB_VENDOR_EPSON, USB_PRODUCT_EPSON_3200}, USCANNER_FLAG_KEEP_OPEN},
 	{{USB_VENDOR_EPSON, USB_PRODUCT_EPSON_GT9700F}, USCANNER_FLAG_KEEP_OPEN},
-	{{ USB_VENDOR_EPSON, USB_PRODUCT_EPSON_CX5400 }, 0 },
+	{{USB_VENDOR_EPSON, USB_PRODUCT_EPSON_CX5400}, 0},
 
 	{{USB_VENDOR_EPSON, USB_PRODUCT_EPSON_GT9300UF}, 0},
 	{{USB_VENDOR_EPSON, USB_PRODUCT_EPSON_2480}, 0},

==== //depot/projects/usb/src/sys/dev/usb/uslcom.c#2 (text+ko) ====

@@ -37,62 +37,63 @@
 #include <dev/usb/ucomvar.h>
 
 #ifdef USLCOM_DEBUG
-#define DPRINTFN(n, x)  do { if (uslcomdebug > (n)) printf x; } while (0)
+#define	DPRINTFN(n, x)  do { if (uslcomdebug > (n)) printf x; } while (0)
 int	uslcomdebug = 1;
+
 #else
-#define DPRINTFN(n, x)
+#define	DPRINTFN(n, x)
 #endif
-#define DPRINTF(x) DPRINTFN(0, x)
+#define	DPRINTF(x) DPRINTFN(0, x)
 
-#define USLCOMBUFSZ		256
-#define USLCOM_CONFIG_NO	0
-#define USLCOM_IFACE_NO		0
+#define	USLCOMBUFSZ		256
+#define	USLCOM_CONFIG_NO	0
+#define	USLCOM_IFACE_NO		0
 
-#define USLCOM_SET_DATA_BITS(x)	(x << 8)
+#define	USLCOM_SET_DATA_BITS(x)	(x << 8)
 
-#define USLCOM_WRITE		0x41
-#define USLCOM_READ		0xc1
+#define	USLCOM_WRITE		0x41
+#define	USLCOM_READ		0xc1
 
-#define USLCOM_UART		0x00
-#define USLCOM_BAUD_RATE	0x01	
-#define USLCOM_DATA		0x03
-#define USLCOM_BREAK		0x05
-#define USLCOM_CTRL		0x07
+#define	USLCOM_UART		0x00
+#define	USLCOM_BAUD_RATE	0x01
+#define	USLCOM_DATA		0x03
+#define	USLCOM_BREAK		0x05
+#define	USLCOM_CTRL		0x07
 
-#define USLCOM_UART_DISABLE	0x00
-#define USLCOM_UART_ENABLE	0x01
+#define	USLCOM_UART_DISABLE	0x00
+#define	USLCOM_UART_ENABLE	0x01
 
-#define USLCOM_CTRL_DTR_ON	0x0001	
-#define USLCOM_CTRL_DTR_SET	0x0100
-#define USLCOM_CTRL_RTS_ON	0x0002
-#define USLCOM_CTRL_RTS_SET	0x0200
-#define USLCOM_CTRL_CTS		0x0010
-#define USLCOM_CTRL_DSR		0x0020
-#define USLCOM_CTRL_DCD		0x0080
+#define	USLCOM_CTRL_DTR_ON	0x0001
+#define	USLCOM_CTRL_DTR_SET	0x0100
+#define	USLCOM_CTRL_RTS_ON	0x0002
+#define	USLCOM_CTRL_RTS_SET	0x0200
+#define	USLCOM_CTRL_CTS		0x0010
+#define	USLCOM_CTRL_DSR		0x0020
+#define	USLCOM_CTRL_DCD		0x0080
 
 
-#define USLCOM_BAUD_REF		0x384000
+#define	USLCOM_BAUD_REF		0x384000
 
-#define USLCOM_STOP_BITS_1	0x00
-#define USLCOM_STOP_BITS_2	0x02
+#define	USLCOM_STOP_BITS_1	0x00
+#define	USLCOM_STOP_BITS_2	0x02
 
-#define USLCOM_PARITY_NONE	0x00
-#define USLCOM_PARITY_ODD	0x10
-#define USLCOM_PARITY_EVEN	0x20
+#define	USLCOM_PARITY_NONE	0x00
+#define	USLCOM_PARITY_ODD	0x10
+#define	USLCOM_PARITY_EVEN	0x20
 
-#define USLCOM_BREAK_OFF	0x00
-#define USLCOM_BREAK_ON		0x01
+#define	USLCOM_BREAK_OFF	0x00
+#define	USLCOM_BREAK_ON		0x01
 
 
 struct uslcom_softc {
-	struct ucom_softc	 sc_ucom;
-	device_t		 sc_dev;
-	usbd_device_handle	 sc_udev;
+	struct ucom_softc sc_ucom;
+	device_t sc_dev;
+	usbd_device_handle sc_udev;
 
-	u_char			 sc_msr;
-	u_char			 sc_lsr;
+	u_char	sc_msr;
+	u_char	sc_lsr;
 
-	u_char			 sc_dying;
+	u_char	sc_dying;
 };
 
 void	uslcom_get_status(void *, int portno, u_char *lsr, u_char *msr);
@@ -114,24 +115,24 @@
 };
 
 static const struct usb_devno uslcom_devs[] = {
-	{ USB_VENDOR_BALTECH,		USB_PRODUCT_BALTECH_CARDREADER },
-	{ USB_VENDOR_DYNASTREAM,	USB_PRODUCT_DYNASTREAM_ANTDEVBOARD },
-	{ USB_VENDOR_JABLOTRON,		USB_PRODUCT_JABLOTRON_PC60B },
-	{ USB_VENDOR_SILABS,		USB_PRODUCT_SILABS_ARGUSISP },
-	{ USB_VENDOR_SILABS,		USB_PRODUCT_SILABS_CRUMB128 },
-	{ USB_VENDOR_SILABS,		USB_PRODUCT_SILABS_DEGREE },
-	{ USB_VENDOR_SILABS,		USB_PRODUCT_SILABS_BURNSIDE },
-	{ USB_VENDOR_SILABS,		USB_PRODUCT_SILABS_HELICOM },
-	{ USB_VENDOR_SILABS,		USB_PRODUCT_SILABS_LIPOWSKY_HARP },
-	{ USB_VENDOR_SILABS,		USB_PRODUCT_SILABS_LIPOWSKY_JTAG },
-	{ USB_VENDOR_SILABS,		USB_PRODUCT_SILABS_LIPOWSKY_LIN },
-	{ USB_VENDOR_SILABS,		USB_PRODUCT_SILABS_POLOLU },
-	{ USB_VENDOR_SILABS,		USB_PRODUCT_SILABS_CP2102 },
-	{ USB_VENDOR_SILABS,		USB_PRODUCT_SILABS_CP210X_2 },
-	{ USB_VENDOR_SILABS,		USB_PRODUCT_SILABS_SUUNTO },
-	{ USB_VENDOR_SILABS,		USB_PRODUCT_SILABS_TRAQMATE },
-	{ USB_VENDOR_SILABS2,		USB_PRODUCT_SILABS2_DCU11CLONE },
-	{ USB_VENDOR_USI,		USB_PRODUCT_USI_MC60 }
+	{USB_VENDOR_BALTECH, USB_PRODUCT_BALTECH_CARDREADER},
+	{USB_VENDOR_DYNASTREAM, USB_PRODUCT_DYNASTREAM_ANTDEVBOARD},
+	{USB_VENDOR_JABLOTRON, USB_PRODUCT_JABLOTRON_PC60B},
+	{USB_VENDOR_SILABS, USB_PRODUCT_SILABS_ARGUSISP},
+	{USB_VENDOR_SILABS, USB_PRODUCT_SILABS_CRUMB128},
+	{USB_VENDOR_SILABS, USB_PRODUCT_SILABS_DEGREE},
+	{USB_VENDOR_SILABS, USB_PRODUCT_SILABS_BURNSIDE},
+	{USB_VENDOR_SILABS, USB_PRODUCT_SILABS_HELICOM},
+	{USB_VENDOR_SILABS, USB_PRODUCT_SILABS_LIPOWSKY_HARP},
+	{USB_VENDOR_SILABS, USB_PRODUCT_SILABS_LIPOWSKY_JTAG},
+	{USB_VENDOR_SILABS, USB_PRODUCT_SILABS_LIPOWSKY_LIN},
+	{USB_VENDOR_SILABS, USB_PRODUCT_SILABS_POLOLU},
+	{USB_VENDOR_SILABS, USB_PRODUCT_SILABS_CP2102},
+	{USB_VENDOR_SILABS, USB_PRODUCT_SILABS_CP210X_2},
+	{USB_VENDOR_SILABS, USB_PRODUCT_SILABS_SUUNTO},
+	{USB_VENDOR_SILABS, USB_PRODUCT_SILABS_TRAQMATE},
+	{USB_VENDOR_SILABS2, USB_PRODUCT_SILABS2_DCU11CLONE},
+	{USB_VENDOR_USI, USB_PRODUCT_USI_MC60}
 };
 
 static device_probe_t uslcom_match;
@@ -143,13 +144,13 @@
 	DEVMETHOD(device_probe, uslcom_match),
 	DEVMETHOD(device_attach, uslcom_attach),
 	DEVMETHOD(device_detach, uslcom_detach),
-	{ 0, 0 }
+	{0, 0}
 };
 
 static driver_t uslcom_driver = {
 	"ucom",
 	uslcom_methods,
-	sizeof (struct uslcom_softc)
+	sizeof(struct uslcom_softc)
 };
 
 DRIVER_MODULE(uslcom, uhub, uslcom_driver, ucom_devclass, usbd_driver_load, 0);
@@ -175,7 +176,7 @@
 	struct uslcom_softc *sc = device_get_softc(self);
 	struct usb_attach_arg *uaa = device_get_ivars(self);
 	usbd_device_handle dev = uaa->device;
-	struct ucom_softc* ucom;
+	struct ucom_softc *ucom;
 	usb_interface_descriptor_t *id;
 	usb_endpoint_descriptor_t *ed;
 	usbd_status error;
@@ -185,7 +186,7 @@
 	ucom->sc_dev = self;
 	ucom->sc_udev = dev;
 	ucom->sc_iface = uaa->iface;
-	
+
 	sc->sc_dev = self;
 	sc->sc_udev = uaa->device;
 
@@ -194,7 +195,6 @@
 		sc->sc_dying = 1;
 		return ENXIO;
 	}
-
 	/* get the first interface handle */
 	error = usbd_device2interface_handle(sc->sc_udev, USLCOM_IFACE_NO,
 	    &ucom->sc_iface);
@@ -203,7 +203,6 @@
 		sc->sc_dying = 1;
 		return ENXIO;
 	}
-
 	id = usbd_get_interface_descriptor(ucom->sc_iface);
 
 	ucom->sc_bulkin_no = ucom->sc_bulkout_no = -1;
@@ -215,7 +214,6 @@
 			sc->sc_dying = 1;
 			return ENXIO;
 		}
-
 		if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN &&
 		    UE_GET_XFERTYPE(ed->bmAttributes) == UE_BULK)
 			ucom->sc_bulkin_no = ed->bEndpointAddress;
@@ -229,7 +227,6 @@
 		sc->sc_dying = 1;
 		return ENXIO;
 	}
-
 	ucom->sc_parent = sc;
 	ucom->sc_portno = UCOM_UNK_PORTNO;
 	/* bulkin, bulkout set above */
@@ -239,11 +236,11 @@
 	ucom->sc_opkthdrlen = 0;
 	ucom->sc_callback = &uslcom_callback;
 
-        DPRINTF(("uslcom: in = 0x%x, out = 0x%x\n",
-                 ucom->sc_bulkin_no, ucom->sc_bulkout_no));
+	DPRINTF(("uslcom: in = 0x%x, out = 0x%x\n",
+	    ucom->sc_bulkin_no, ucom->sc_bulkout_no));
 
-        ucom_attach(&sc->sc_ucom);
-        return 0;
+	ucom_attach(&sc->sc_ucom);
+	return 0;
 }
 
 static int
@@ -381,10 +378,10 @@
 
 #if 0
 	/* XXX flow control */
-	if (ISSET(t->c_cflag, CRTSCTS))
-		/*  rts/cts flow ctl */
-	} else if (ISSET(t->c_iflag, IXON|IXOFF)) {
-		/*  xon/xoff flow ctl */
+	if (ISSET(t->c_cflag, CRTSCTS)) {
+		/* rts/cts flow ctl */
+	} else if (ISSET(t->c_iflag, IXON | IXOFF)) {
+		/* xon/xoff flow ctl */
 	} else {
 		/* disable flow ctl */
 	}
@@ -397,7 +394,7 @@
 uslcom_get_status(void *vsc, int portno, u_char *lsr, u_char *msr)
 {
 	struct uslcom_softc *sc = vsc;
-	
+
 	if (msr != NULL)
 		*msr = sc->sc_msr;
 	if (lsr != NULL)
@@ -409,7 +406,7 @@
 {
 	struct uslcom_softc *sc = vsc;
 	usb_device_request_t req;
-	int brk = onoff ? USLCOM_BREAK_ON : USLCOM_BREAK_OFF;	
+	int brk = onoff ? USLCOM_BREAK_ON : USLCOM_BREAK_OFF;
 
 	req.bmRequestType = USLCOM_WRITE;
 	req.bRequest = USLCOM_BREAK;
@@ -418,5 +415,5 @@
 	USETW(req.wLength, 0);
 	usbd_do_request(sc->sc_udev, &req, NULL);
 }
+
 #endif
-


More information about the p4-projects mailing list