Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 May 2009 00:22:57 +0000 (UTC)
From:      Andrew Thompson <thompsa@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r193074 - in head/sys/dev/usb: . controller
Message-ID:  <200905300022.n4U0MvAc091062@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: thompsa
Date: Sat May 30 00:22:57 2009
New Revision: 193074
URL: http://svn.freebsd.org/changeset/base/193074

Log:
  Revert the size_t part of the last commit for the moment, this blows up the
  USB_ADD_BYTES macro.

Modified:
  head/sys/dev/usb/controller/usb_controller.c
  head/sys/dev/usb/usb_bus.h
  head/sys/dev/usb/usb_busdma.c
  head/sys/dev/usb/usb_busdma.h
  head/sys/dev/usb/usb_compat_linux.c
  head/sys/dev/usb/usb_compat_linux.h
  head/sys/dev/usb/usb_controller.h
  head/sys/dev/usb/usb_core.h
  head/sys/dev/usb/usb_dev.c
  head/sys/dev/usb/usb_dev.h
  head/sys/dev/usb/usb_device.h
  head/sys/dev/usb/usb_hid.c
  head/sys/dev/usb/usb_hid.h
  head/sys/dev/usb/usb_hub.c
  head/sys/dev/usb/usb_hub.h
  head/sys/dev/usb/usb_lookup.c
  head/sys/dev/usb/usb_lookup.h
  head/sys/dev/usb/usb_mbuf.c
  head/sys/dev/usb/usb_mbuf.h
  head/sys/dev/usb/usb_msctest.c
  head/sys/dev/usb/usb_process.c
  head/sys/dev/usb/usb_process.h
  head/sys/dev/usb/usb_transfer.c
  head/sys/dev/usb/usb_transfer.h

Modified: head/sys/dev/usb/controller/usb_controller.c
==============================================================================
--- head/sys/dev/usb/controller/usb_controller.c	Fri May 29 23:41:31 2009	(r193073)
+++ head/sys/dev/usb/controller/usb_controller.c	Sat May 30 00:22:57 2009	(r193074)
@@ -485,7 +485,7 @@ SYSUNINIT(usb2_bus_unload, SI_SUB_KLD, S
 #if USB_HAVE_BUSDMA
 static void
 usb2_bus_mem_flush_all_cb(struct usb_bus *bus, struct usb_page_cache *pc,
-    struct usb_page *pg, size_t size, size_t align)
+    struct usb_page *pg, usb_size_t size, usb_size_t align)
 {
 	usb2_pc_cpu_flush(pc);
 }
@@ -510,7 +510,7 @@ usb2_bus_mem_flush_all(struct usb_bus *b
 #if USB_HAVE_BUSDMA
 static void
 usb2_bus_mem_alloc_all_cb(struct usb_bus *bus, struct usb_page_cache *pc,
-    struct usb_page *pg, size_t size, size_t align)
+    struct usb_page *pg, usb_size_t size, usb_size_t align)
 {
 	/* need to initialize the page cache */
 	pc->tag_parent = bus->dma_parent_tag;
@@ -570,7 +570,7 @@ usb2_bus_mem_alloc_all(struct usb_bus *b
 #if USB_HAVE_BUSDMA
 static void
 usb2_bus_mem_free_all_cb(struct usb_bus *bus, struct usb_page_cache *pc,
-    struct usb_page *pg, size_t size, size_t align)
+    struct usb_page *pg, usb_size_t size, usb_size_t align)
 {
 	usb2_pc_free_mem(pc);
 }

Modified: head/sys/dev/usb/usb_bus.h
==============================================================================
--- head/sys/dev/usb/usb_bus.h	Fri May 29 23:41:31 2009	(r193073)
+++ head/sys/dev/usb/usb_bus.h	Sat May 30 00:22:57 2009	(r193074)
@@ -87,7 +87,7 @@ struct usb_bus {
 	struct usb_device **devices;
 
 	usb_power_mask_t hw_power_state;	/* see USB_HW_POWER_XXX */
-	size_t uframe_usage[USB_HS_MICRO_FRAMES_MAX];
+	usb_size_t uframe_usage[USB_HS_MICRO_FRAMES_MAX];
 
 	uint16_t isoc_time_last;	/* in milliseconds */
 

Modified: head/sys/dev/usb/usb_busdma.c
==============================================================================
--- head/sys/dev/usb/usb_busdma.c	Fri May 29 23:41:31 2009	(r193073)
+++ head/sys/dev/usb/usb_busdma.c	Sat May 30 00:22:57 2009	(r193074)
@@ -42,7 +42,7 @@
 #include <dev/usb/usb_bus.h>
 
 #if USB_HAVE_BUSDMA
-static void	usb2_dma_tag_create(struct usb_dma_tag *, size_t, size_t);
+static void	usb2_dma_tag_create(struct usb_dma_tag *, usb_size_t, usb_size_t);
 static void	usb2_dma_tag_destroy(struct usb_dma_tag *);
 static void	usb2_dma_lock_cb(void *, bus_dma_lock_op_t);
 static void	usb2_pc_alloc_mem_cb(void *, bus_dma_segment_t *, int, int);
@@ -189,7 +189,7 @@ usb2_m_copy_in_cb(void *arg, void *src, 
 
 void
 usb2_m_copy_in(struct usb_page_cache *cache, usb_frlength_t dst_offset,
-    struct mbuf *m, size_t src_offset, usb_frlength_t src_len)
+    struct mbuf *m, usb_size_t src_offset, usb_frlength_t src_len)
 {
 	struct usb2_m_copy_in_arg arg = {cache, dst_offset};
 	int error;
@@ -332,7 +332,7 @@ usb2_dma_lock_cb(void *arg, bus_dma_lock
  *------------------------------------------------------------------------*/
 static void
 usb2_dma_tag_create(struct usb_dma_tag *udt,
-    size_t size, size_t align)
+    usb_size_t size, usb_size_t align)
 {
 	bus_dma_tag_t tag;
 
@@ -397,7 +397,7 @@ usb2_pc_common_mem_cb(void *arg, bus_dma
 	struct usb_dma_parent_tag *uptag;
 	struct usb_page_cache *pc;
 	struct usb_page *pg;
-	size_t rem;
+	usb_size_t rem;
 	uint8_t owned;
 
 	pc = arg;
@@ -460,7 +460,7 @@ done:
  *------------------------------------------------------------------------*/
 uint8_t
 usb2_pc_alloc_mem(struct usb_page_cache *pc, struct usb_page *pg,
-    size_t size, size_t align)
+    usb_size_t size, usb_size_t align)
 {
 	struct usb_dma_parent_tag *uptag;
 	struct usb_dma_tag *utag;
@@ -583,7 +583,7 @@ usb2_pc_free_mem(struct usb_page_cache *
  * Else: Error
  *------------------------------------------------------------------------*/
 uint8_t
-usb2_pc_load_mem(struct usb_page_cache *pc, size_t size, uint8_t sync)
+usb2_pc_load_mem(struct usb_page_cache *pc, usb_size_t size, uint8_t sync)
 {
 	/* setup page cache */
 	pc->page_offset_buf = 0;
@@ -684,7 +684,7 @@ usb2_pc_cpu_flush(struct usb_page_cache 
  * Else: Failure
  *------------------------------------------------------------------------*/
 uint8_t
-usb2_pc_dmamap_create(struct usb_page_cache *pc, size_t size)
+usb2_pc_dmamap_create(struct usb_page_cache *pc, usb_size_t size)
 {
 	struct usb_xfer_root *info;
 	struct usb_dma_tag *utag;
@@ -733,7 +733,7 @@ usb2_pc_dmamap_destroy(struct usb_page_c
  *------------------------------------------------------------------------*/
 struct usb_dma_tag *
 usb2_dma_tag_find(struct usb_dma_parent_tag *udpt,
-    size_t size, size_t align)
+    usb_size_t size, usb_size_t align)
 {
 	struct usb_dma_tag *udt;
 	uint8_t nudt;

Modified: head/sys/dev/usb/usb_busdma.h
==============================================================================
--- head/sys/dev/usb/usb_busdma.h	Fri May 29 23:41:31 2009	(r193073)
+++ head/sys/dev/usb/usb_busdma.h	Sat May 30 00:22:57 2009	(r193074)
@@ -75,7 +75,7 @@ struct usb_page_search {
 #if USB_HAVE_BUSDMA
 	bus_size_t physaddr;
 #endif
-	size_t length;
+	usb_size_t length;
 };
 
 /*
@@ -92,8 +92,8 @@ struct usb_page_cache {
 	struct usb_dma_parent_tag *tag_parent;	/* always set */
 	void   *buffer;			/* virtual buffer pointer */
 #if USB_HAVE_BUSDMA
-	size_t page_offset_buf;
-	size_t page_offset_end;
+	usb_size_t page_offset_buf;
+	usb_size_t page_offset_end;
 	uint8_t	isread:1;		/* set if we are currently reading
 					 * from the memory. Else write. */
 	uint8_t	ismultiseg:1;		/* set if we can have multiple
@@ -127,8 +127,8 @@ struct usb_dma_parent_tag {};		/* empty 
 struct usb_dma_tag {
 	struct usb_dma_parent_tag *tag_parent;
 	bus_dma_tag_t tag;
-	size_t align;
-	size_t size;
+	usb_size_t align;
+	usb_size_t size;
 };
 #else
 struct usb_dma_tag {};			/* empty struct */
@@ -139,11 +139,11 @@ struct usb_dma_tag {};			/* empty struct
 int	usb2_uiomove(struct usb_page_cache *pc, struct uio *uio,
 	    usb_frlength_t pc_offset, usb_frlength_t len);
 struct usb_dma_tag *usb2_dma_tag_find(struct usb_dma_parent_tag *udpt,
-	    size_t size, size_t align);
+	    usb_size_t size, usb_size_t align);
 uint8_t	usb2_pc_alloc_mem(struct usb_page_cache *pc, struct usb_page *pg,
-	    size_t size, size_t align);
-uint8_t	usb2_pc_dmamap_create(struct usb_page_cache *pc, size_t size);
-uint8_t	usb2_pc_load_mem(struct usb_page_cache *pc, size_t size,
+	    usb_size_t size, usb_size_t align);
+uint8_t	usb2_pc_dmamap_create(struct usb_page_cache *pc, usb_size_t size);
+uint8_t	usb2_pc_load_mem(struct usb_page_cache *pc, usb_size_t size,
 	    uint8_t sync);
 void	usb2_bdma_done_event(struct usb_dma_parent_tag *udpt);
 void	usb2_bdma_post_sync(struct usb_xfer *xfer);
@@ -166,7 +166,7 @@ void	usb2_dma_tag_unsetup(struct usb_dma
 void	usb2_get_page(struct usb_page_cache *pc, usb_frlength_t offset,
 	    struct usb_page_search *res);
 void	usb2_m_copy_in(struct usb_page_cache *cache, usb_frlength_t dst_offset,
-	    struct mbuf *m, size_t src_offset, usb_frlength_t src_len);
+	    struct mbuf *m, usb_size_t src_offset, usb_frlength_t src_len);
 void	usb2_pc_cpu_flush(struct usb_page_cache *pc);
 void	usb2_pc_cpu_invalidate(struct usb_page_cache *pc);
 void	usb2_pc_dmamap_destroy(struct usb_page_cache *pc);

Modified: head/sys/dev/usb/usb_compat_linux.c
==============================================================================
--- head/sys/dev/usb/usb_compat_linux.c	Fri May 29 23:41:31 2009	(r193073)
+++ head/sys/dev/usb/usb_compat_linux.c	Sat May 30 00:22:57 2009	(r193074)
@@ -710,7 +710,7 @@ usb_set_interface(struct usb_device *dev
  *------------------------------------------------------------------------*/
 int
 usb_setup_endpoint(struct usb_device *dev,
-    struct usb_host_endpoint *uhe, size_t bufsize)
+    struct usb_host_endpoint *uhe, usb_size_t bufsize)
 {
 	struct usb_config cfg[2];
 	uint8_t type = uhe->desc.bmAttributes & UE_XFERTYPE;
@@ -804,7 +804,7 @@ usb_linux_create_usb_device(struct usb_d
 	struct usb_interface *p_ui = NULL;
 	struct usb_host_interface *p_uhi = NULL;
 	struct usb_host_endpoint *p_uhe = NULL;
-	size_t size;
+	usb_size_t size;
 	uint16_t niface_total;
 	uint16_t nedesc;
 	uint16_t iface_no_curr;
@@ -928,7 +928,7 @@ struct urb *
 usb_alloc_urb(uint16_t iso_packets, uint16_t mem_flags)
 {
 	struct urb *urb;
-	size_t size;
+	usb_size_t size;
 
 	if (iso_packets == 0xFFFF) {
 		/*
@@ -1059,7 +1059,7 @@ usb_ifnum_to_if(struct usb_device *dev, 
  *	usb_buffer_alloc
  *------------------------------------------------------------------------*/
 void   *
-usb_buffer_alloc(struct usb_device *dev, size_t size, uint16_t mem_flags, uint8_t *dma_addr)
+usb_buffer_alloc(struct usb_device *dev, usb_size_t size, uint16_t mem_flags, uint8_t *dma_addr)
 {
 	return (malloc(size, M_USBDEV, M_WAITOK | M_ZERO));
 }
@@ -1150,7 +1150,7 @@ usb_linux_free_device(struct usb_device 
  *	usb_buffer_free
  *------------------------------------------------------------------------*/
 void
-usb_buffer_free(struct usb_device *dev, size_t size,
+usb_buffer_free(struct usb_device *dev, usb_size_t size,
     void *addr, uint8_t dma_addr)
 {
 	free(addr, M_USBDEV);

Modified: head/sys/dev/usb/usb_compat_linux.h
==============================================================================
--- head/sys/dev/usb/usb_compat_linux.h	Fri May 29 23:41:31 2009	(r193073)
+++ head/sys/dev/usb/usb_compat_linux.h	Sat May 30 00:22:57 2009	(r193074)
@@ -278,9 +278,9 @@ struct urb {
 	void   *context;		/* (in) context for completion */
 	usb_complete_t *complete;	/* (in) completion routine */
 
-	size_t transfer_buffer_length;/* (in) data buffer length */
-	size_t bsd_length_rem;
-	size_t actual_length;	/* (return) actual transfer length */
+	usb_size_t transfer_buffer_length;/* (in) data buffer length */
+	usb_size_t bsd_length_rem;
+	usb_size_t actual_length;	/* (return) actual transfer length */
 	usb_timeout_t timeout;		/* FreeBSD specific */
 
 	uint16_t transfer_flags;	/* (in) */
@@ -326,11 +326,11 @@ struct usb_host_interface *usb_altnum_to
 	    const struct usb_interface *intf, uint8_t alt_index);
 struct usb_interface *usb_ifnum_to_if(struct usb_device *dev, uint8_t iface_no);
 
-void   *usb_buffer_alloc(struct usb_device *dev, size_t size,
+void   *usb_buffer_alloc(struct usb_device *dev, usb_size_t size,
 	    uint16_t mem_flags, uint8_t *dma_addr);
 void   *usb_get_intfdata(struct usb_interface *intf);
 
-void	usb_buffer_free(struct usb_device *dev, size_t size, void *addr, uint8_t dma_addr);
+void	usb_buffer_free(struct usb_device *dev, usb_size_t size, void *addr, uint8_t dma_addr);
 void	usb_free_urb(struct urb *urb);
 void	usb_init_urb(struct urb *urb);
 void	usb_kill_urb(struct urb *urb);

Modified: head/sys/dev/usb/usb_controller.h
==============================================================================
--- head/sys/dev/usb/usb_controller.h	Fri May 29 23:41:31 2009	(r193073)
+++ head/sys/dev/usb/usb_controller.h	Sat May 30 00:22:57 2009	(r193074)
@@ -45,7 +45,7 @@ struct usb_endpoint_descriptor;
 
 /* typedefs */
 
-typedef void (usb_bus_mem_sub_cb_t)(struct usb_bus *bus, struct usb_page_cache *pc, struct usb_page *pg, size_t size, size_t align);
+typedef void (usb_bus_mem_sub_cb_t)(struct usb_bus *bus, struct usb_page_cache *pc, struct usb_page *pg, usb_size_t size, usb_size_t align);
 typedef void (usb_bus_mem_cb_t)(struct usb_bus *bus, usb_bus_mem_sub_cb_t *scb);
 
 /*
@@ -170,7 +170,7 @@ struct usb_hw_ep_scratch {
  */
 struct usb_temp_setup {
 	void   *buf;
-	size_t size;
+	usb_size_t size;
 	enum usb_dev_speed	usb_speed;
 	uint8_t	self_powered;
 	uint8_t	bNumEndpoints;

Modified: head/sys/dev/usb/usb_core.h
==============================================================================
--- head/sys/dev/usb/usb_core.h	Fri May 29 23:41:31 2009	(r193073)
+++ head/sys/dev/usb/usb_core.h	Sat May 30 00:22:57 2009	(r193074)
@@ -284,6 +284,10 @@ typedef uint32_t usb_frlength_t;	/* byte
 typedef uint32_t usb_frcount_t;	/* units */
 #endif
 
+#ifndef USB_HAVE_SIZE_T
+typedef uint32_t usb_size_t;		/* bytes */
+#endif
+
 #ifndef USB_HAVE_TICKS_T
 typedef uint32_t usb_ticks_t;		/* system defined */
 #endif

Modified: head/sys/dev/usb/usb_dev.c
==============================================================================
--- head/sys/dev/usb/usb_dev.c	Fri May 29 23:41:31 2009	(r193073)
+++ head/sys/dev/usb/usb_dev.c	Sat May 30 00:22:57 2009	(r193074)
@@ -1683,7 +1683,7 @@ usb2_fifo_attach(struct usb_device *udev
  * Else failure
  *------------------------------------------------------------------------*/
 int
-usb2_fifo_alloc_buffer(struct usb_fifo *f, size_t bufsize,
+usb2_fifo_alloc_buffer(struct usb_fifo *f, usb_size_t bufsize,
     uint16_t nbuf)
 {
 	usb2_fifo_free_buffer(f);
@@ -1748,11 +1748,11 @@ usb2_fifo_detach(struct usb_fifo_sc *f_s
 	DPRINTFN(2, "detached %p\n", f_sc);
 }
 
-size_t
+usb_size_t
 usb2_fifo_put_bytes_max(struct usb_fifo *f)
 {
 	struct usb_mbuf *m;
-	size_t len;
+	usb_size_t len;
 
 	USB_IF_POLL(&f->free_q, m);
 
@@ -1811,10 +1811,10 @@ usb2_fifo_put_data(struct usb_fifo *f, s
 
 void
 usb2_fifo_put_data_linear(struct usb_fifo *f, void *ptr,
-    size_t len, uint8_t what)
+    usb_size_t len, uint8_t what)
 {
 	struct usb_mbuf *m;
-	size_t io_len;
+	usb_size_t io_len;
 
 	while (len || (what == 1)) {
 
@@ -1848,7 +1848,7 @@ usb2_fifo_put_data_linear(struct usb_fif
 }
 
 uint8_t
-usb2_fifo_put_data_buffer(struct usb_fifo *f, void *ptr, size_t len)
+usb2_fifo_put_data_buffer(struct usb_fifo *f, void *ptr, usb_size_t len)
 {
 	struct usb_mbuf *m;
 
@@ -1950,10 +1950,10 @@ usb2_fifo_get_data(struct usb_fifo *f, s
 
 uint8_t
 usb2_fifo_get_data_linear(struct usb_fifo *f, void *ptr,
-    size_t len, size_t *actlen, uint8_t what)
+    usb_size_t len, usb_size_t *actlen, uint8_t what)
 {
 	struct usb_mbuf *m;
-	size_t io_len;
+	usb_size_t io_len;
 	uint8_t tr_data = 0;
 
 	actlen[0] = 0;
@@ -2014,7 +2014,7 @@ usb2_fifo_get_data_linear(struct usb_fif
 }
 
 uint8_t
-usb2_fifo_get_data_buffer(struct usb_fifo *f, void **pptr, size_t *plen)
+usb2_fifo_get_data_buffer(struct usb_fifo *f, void **pptr, usb_size_t *plen)
 {
 	struct usb_mbuf *m;
 

Modified: head/sys/dev/usb/usb_dev.h
==============================================================================
--- head/sys/dev/usb/usb_dev.h	Fri May 29 23:41:31 2009	(r193073)
+++ head/sys/dev/usb/usb_dev.h	Sat May 30 00:22:57 2009	(r193074)
@@ -177,16 +177,16 @@ uint32_t usb2_fifo_put_bytes_max(struct 
 void	usb2_fifo_put_data(struct usb_fifo *fifo, struct usb_page_cache *pc,
 	    usb_frlength_t offset, usb_frlength_t len, uint8_t what);
 void	usb2_fifo_put_data_linear(struct usb_fifo *fifo, void *ptr,
-	    size_t len, uint8_t what);
-uint8_t	usb2_fifo_put_data_buffer(struct usb_fifo *f, void *ptr, size_t len);
+	    usb_size_t len, uint8_t what);
+uint8_t	usb2_fifo_put_data_buffer(struct usb_fifo *f, void *ptr, usb_size_t len);
 void	usb2_fifo_put_data_error(struct usb_fifo *fifo);
 uint8_t	usb2_fifo_get_data(struct usb_fifo *fifo, struct usb_page_cache *pc,
 	    usb_frlength_t offset, usb_frlength_t len, usb_frlength_t *actlen,
 	    uint8_t what);
 uint8_t	usb2_fifo_get_data_linear(struct usb_fifo *fifo, void *ptr,
-	    size_t len, size_t *actlen, uint8_t what);
+	    usb_size_t len, usb_size_t *actlen, uint8_t what);
 uint8_t	usb2_fifo_get_data_buffer(struct usb_fifo *f, void **pptr,
-	    size_t *plen);
+	    usb_size_t *plen);
 void	usb2_fifo_get_data_error(struct usb_fifo *fifo);
 uint8_t	usb2_fifo_opened(struct usb_fifo *fifo);
 void	usb2_fifo_free(struct usb_fifo *f);

Modified: head/sys/dev/usb/usb_device.h
==============================================================================
--- head/sys/dev/usb/usb_device.h	Fri May 29 23:41:31 2009	(r193073)
+++ head/sys/dev/usb/usb_device.h	Sat May 30 00:22:57 2009	(r193074)
@@ -140,9 +140,9 @@ struct usb_device_flags {
  */
 struct usb_power_save {
 	usb_ticks_t last_xfer_time;	/* copy of "ticks" */
-	size_t type_refs[4];	/* transfer reference count */
-	size_t read_refs;		/* data read references */
-	size_t write_refs;		/* data write references */
+	usb_size_t type_refs[4];	/* transfer reference count */
+	usb_size_t read_refs;		/* data read references */
+	usb_size_t write_refs;		/* data write references */
 };
 
 /*

Modified: head/sys/dev/usb/usb_hid.c
==============================================================================
--- head/sys/dev/usb/usb_hid.c	Fri May 29 23:41:31 2009	(r193073)
+++ head/sys/dev/usb/usb_hid.c	Sat May 30 00:22:57 2009	(r193074)
@@ -105,7 +105,7 @@ hid_clear_local(struct hid_item *c)
  *	hid_start_parse
  *------------------------------------------------------------------------*/
 struct hid_data *
-hid_start_parse(const void *d, size_t len, int kindset)
+hid_start_parse(const void *d, usb_size_t len, int kindset)
 {
 	struct hid_data *s;
 
@@ -491,7 +491,7 @@ hid_get_item(struct hid_data *s, struct 
  *	hid_report_size
  *------------------------------------------------------------------------*/
 int
-hid_report_size(const void *buf, size_t len, enum hid_kind k, uint8_t *id)
+hid_report_size(const void *buf, usb_size_t len, enum hid_kind k, uint8_t *id)
 {
 	struct hid_data *d;
 	struct hid_item h;
@@ -544,7 +544,7 @@ hid_report_size(const void *buf, size_t 
  *	hid_locate
  *------------------------------------------------------------------------*/
 int
-hid_locate(const void *desc, size_t size, uint32_t u, enum hid_kind k,
+hid_locate(const void *desc, usb_size_t size, uint32_t u, enum hid_kind k,
     uint8_t index, struct hid_location *loc, uint32_t *flags, uint8_t *id)
 {
 	struct hid_data *d;
@@ -578,7 +578,7 @@ hid_locate(const void *desc, size_t size
  *	hid_get_data
  *------------------------------------------------------------------------*/
 uint32_t
-hid_get_data(const uint8_t *buf, size_t len, struct hid_location *loc)
+hid_get_data(const uint8_t *buf, usb_size_t len, struct hid_location *loc)
 {
 	uint32_t hpos = loc->pos;
 	uint32_t hsize = loc->size;
@@ -621,7 +621,7 @@ hid_get_data(const uint8_t *buf, size_t 
  *	hid_is_collection
  *------------------------------------------------------------------------*/
 int
-hid_is_collection(const void *desc, size_t size, uint32_t usage)
+hid_is_collection(const void *desc, usb_size_t size, uint32_t usage)
 {
 	struct hid_data *hd;
 	struct hid_item hi;

Modified: head/sys/dev/usb/usb_hid.h
==============================================================================
--- head/sys/dev/usb/usb_hid.h	Fri May 29 23:41:31 2009	(r193073)
+++ head/sys/dev/usb/usb_hid.h	Sat May 30 00:22:57 2009	(r193074)
@@ -74,17 +74,17 @@ struct hid_item {
 
 /* prototypes from "usb2_hid.c" */
 
-struct hid_data *hid_start_parse(const void *d, size_t len, int kindset);
+struct hid_data *hid_start_parse(const void *d, usb_size_t len, int kindset);
 void	hid_end_parse(struct hid_data *s);
 int	hid_get_item(struct hid_data *s, struct hid_item *h);
-int	hid_report_size(const void *buf, size_t len, enum hid_kind k,
+int	hid_report_size(const void *buf, usb_size_t len, enum hid_kind k,
 	    uint8_t *id);
-int	hid_locate(const void *desc, size_t size, uint32_t usage,
+int	hid_locate(const void *desc, usb_size_t size, uint32_t usage,
 	    enum hid_kind kind, uint8_t index, struct hid_location *loc,
 	    uint32_t *flags, uint8_t *id);
-uint32_t hid_get_data(const uint8_t *buf, size_t len,
+uint32_t hid_get_data(const uint8_t *buf, usb_size_t len,
 	    struct hid_location *loc);
-int	hid_is_collection(const void *desc, size_t size, uint32_t usage);
+int	hid_is_collection(const void *desc, usb_size_t size, uint32_t usage);
 struct usb_hid_descriptor *hid_get_descriptor_from_usb(
 	    struct usb_config_descriptor *cd,
 	    struct usb_interface_descriptor *id);

Modified: head/sys/dev/usb/usb_hub.c
==============================================================================
--- head/sys/dev/usb/usb_hub.c	Fri May 29 23:41:31 2009	(r193073)
+++ head/sys/dev/usb/usb_hub.c	Sat May 30 00:22:57 2009	(r193074)
@@ -1058,9 +1058,9 @@ done:
  *   The best Transaction Translation slot for an interrupt endpoint.
  *------------------------------------------------------------------------*/
 static uint8_t
-usb2_intr_find_best_slot(size_t *ptr, uint8_t start, uint8_t end)
+usb2_intr_find_best_slot(usb_size_t *ptr, uint8_t start, uint8_t end)
 {
-	size_t max = 0 - 1;
+	usb_size_t max = 0 - 1;
 	uint8_t x;
 	uint8_t y;
 
@@ -1558,7 +1558,7 @@ usb2_bus_powerd(struct usb_bus *bus)
 	usb_ticks_t temp;
 	usb_ticks_t limit;
 	usb_ticks_t mintime;
-	size_t type_refs[5];
+	usb_size_t type_refs[5];
 	uint8_t x;
 	uint8_t rem_wakeup;
 

Modified: head/sys/dev/usb/usb_hub.h
==============================================================================
--- head/sys/dev/usb/usb_hub.h	Fri May 29 23:41:31 2009	(r193073)
+++ head/sys/dev/usb/usb_hub.h	Sat May 30 00:22:57 2009	(r193074)
@@ -57,7 +57,7 @@ struct usb_hub {
 	struct usb_device *hubudev;	/* the HUB device */
 	usb_error_t (*explore) (struct usb_device *hub);
 	void   *hubsoftc;
-	size_t uframe_usage[USB_HS_MICRO_FRAMES_MAX];
+	usb_size_t uframe_usage[USB_HS_MICRO_FRAMES_MAX];
 	uint16_t portpower;		/* mA per USB port */
 	uint8_t	isoc_last_time;
 	uint8_t	nports;

Modified: head/sys/dev/usb/usb_lookup.c
==============================================================================
--- head/sys/dev/usb/usb_lookup.c	Fri May 29 23:41:31 2009	(r193073)
+++ head/sys/dev/usb/usb_lookup.c	Sat May 30 00:22:57 2009	(r193074)
@@ -42,7 +42,7 @@
  * Else: Pointer to matching entry.
  *------------------------------------------------------------------------*/
 const struct usb_device_id *
-usb2_lookup_id_by_info(const struct usb_device_id *id, size_t sizeof_id,
+usb2_lookup_id_by_info(const struct usb_device_id *id, usb_size_t sizeof_id,
     const struct usb_lookup_info *info)
 {
 	const struct usb_device_id *id_end;
@@ -121,7 +121,7 @@ done:
  * Else: Failure
  *------------------------------------------------------------------------*/
 int
-usb2_lookup_id_by_uaa(const struct usb_device_id *id, size_t sizeof_id,
+usb2_lookup_id_by_uaa(const struct usb_device_id *id, usb_size_t sizeof_id,
     struct usb_attach_arg *uaa)
 {
 	id = usb2_lookup_id_by_info(id, sizeof_id, &uaa->info);

Modified: head/sys/dev/usb/usb_lookup.h
==============================================================================
--- head/sys/dev/usb/usb_lookup.h	Fri May 29 23:41:31 2009	(r193073)
+++ head/sys/dev/usb/usb_lookup.h	Sat May 30 00:22:57 2009	(r193074)
@@ -114,9 +114,9 @@ struct usb_device_id {
   (((const uint8_t *)((did)->driver_info)) - ((const uint8_t *)0))
 
 const struct usb_device_id *usb2_lookup_id_by_info(
-	    const struct usb_device_id *id, size_t sizeof_id,
+	    const struct usb_device_id *id, usb_size_t sizeof_id,
 	    const struct usb_lookup_info *info);
 int	usb2_lookup_id_by_uaa(const struct usb_device_id *id,
-	    size_t sizeof_id, struct usb_attach_arg *uaa);
+	    usb_size_t sizeof_id, struct usb_attach_arg *uaa);
 
 #endif					/* _USB2_LOOKUP_H_ */

Modified: head/sys/dev/usb/usb_mbuf.c
==============================================================================
--- head/sys/dev/usb/usb_mbuf.c	Fri May 29 23:41:31 2009	(r193073)
+++ head/sys/dev/usb/usb_mbuf.c	Sat May 30 00:22:57 2009	(r193074)
@@ -36,12 +36,12 @@
  *------------------------------------------------------------------------*/
 void   *
 usb2_alloc_mbufs(struct malloc_type *type, struct usb_ifqueue *ifq,
-    size_t block_size, uint16_t nblocks)
+    usb_size_t block_size, uint16_t nblocks)
 {
 	struct usb_mbuf *m_ptr;
 	uint8_t *data_ptr;
 	void *free_ptr = NULL;
-	size_t alloc_size;
+	usb_size_t alloc_size;
 
 	/* align data */
 	block_size += ((-block_size) & (USB_HOST_ALIGN - 1));

Modified: head/sys/dev/usb/usb_mbuf.h
==============================================================================
--- head/sys/dev/usb/usb_mbuf.h	Fri May 29 23:41:31 2009	(r193073)
+++ head/sys/dev/usb/usb_mbuf.h	Sat May 30 00:22:57 2009	(r193074)
@@ -37,8 +37,8 @@ struct usb_mbuf {
 	struct usb_mbuf *usb2_nextpkt;
 	struct usb_mbuf *usb2_next;
 
-	size_t cur_data_len;
-	size_t max_data_len;
+	usb_size_t cur_data_len;
+	usb_size_t max_data_len;
 	uint8_t last_packet:1;
 	uint8_t unused:7;
 };
@@ -51,8 +51,8 @@ struct usb_ifqueue {
 	struct usb_mbuf *ifq_head;
 	struct usb_mbuf *ifq_tail;
 
-	size_t ifq_len;
-	size_t ifq_maxlen;
+	usb_size_t ifq_len;
+	usb_size_t ifq_maxlen;
 };
 
 #define	USB_IF_ENQUEUE(ifq, m) do {		\
@@ -97,6 +97,6 @@ struct usb_ifqueue {
 
 /* prototypes */
 void   *usb2_alloc_mbufs(struct malloc_type *type, struct usb_ifqueue *ifq,
-	    size_t block_size, uint16_t nblocks);
+	    usb_size_t block_size, uint16_t nblocks);
 
 #endif					/* _USB2_MBUF_H_ */

Modified: head/sys/dev/usb/usb_msctest.c
==============================================================================
--- head/sys/dev/usb/usb_msctest.c	Fri May 29 23:41:31 2009	(r193073)
+++ head/sys/dev/usb/usb_msctest.c	Sat May 30 00:22:57 2009	(r193074)
@@ -109,8 +109,8 @@ struct bbb_transfer {
 
 	uint8_t *data_ptr;
 
-	size_t data_len;		/* bytes */
-	size_t data_rem;		/* bytes */
+	usb_size_t data_len;		/* bytes */
+	usb_size_t data_rem;		/* bytes */
 	usb_timeout_t data_timeout;	/* ms */
 	usb_frlength_t actlen;		/* bytes */
 
@@ -435,7 +435,7 @@ bbb_status_callback(struct usb_xfer *xfe
  *------------------------------------------------------------------------*/
 static uint8_t
 bbb_command_start(struct bbb_transfer *sc, uint8_t dir, uint8_t lun,
-    void *data_ptr, size_t data_len, uint8_t cmd_len,
+    void *data_ptr, usb_size_t data_len, uint8_t cmd_len,
     usb_timeout_t data_timeout)
 {
 	sc->lun = lun;

Modified: head/sys/dev/usb/usb_process.c
==============================================================================
--- head/sys/dev/usb/usb_process.c	Fri May 29 23:41:31 2009	(r193073)
+++ head/sys/dev/usb/usb_process.c	Sat May 30 00:22:57 2009	(r193074)
@@ -243,7 +243,7 @@ usb2_proc_msignal(struct usb_process *up
 	struct usb_proc_msg *pm0 = _pm0;
 	struct usb_proc_msg *pm1 = _pm1;
 	struct usb_proc_msg *pm2;
-	size_t d;
+	usb_size_t d;
 	uint8_t t;
 
 	/* check if gone, return dummy value */

Modified: head/sys/dev/usb/usb_process.h
==============================================================================
--- head/sys/dev/usb/usb_process.h	Fri May 29 23:41:31 2009	(r193073)
+++ head/sys/dev/usb/usb_process.h	Sat May 30 00:22:57 2009	(r193074)
@@ -51,7 +51,7 @@ typedef void (usb_proc_callback_t)(struc
 struct usb_proc_msg {
 	TAILQ_ENTRY(usb_proc_msg) pm_qentry;
 	usb_proc_callback_t *pm_callback;
-	size_t pm_num;
+	usb_size_t pm_num;
 };
 
 /*
@@ -66,7 +66,7 @@ struct usb_process {
 	struct thread *up_curtd;
 	struct mtx *up_mtx;
 
-	size_t up_msg_num;
+	usb_size_t up_msg_num;
 
 	uint8_t	up_prio;
 	uint8_t	up_gone;

Modified: head/sys/dev/usb/usb_transfer.c
==============================================================================
--- head/sys/dev/usb/usb_transfer.c	Fri May 29 23:41:31 2009	(r193073)
+++ head/sys/dev/usb/usb_transfer.c	Sat May 30 00:22:57 2009	(r193074)
@@ -168,18 +168,18 @@ usb2_get_dma_delay(struct usb_bus *bus)
 #if USB_HAVE_BUSDMA
 uint8_t
 usb2_transfer_setup_sub_malloc(struct usb_setup_params *parm,
-    struct usb_page_cache **ppc, size_t size, size_t align,
-    size_t count)
+    struct usb_page_cache **ppc, usb_size_t size, usb_size_t align,
+    usb_size_t count)
 {
 	struct usb_page_cache *pc;
 	struct usb_page *pg;
 	void *buf;
-	size_t n_dma_pc;
-	size_t n_obj;
-	size_t x;
-	size_t y;
-	size_t r;
-	size_t z;
+	usb_size_t n_dma_pc;
+	usb_size_t n_obj;
+	usb_size_t x;
+	usb_size_t y;
+	usb_size_t r;
+	usb_size_t z;
 
 	USB_ASSERT(align > 1, ("Invalid alignment, 0x%08x!\n",
 	    align));

Modified: head/sys/dev/usb/usb_transfer.h
==============================================================================
--- head/sys/dev/usb/usb_transfer.h	Fri May 29 23:41:31 2009	(r193073)
+++ head/sys/dev/usb/usb_transfer.h	Sat May 30 00:22:57 2009	(r193074)
@@ -67,8 +67,8 @@ struct usb_xfer_root {
 	struct usb_bus *bus;		/* pointer to USB bus (cached) */
 	struct usb_device *udev;	/* pointer to USB device */
 
-	size_t memory_size;
-	size_t setup_refcount;
+	usb_size_t memory_size;
+	usb_size_t setup_refcount;
 #if USB_HAVE_BUSDMA
 	usb_frcount_t dma_nframes;	/* number of page caches to load */
 	usb_frcount_t dma_currframe;	/* currect page cache number */
@@ -97,7 +97,7 @@ struct usb_setup_params {
 	void   *buf;
 	usb_frlength_t *xfer_length_ptr;
 
-	size_t size[7];
+	usb_size_t size[7];
 	usb_frlength_t bufsize;
 	usb_frlength_t bufsize_max;
 
@@ -112,8 +112,8 @@ struct usb_setup_params {
 /* function prototypes */
 
 uint8_t	usb2_transfer_setup_sub_malloc(struct usb_setup_params *parm,
-	    struct usb_page_cache **ppc, size_t size, size_t align,
-	    size_t count);
+	    struct usb_page_cache **ppc, usb_size_t size, usb_size_t align,
+	    usb_size_t count);
 void	usb2_command_wrapper(struct usb_xfer_queue *pq,
 	    struct usb_xfer *xfer);
 void	usb2_pipe_enter(struct usb_xfer *xfer);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200905300022.n4U0MvAc091062>