avr32dci.h (192554) | avr32dci.h (192984) |
---|---|
1/* $FreeBSD: head/sys/dev/usb/controller/avr32dci.h 192554 2009-05-21 17:42:32Z thompsa $ */ | 1/* $FreeBSD: head/sys/dev/usb/controller/avr32dci.h 192984 2009-05-28 17:36:36Z thompsa $ */ |
2/*- 3 * Copyright (c) 2009 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. --- 142 unchanged lines hidden (view full) --- 152/* 153 * Maximum number of endpoints supported: 154 */ 155#define AVR32_EP_MAX 7 156 157struct avr32dci_td; 158 159typedef uint8_t (avr32dci_cmd_t)(struct avr32dci_td *td); | 2/*- 3 * Copyright (c) 2009 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. --- 142 unchanged lines hidden (view full) --- 152/* 153 * Maximum number of endpoints supported: 154 */ 155#define AVR32_EP_MAX 7 156 157struct avr32dci_td; 158 159typedef uint8_t (avr32dci_cmd_t)(struct avr32dci_td *td); |
160typedef void (avr32dci_clocks_t)(struct usb2_bus *); | 160typedef void (avr32dci_clocks_t)(struct usb_bus *); |
161 162struct avr32dci_td { 163 struct avr32dci_td *obj_next; 164 avr32dci_cmd_t *func; | 161 162struct avr32dci_td { 163 struct avr32dci_td *obj_next; 164 avr32dci_cmd_t *func; |
165 struct usb2_page_cache *pc; | 165 struct usb_page_cache *pc; |
166 uint32_t offset; 167 uint32_t remainder; 168 uint16_t max_packet_size; 169 uint8_t error:1; 170 uint8_t alt_next:1; 171 uint8_t short_pkt:1; 172 uint8_t support_multi_buffer:1; 173 uint8_t did_stall:1; 174 uint8_t ep_no:3; 175}; 176 177struct avr32dci_std_temp { 178 avr32dci_cmd_t *func; | 166 uint32_t offset; 167 uint32_t remainder; 168 uint16_t max_packet_size; 169 uint8_t error:1; 170 uint8_t alt_next:1; 171 uint8_t short_pkt:1; 172 uint8_t support_multi_buffer:1; 173 uint8_t did_stall:1; 174 uint8_t ep_no:3; 175}; 176 177struct avr32dci_std_temp { 178 avr32dci_cmd_t *func; |
179 struct usb2_page_cache *pc; | 179 struct usb_page_cache *pc; |
180 struct avr32dci_td *td; 181 struct avr32dci_td *td_next; 182 uint32_t len; 183 uint32_t offset; 184 uint16_t max_frame_size; 185 uint8_t bank_shift; 186 uint8_t short_pkt; 187 /* 188 * short_pkt = 0: transfer should be short terminated 189 * short_pkt = 1: transfer should not be short terminated 190 */ 191 uint8_t setup_alt_next; 192 uint8_t did_stall; 193}; 194 195struct avr32dci_config_desc { | 180 struct avr32dci_td *td; 181 struct avr32dci_td *td_next; 182 uint32_t len; 183 uint32_t offset; 184 uint16_t max_frame_size; 185 uint8_t bank_shift; 186 uint8_t short_pkt; 187 /* 188 * short_pkt = 0: transfer should be short terminated 189 * short_pkt = 1: transfer should not be short terminated 190 */ 191 uint8_t setup_alt_next; 192 uint8_t did_stall; 193}; 194 195struct avr32dci_config_desc { |
196 struct usb2_config_descriptor confd; 197 struct usb2_interface_descriptor ifcd; 198 struct usb2_endpoint_descriptor endpd; | 196 struct usb_config_descriptor confd; 197 struct usb_interface_descriptor ifcd; 198 struct usb_endpoint_descriptor endpd; |
199} __packed; 200 201union avr32dci_hub_temp { 202 uWord wValue; | 199} __packed; 200 201union avr32dci_hub_temp { 202 uWord wValue; |
203 struct usb2_port_status ps; | 203 struct usb_port_status ps; |
204}; 205 206struct avr32dci_flags { 207 uint8_t change_connect:1; 208 uint8_t change_suspend:1; 209 uint8_t status_suspend:1; /* set if suspended */ 210 uint8_t status_vbus:1; /* set if present */ 211 uint8_t status_bus_reset:1; /* set if reset complete */ 212 uint8_t remote_wakeup:1; 213 uint8_t self_powered:1; 214 uint8_t clocks_off:1; 215 uint8_t port_powered:1; 216 uint8_t port_enabled:1; 217 uint8_t d_pulled_up:1; 218}; 219 220struct avr32dci_softc { | 204}; 205 206struct avr32dci_flags { 207 uint8_t change_connect:1; 208 uint8_t change_suspend:1; 209 uint8_t status_suspend:1; /* set if suspended */ 210 uint8_t status_vbus:1; /* set if present */ 211 uint8_t status_bus_reset:1; /* set if reset complete */ 212 uint8_t remote_wakeup:1; 213 uint8_t self_powered:1; 214 uint8_t clocks_off:1; 215 uint8_t port_powered:1; 216 uint8_t port_enabled:1; 217 uint8_t d_pulled_up:1; 218}; 219 220struct avr32dci_softc { |
221 struct usb2_bus sc_bus; | 221 struct usb_bus sc_bus; |
222 union avr32dci_hub_temp sc_hub_temp; 223 224 /* must be set by by the bus interface layer */ 225 avr32dci_clocks_t *sc_clocks_on; 226 avr32dci_clocks_t *sc_clocks_off; 227 | 222 union avr32dci_hub_temp sc_hub_temp; 223 224 /* must be set by by the bus interface layer */ 225 avr32dci_clocks_t *sc_clocks_on; 226 avr32dci_clocks_t *sc_clocks_off; 227 |
228 struct usb2_device *sc_devices[AVR32_MAX_DEVICES]; | 228 struct usb_device *sc_devices[AVR32_MAX_DEVICES]; |
229 struct resource *sc_irq_res; 230 void *sc_intr_hdl; 231 struct resource *sc_io_res; 232 bus_space_tag_t sc_io_tag; 233 bus_space_handle_t sc_io_hdl; 234 uint8_t *physdata; 235 236 uint8_t sc_rt_addr; /* root hub address */ --- 18 unchanged lines hidden --- | 229 struct resource *sc_irq_res; 230 void *sc_intr_hdl; 231 struct resource *sc_io_res; 232 bus_space_tag_t sc_io_tag; 233 bus_space_handle_t sc_io_hdl; 234 uint8_t *physdata; 235 236 uint8_t sc_rt_addr; /* root hub address */ --- 18 unchanged lines hidden --- |