diff options
author | thompsa <thompsa@FreeBSD.org> | 2009-05-30 00:22:57 +0000 |
---|---|---|
committer | thompsa <thompsa@FreeBSD.org> | 2009-05-30 00:22:57 +0000 |
commit | b064d23a532b2149c827f886719da091c9d46db5 (patch) | |
tree | 850ed632800ebd9b53080b0dbbbb6afda22bcd1c /sys/dev/usb | |
parent | 36bf6c9b02de093f113d81dc2ba7c54d7ba93926 (diff) | |
download | FreeBSD-src-b064d23a532b2149c827f886719da091c9d46db5.zip FreeBSD-src-b064d23a532b2149c827f886719da091c9d46db5.tar.gz |
Revert the size_t part of the last commit for the moment, this blows up the
USB_ADD_BYTES macro.
Diffstat (limited to 'sys/dev/usb')
-rw-r--r-- | sys/dev/usb/controller/usb_controller.c | 6 | ||||
-rw-r--r-- | sys/dev/usb/usb_bus.h | 2 | ||||
-rw-r--r-- | sys/dev/usb/usb_busdma.c | 16 | ||||
-rw-r--r-- | sys/dev/usb/usb_busdma.h | 20 | ||||
-rw-r--r-- | sys/dev/usb/usb_compat_linux.c | 10 | ||||
-rw-r--r-- | sys/dev/usb/usb_compat_linux.h | 10 | ||||
-rw-r--r-- | sys/dev/usb/usb_controller.h | 4 | ||||
-rw-r--r-- | sys/dev/usb/usb_core.h | 4 | ||||
-rw-r--r-- | sys/dev/usb/usb_dev.c | 18 | ||||
-rw-r--r-- | sys/dev/usb/usb_dev.h | 8 | ||||
-rw-r--r-- | sys/dev/usb/usb_device.h | 6 | ||||
-rw-r--r-- | sys/dev/usb/usb_hid.c | 10 | ||||
-rw-r--r-- | sys/dev/usb/usb_hid.h | 10 | ||||
-rw-r--r-- | sys/dev/usb/usb_hub.c | 6 | ||||
-rw-r--r-- | sys/dev/usb/usb_hub.h | 2 | ||||
-rw-r--r-- | sys/dev/usb/usb_lookup.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/usb_lookup.h | 4 | ||||
-rw-r--r-- | sys/dev/usb/usb_mbuf.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/usb_mbuf.h | 10 | ||||
-rw-r--r-- | sys/dev/usb/usb_msctest.c | 6 | ||||
-rw-r--r-- | sys/dev/usb/usb_process.c | 2 | ||||
-rw-r--r-- | sys/dev/usb/usb_process.h | 4 | ||||
-rw-r--r-- | sys/dev/usb/usb_transfer.c | 16 | ||||
-rw-r--r-- | sys/dev/usb/usb_transfer.h | 10 |
24 files changed, 98 insertions, 94 deletions
diff --git a/sys/dev/usb/controller/usb_controller.c b/sys/dev/usb/controller/usb_controller.c index 7c3abf1..1e91643 100644 --- a/sys/dev/usb/controller/usb_controller.c +++ b/sys/dev/usb/controller/usb_controller.c @@ -485,7 +485,7 @@ SYSUNINIT(usb2_bus_unload, SI_SUB_KLD, SI_ORDER_ANY, usb2_bus_unload, NULL); #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 *bus, usb_bus_mem_cb_t *cb) #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 *bus, bus_dma_tag_t dmat, #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); } diff --git a/sys/dev/usb/usb_bus.h b/sys/dev/usb/usb_bus.h index c162bcb..942d919 100644 --- a/sys/dev/usb/usb_bus.h +++ b/sys/dev/usb/usb_bus.h @@ -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 */ diff --git a/sys/dev/usb/usb_busdma.c b/sys/dev/usb/usb_busdma.c index ed1e0d6..eb6c536 100644 --- a/sys/dev/usb/usb_busdma.c +++ b/sys/dev/usb/usb_busdma.c @@ -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, uint32_t count) 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_op_t op) *------------------------------------------------------------------------*/ 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_segment_t *segs, 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 *pc) * 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 *pc) * 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_cache *pc) *------------------------------------------------------------------------*/ 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; diff --git a/sys/dev/usb/usb_busdma.h b/sys/dev/usb/usb_busdma.h index 75d0d06..ef2ee5d 100644 --- a/sys/dev/usb/usb_busdma.h +++ b/sys/dev/usb/usb_busdma.h @@ -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 */ 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_parent_tag *udpt); 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); diff --git a/sys/dev/usb/usb_compat_linux.c b/sys/dev/usb/usb_compat_linux.c index b8a5a6e..001d92b 100644 --- a/sys/dev/usb/usb_compat_linux.c +++ b/sys/dev/usb/usb_compat_linux.c @@ -710,7 +710,7 @@ usb_set_interface(struct usb_device *dev, uint8_t iface_no, uint8_t alt_index) *------------------------------------------------------------------------*/ 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_device *udev, device_t dev) 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, uint8_t iface_no) * 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 *dev) * 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); diff --git a/sys/dev/usb/usb_compat_linux.h b/sys/dev/usb/usb_compat_linux.h index 0d2446b..9066702 100644 --- a/sys/dev/usb/usb_compat_linux.h +++ b/sys/dev/usb/usb_compat_linux.h @@ -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_altsetting( 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); diff --git a/sys/dev/usb/usb_controller.h b/sys/dev/usb/usb_controller.h index 2d96af9..d9e6ef1 100644 --- a/sys/dev/usb/usb_controller.h +++ b/sys/dev/usb/usb_controller.h @@ -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; diff --git a/sys/dev/usb/usb_core.h b/sys/dev/usb/usb_core.h index c924ccc..235caba 100644 --- a/sys/dev/usb/usb_core.h +++ b/sys/dev/usb/usb_core.h @@ -284,6 +284,10 @@ typedef uint32_t usb_frlength_t; /* bytes */ 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 diff --git a/sys/dev/usb/usb_dev.c b/sys/dev/usb/usb_dev.c index 6f1f532..138fc5c 100644 --- a/sys/dev/usb/usb_dev.c +++ b/sys/dev/usb/usb_dev.c @@ -1683,7 +1683,7 @@ usb2_fifo_attach(struct usb_device *udev, void *priv_sc, * 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_sc) 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, struct usb_page_cache *pc, 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_fifo *f, void *ptr, } 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, struct usb_page_cache *pc, 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_fifo *f, void *ptr, } 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; diff --git a/sys/dev/usb/usb_dev.h b/sys/dev/usb/usb_dev.h index 0d0d1d4..3f21542 100644 --- a/sys/dev/usb/usb_dev.h +++ b/sys/dev/usb/usb_dev.h @@ -177,16 +177,16 @@ uint32_t usb2_fifo_put_bytes_max(struct usb_fifo *fifo); 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); diff --git a/sys/dev/usb/usb_device.h b/sys/dev/usb/usb_device.h index 822a9ad..8b41854 100644 --- a/sys/dev/usb/usb_device.h +++ b/sys/dev/usb/usb_device.h @@ -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 */ }; /* diff --git a/sys/dev/usb/usb_hid.c b/sys/dev/usb/usb_hid.c index 9957136..df71978 100644 --- a/sys/dev/usb/usb_hid.c +++ b/sys/dev/usb/usb_hid.c @@ -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_item *h) * 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 len, enum hid_kind k, uint8_t *id) * 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, uint32_t u, enum hid_kind k, * 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 len, struct hid_location *loc) * 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; diff --git a/sys/dev/usb/usb_hid.h b/sys/dev/usb/usb_hid.h index 68380e8..4613d02 100644 --- a/sys/dev/usb/usb_hid.h +++ b/sys/dev/usb/usb_hid.h @@ -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); diff --git a/sys/dev/usb/usb_hub.c b/sys/dev/usb/usb_hub.c index 5de0469..f07b9ec 100644 --- a/sys/dev/usb/usb_hub.c +++ b/sys/dev/usb/usb_hub.c @@ -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; diff --git a/sys/dev/usb/usb_hub.h b/sys/dev/usb/usb_hub.h index a2d767d..23db90c 100644 --- a/sys/dev/usb/usb_hub.h +++ b/sys/dev/usb/usb_hub.h @@ -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; diff --git a/sys/dev/usb/usb_lookup.c b/sys/dev/usb/usb_lookup.c index 4a3668b..8cd887d 100644 --- a/sys/dev/usb/usb_lookup.c +++ b/sys/dev/usb/usb_lookup.c @@ -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); diff --git a/sys/dev/usb/usb_lookup.h b/sys/dev/usb/usb_lookup.h index 4153019..b30c50b 100644 --- a/sys/dev/usb/usb_lookup.h +++ b/sys/dev/usb/usb_lookup.h @@ -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_ */ diff --git a/sys/dev/usb/usb_mbuf.c b/sys/dev/usb/usb_mbuf.c index 8453609..f57d274 100644 --- a/sys/dev/usb/usb_mbuf.c +++ b/sys/dev/usb/usb_mbuf.c @@ -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)); diff --git a/sys/dev/usb/usb_mbuf.h b/sys/dev/usb/usb_mbuf.h index d604a27..998f581 100644 --- a/sys/dev/usb/usb_mbuf.h +++ b/sys/dev/usb/usb_mbuf.h @@ -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_ */ diff --git a/sys/dev/usb/usb_msctest.c b/sys/dev/usb/usb_msctest.c index 03f97f1..51ba897 100644 --- a/sys/dev/usb/usb_msctest.c +++ b/sys/dev/usb/usb_msctest.c @@ -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 *xfer) *------------------------------------------------------------------------*/ 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; diff --git a/sys/dev/usb/usb_process.c b/sys/dev/usb/usb_process.c index d153415..ab8280a 100644 --- a/sys/dev/usb/usb_process.c +++ b/sys/dev/usb/usb_process.c @@ -243,7 +243,7 @@ usb2_proc_msignal(struct usb_process *up, void *_pm0, void *_pm1) 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 */ diff --git a/sys/dev/usb/usb_process.h b/sys/dev/usb/usb_process.h index 09741f6..b248e9e 100644 --- a/sys/dev/usb/usb_process.h +++ b/sys/dev/usb/usb_process.h @@ -51,7 +51,7 @@ typedef void (usb_proc_callback_t)(struct usb_proc_msg *hdr); 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; diff --git a/sys/dev/usb/usb_transfer.c b/sys/dev/usb/usb_transfer.c index 68215b9..cbbae26 100644 --- a/sys/dev/usb/usb_transfer.c +++ b/sys/dev/usb/usb_transfer.c @@ -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)); diff --git a/sys/dev/usb/usb_transfer.h b/sys/dev/usb/usb_transfer.h index 72c9f0e..53c49db 100644 --- a/sys/dev/usb/usb_transfer.h +++ b/sys/dev/usb/usb_transfer.h @@ -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); |