Changeset 132ab5d1 in mainline for uspace/drv/nic/e1k/e1k.c
- Timestamp:
- 2018-01-30T03:20:45Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5a6cc679
- Parents:
- 8bfb163 (diff), 6a5d05b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 edited
-
uspace/drv/nic/e1k/e1k.c (modified) (18 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/nic/e1k/e1k.c
r8bfb163 r132ab5d1 33 33 */ 34 34 35 #include <async.h> 35 36 #include <assert.h> 36 37 #include <stdio.h> … … 38 39 #include <adt/list.h> 39 40 #include <align.h> 40 #include <thread.h>41 41 #include <byteorder.h> 42 42 #include <as.h> … … 372 372 fibril_mutex_unlock(&e1000->ctrl_lock); 373 373 374 thread_usleep(10);374 async_usleep(10); 375 375 376 376 fibril_mutex_lock(&e1000->ctrl_lock); … … 1237 1237 /** Handle device interrupt 1238 1238 * 1239 * @param iid IPC call id1240 1239 * @param icall IPC call structure 1241 1240 * @param dev E1000 device 1242 1241 * 1243 1242 */ 1244 static void e1000_interrupt_handler(ipc_call id_t iid, ipc_call_t *icall,1243 static void e1000_interrupt_handler(ipc_call_t *icall, 1245 1244 ddf_dev_t *dev) 1246 1245 { … … 1260 1259 * @param nic Driver data 1261 1260 * 1262 * @return IRQ capability handle if the handler was registered 1263 * @return Negative error code otherwise 1264 * 1265 */ 1266 inline static int e1000_register_int_handler(nic_t *nic) 1261 * @param[out] handle IRQ capability handle if the handler was registered 1262 * 1263 * @return An error code otherwise 1264 * 1265 */ 1266 inline static int e1000_register_int_handler(nic_t *nic, cap_handle_t *handle) 1267 1267 { 1268 1268 e1000_t *e1000 = DRIVER_DATA_NIC(nic); … … 1275 1275 e1000_irq_code.cmds[2].addr = e1000->reg_base_phys + E1000_IMC; 1276 1276 1277 int cap= register_interrupt_handler(nic_get_ddf_dev(nic), e1000->irq,1278 e1000_interrupt_handler, &e1000_irq_code );1277 int rc = register_interrupt_handler(nic_get_ddf_dev(nic), e1000->irq, 1278 e1000_interrupt_handler, &e1000_irq_code, handle); 1279 1279 1280 1280 fibril_mutex_unlock(&irq_reg_mutex); 1281 return cap;1281 return rc; 1282 1282 } 1283 1283 … … 1370 1370 * 1371 1371 * @return EOK if succeed 1372 * @return Negativeerror code otherwise1372 * @return An error code otherwise 1373 1373 * 1374 1374 */ … … 1524 1524 * 1525 1525 * @return EOK if succeed 1526 * @return Negativeerror code otherwise1526 * @return An error code otherwise 1527 1527 * 1528 1528 */ … … 1725 1725 1726 1726 /* Wait for the reset */ 1727 thread_usleep(20);1727 async_usleep(20); 1728 1728 1729 1729 /* check if RST_BIT cleared */ … … 1813 1813 * transfers to descriptors. 1814 1814 */ 1815 thread_usleep(100);1815 async_usleep(100); 1816 1816 1817 1817 return EOK; … … 1940 1940 * 1941 1941 * @return EOK if succeed 1942 * @return Negativeerror code otherwise1942 * @return An error code otherwise 1943 1943 * 1944 1944 */ … … 1965 1965 * 1966 1966 * @return EOK if succeed 1967 * @return Negativeerror code otherwise1967 * @return An error code otherwise 1968 1968 * 1969 1969 */ … … 1993 1993 * 1994 1994 * @return EOK if succeed 1995 * @return Negativeerror code otherwise1995 * @return An error code otherwise 1996 1996 * 1997 1997 */ … … 2107 2107 * 2108 2108 * @return EOK if successed 2109 * @return Negativeerror code otherwise2109 * @return An error code otherwise 2110 2110 * 2111 2111 */ … … 2165 2165 ddf_fun_set_ops(fun, &e1000_dev_ops); 2166 2166 2167 int irq_cap = e1000_register_int_handler(nic);2168 if (irq_cap < 0) {2169 rc = irq_cap;2167 int irq_cap; 2168 rc = e1000_register_int_handler(nic, &irq_cap); 2169 if (rc != EOK) { 2170 2170 goto err_fun_create; 2171 2171 } … … 2239 2239 uint32_t eerd = E1000_REG_READ(e1000, E1000_EERD); 2240 2240 while ((eerd & e1000->info.eerd_done) == 0) { 2241 thread_usleep(1);2241 async_usleep(1); 2242 2242 eerd = E1000_REG_READ(e1000, E1000_EERD); 2243 2243 } … … 2255 2255 * 2256 2256 * @return EOK if succeed 2257 * @return Negativeerror code otherwise2257 * @return An error code otherwise 2258 2258 * 2259 2259 */ … … 2289 2289 * 2290 2290 * @return EOK if succeed 2291 * @return Negativeerror code otherwise2291 * @return An error code otherwise 2292 2292 */ 2293 2293 static int e1000_set_addr(ddf_fun_t *fun, const nic_address_t *addr)
Note:
See TracChangeset
for help on using the changeset viewer.
