Changes in uspace/drv/nic/e1k/e1k.c [cde999a:d51838f] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/nic/e1k/e1k.c
rcde999a rd51838f 33 33 */ 34 34 35 #include <async.h>36 35 #include <assert.h> 37 36 #include <stdio.h> … … 39 38 #include <adt/list.h> 40 39 #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 async_usleep(10);374 thread_usleep(10); 375 375 376 376 fibril_mutex_lock(&e1000->ctrl_lock); … … 1237 1237 /** Handle device interrupt 1238 1238 * 1239 * @param iid IPC call id 1239 1240 * @param icall IPC call structure 1240 1241 * @param dev E1000 device 1241 1242 * 1242 1243 */ 1243 static void e1000_interrupt_handler(ipc_call _t *icall,1244 static void e1000_interrupt_handler(ipc_callid_t iid, ipc_call_t *icall, 1244 1245 ddf_dev_t *dev) 1245 1246 { … … 1259 1260 * @param nic Driver data 1260 1261 * 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) 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) 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 rc= register_interrupt_handler(nic_get_ddf_dev(nic), e1000->irq,1278 e1000_interrupt_handler, &e1000_irq_code , handle);1277 int cap = register_interrupt_handler(nic_get_ddf_dev(nic), e1000->irq, 1278 e1000_interrupt_handler, &e1000_irq_code); 1279 1279 1280 1280 fibril_mutex_unlock(&irq_reg_mutex); 1281 return rc;1281 return cap; 1282 1282 } 1283 1283 … … 1370 1370 * 1371 1371 * @return EOK if succeed 1372 * @return Anerror code otherwise1372 * @return Negative error code otherwise 1373 1373 * 1374 1374 */ … … 1524 1524 * 1525 1525 * @return EOK if succeed 1526 * @return Anerror code otherwise1526 * @return Negative error code otherwise 1527 1527 * 1528 1528 */ … … 1725 1725 1726 1726 /* Wait for the reset */ 1727 async_usleep(20);1727 thread_usleep(20); 1728 1728 1729 1729 /* check if RST_BIT cleared */ … … 1813 1813 * transfers to descriptors. 1814 1814 */ 1815 async_usleep(100);1815 thread_usleep(100); 1816 1816 1817 1817 return EOK; … … 1940 1940 * 1941 1941 * @return EOK if succeed 1942 * @return Anerror code otherwise1942 * @return Negative error code otherwise 1943 1943 * 1944 1944 */ … … 1965 1965 * 1966 1966 * @return EOK if succeed 1967 * @return Anerror code otherwise1967 * @return Negative error code otherwise 1968 1968 * 1969 1969 */ … … 1993 1993 * 1994 1994 * @return EOK if succeed 1995 * @return Anerror code otherwise1995 * @return Negative error code otherwise 1996 1996 * 1997 1997 */ … … 2107 2107 * 2108 2108 * @return EOK if successed 2109 * @return Anerror code otherwise2109 * @return Negative error code otherwise 2110 2110 * 2111 2111 */ … … 2165 2165 ddf_fun_set_ops(fun, &e1000_dev_ops); 2166 2166 2167 int irq_cap ;2168 rc = e1000_register_int_handler(nic, &irq_cap);2169 if (rc != EOK) {2167 int irq_cap = e1000_register_int_handler(nic); 2168 if (irq_cap < 0) { 2169 rc = irq_cap; 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 async_usleep(1);2241 thread_usleep(1); 2242 2242 eerd = E1000_REG_READ(e1000, E1000_EERD); 2243 2243 } … … 2255 2255 * 2256 2256 * @return EOK if succeed 2257 * @return Anerror code otherwise2257 * @return Negative error code otherwise 2258 2258 * 2259 2259 */ … … 2289 2289 * 2290 2290 * @return EOK if succeed 2291 * @return Anerror code otherwise2291 * @return Negative 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.