Changeset 8300c72 in mainline for uspace/drv
- Timestamp:
- 2025-03-03T22:58:05Z (10 months ago)
- Branches:
- master
- Children:
- 77a0119
- Parents:
- f35749e
- Location:
- uspace/drv
- Files:
-
- 7 edited
-
bus/usb/uhci/hc.c (modified) (2 diffs)
-
bus/usb/uhci/hc.h (modified) (2 diffs)
-
bus/usb/uhci/main.c (modified) (2 diffs)
-
bus/usb/xhci/hc.c (modified) (2 diffs)
-
bus/usb/xhci/hc.h (modified) (2 diffs)
-
bus/usb/xhci/main.c (modified) (3 diffs)
-
nic/e1k/e1k.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/uhci/hc.c
rf35749e r8300c72 1 1 /* 2 * Copyright (c) 2025 Jiri Svoboda 2 3 * Copyright (c) 2011 Jan Vesely 3 4 * Copyright (c) 2018 Ondrej Hlavaty, Petr Manek … … 267 268 } 268 269 270 /** Quiesce host controller. 271 * 272 * @param[in] instance Host controller structure to use. 273 */ 274 int hc_quiesce(hc_device_t *hcd) 275 { 276 hc_t *instance = hcd_to_hc(hcd); 277 uhci_regs_t *registers = instance->registers; 278 279 /* Reset everything, who knows what touched it before us */ 280 pio_write_16(®isters->usbcmd, UHCI_CMD_GLOBAL_RESET); 281 fibril_usleep(50000); /* 50ms according to USB spec(root hub reset) */ 282 pio_write_16(®isters->usbcmd, 0); 283 284 /* Reset hc, all states and counters. Hope that hw is not broken */ 285 pio_write_16(®isters->usbcmd, UHCI_CMD_HCRESET); 286 do { 287 fibril_usleep(10); 288 } while ((pio_read_16(®isters->usbcmd) & UHCI_CMD_HCRESET) != 0); 289 290 return EOK; 291 } 292 269 293 /** Initialize UHCI hc hw resources. 270 294 * -
uspace/drv/bus/usb/uhci/hc.h
rf35749e r8300c72 1 1 /* 2 * Copyright (c) 2025 Jiri Svoboda 2 3 * Copyright (c) 2011 Jan Vesely 3 4 * Copyright (c) 2018 Ondrej Hlavaty … … 164 165 extern errno_t hc_setup_roothub(hc_device_t *); 165 166 extern errno_t hc_gone(hc_device_t *); 167 extern errno_t hc_quiesce(hc_device_t *); 166 168 167 169 #endif -
uspace/drv/bus/usb/uhci/main.c
rf35749e r8300c72 1 1 /* 2 * Copyright (c) 2025 Jiri Svoboda 2 3 * Copyright (c) 2011 Vojtech Horky, Jan Vesely 3 4 * Copyright (c) 2018 Ondrej Hlavaty, Petr Manek … … 61 62 .setup_root_hub = hc_setup_roothub, 62 63 .hc_gone = hc_gone, 64 .hc_quiesce = hc_quiesce 63 65 }; 64 66 -
uspace/drv/bus/usb/xhci/hc.c
rf35749e r8300c72 1 1 /* 2 * Copyright (c) 2025 Jiri Svoboda 2 3 * Copyright (c) 2018 Ondrej Hlavaty, Petr Manek, Jaroslav Jindrak, Jan Hrach, Michal Staruch 3 4 * All rights reserved. … … 746 747 } 747 748 749 /** 750 * Quiesce host controller. 751 */ 752 errno_t hc_quiesce(xhci_hc_t *hc) 753 { 754 hc_stop(hc); 755 usb_log_info("HC quiesced."); 756 return EOK; 757 } 758 748 759 unsigned hc_speed_to_psiv(usb_speed_t speed) 749 760 { -
uspace/drv/bus/usb/xhci/hc.h
rf35749e r8300c72 1 1 /* 2 * Copyright (c) 2025 Jiri Svoboda 2 3 * Copyright (c) 2018 Ondrej Hlavaty, Jan Hrach, Jaroslav Jindrak, Petr Manek 3 4 * All rights reserved. … … 119 120 extern errno_t hc_start(xhci_hc_t *); 120 121 extern void hc_fini(xhci_hc_t *); 122 extern errno_t hc_quiesce(xhci_hc_t *); 121 123 122 124 extern void hc_ring_doorbell(xhci_hc_t *, unsigned, unsigned); -
uspace/drv/bus/usb/xhci/main.c
rf35749e r8300c72 1 1 /* 2 * Copyright (c) 2025 Jiri Svoboda 2 3 * Copyright (c) 2018 Ondrej Hlavaty, Petr Manek 3 4 * All rights reserved. … … 94 95 } 95 96 97 static errno_t hcd_hc_quiesce(hc_device_t *hcd) 98 { 99 xhci_hc_t *hc = hcd_to_hc(hcd); 100 hc_quiesce(hc); 101 return EOK; 102 } 103 96 104 static const hc_driver_t xhci_driver = { 97 105 .name = NAME, … … 103 111 .start = hcd_start, 104 112 .hc_gone = hcd_hc_gone, 113 .hc_quiesce = hcd_hc_quiesce 105 114 }; 106 115 -
uspace/drv/nic/e1k/e1k.c
rf35749e r8300c72 1 1 /* 2 * Copyright (c) 2025 Jiri Svoboda 2 3 * Copyright (c) 2011 Zdenek Bouska 3 4 * All rights reserved. … … 220 221 221 222 static errno_t e1000_dev_add(ddf_dev_t *); 223 static errno_t e1000_dev_quiesce(ddf_dev_t *); 222 224 223 225 /** Basic driver operations for E1000 driver */ 224 226 static driver_ops_t e1000_driver_ops = { 225 .dev_add = e1000_dev_add 227 .dev_add = e1000_dev_add, 228 .dev_quiesce = e1000_dev_quiesce 226 229 }; 227 230 … … 2223 2226 } 2224 2227 2228 /** Quiesce E1000 device. 2229 * 2230 * @param dev E1000 device. 2231 * 2232 */ 2233 errno_t e1000_dev_quiesce(ddf_dev_t *dev) 2234 { 2235 nic_t *nic = ddf_dev_data_get(dev); 2236 e1000_t *e1000 = DRIVER_DATA_NIC(nic); 2237 errno_t rc; 2238 2239 ddf_msg(LVL_DEBUG, "e1000_dev_quiesce()"); 2240 2241 e1000_disable_interrupts(e1000); 2242 rc = e1000_reset(nic); 2243 if (rc != EOK) 2244 ddf_msg(LVL_ERROR, "e1000_dev_quiesce failed"); 2245 return rc; 2246 } 2247 2225 2248 /** Read 16-bit value from EEPROM of E1000 adapter 2226 2249 *
Note:
See TracChangeset
for help on using the changeset viewer.
