Changeset 77a69ea in mainline for uspace/lib
- Timestamp:
- 2012-01-21T15:06:51Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ce7676c
- Parents:
- e86b8f0
- Location:
- uspace/lib
- Files:
-
- 12 edited
-
c/include/ipc/devman.h (modified) (1 diff)
-
c/include/ipc/net.h (modified) (1 diff)
-
c/include/ipc/net_net.h (modified) (1 diff)
-
drv/generic/driver.c (modified) (2 diffs)
-
drv/include/ddf/driver.h (modified) (1 diff)
-
net/generic/net_remote.c (modified) (1 diff)
-
net/include/net_interface.h (modified) (1 diff)
-
net/include/nil_remote.h (modified) (1 diff)
-
net/nil/nil_remote.c (modified) (2 diffs)
-
nic/include/nic.h (modified) (1 diff)
-
nic/src/nic_driver.c (modified) (2 diffs)
-
nic/src/nic_impl.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/ipc/devman.h
re86b8f0 r77a69ea 146 146 typedef enum { 147 147 DRIVER_DEV_ADD = IPC_FIRST_USER_METHOD, 148 DRIVER_DEV_ADDED,149 148 DRIVER_DEV_REMOVE, 150 149 DRIVER_DEV_GONE, -
uspace/lib/c/include/ipc/net.h
re86b8f0 r77a69ea 305 305 * 306 306 */ 307 #define IPC_GET_DEVICE_HANDLE(call) (( devman_handle_t) IPC_GET_ARG2(call))307 #define IPC_GET_DEVICE_HANDLE(call) ((service_id_t) IPC_GET_ARG2(call)) 308 308 309 309 /** Return the device driver service message argument. -
uspace/lib/c/include/ipc/net_net.h
re86b8f0 r77a69ea 54 54 NET_NET_GET_DEVICES_COUNT, 55 55 /** Return names and device IDs of all devices */ 56 NET_NET_GET_DEVICES, 57 /** Notify the networking service about a ready device */ 58 NET_NET_DRIVER_READY 56 NET_NET_GET_DEVICES 59 57 } net_messages; 60 58 -
uspace/lib/drv/generic/driver.c
re86b8f0 r77a69ea 303 303 } 304 304 305 static void driver_dev_added(ipc_callid_t iid, ipc_call_t *icall)306 {307 fibril_mutex_lock(&devices_mutex);308 ddf_dev_t *dev = driver_get_device(IPC_GET_ARG1(*icall));309 fibril_mutex_unlock(&devices_mutex);310 311 if (dev != NULL && driver->driver_ops->device_added != NULL)312 driver->driver_ops->device_added(dev);313 }314 315 305 static void driver_dev_remove(ipc_callid_t iid, ipc_call_t *icall) 316 306 { … … 460 450 case DRIVER_DEV_ADD: 461 451 driver_dev_add(callid, &call); 462 break;463 case DRIVER_DEV_ADDED:464 async_answer_0(callid, EOK);465 driver_dev_added(callid, &call);466 452 break; 467 453 case DRIVER_DEV_REMOVE: -
uspace/lib/drv/include/ddf/driver.h
re86b8f0 r77a69ea 145 145 /** Ask driver to offline a specific function */ 146 146 int (*fun_offline)(ddf_fun_t *); 147 148 /**149 * Notification that the device was succesfully added.150 * The driver can do any blocking operation without151 * blocking the device manager.152 *153 * XXX REMOVE THIS154 */155 void (*device_added)(ddf_dev_t *dev);156 147 } driver_ops_t; 157 148 -
uspace/lib/net/generic/net_remote.c
re86b8f0 r77a69ea 167 167 } 168 168 169 int net_driver_ready(async_sess_t *sess, devman_handle_t handle)170 {171 async_exch_t *exch = async_exchange_begin(sess);172 int rc = async_req_1_0(exch, NET_NET_DRIVER_READY, handle);173 async_exchange_end(exch);174 175 return rc;176 }177 178 169 /** @} 179 170 */ -
uspace/lib/net/include/net_interface.h
re86b8f0 r77a69ea 52 52 extern int net_get_devices_req(async_sess_t *, measured_string_t **, size_t *, 53 53 uint8_t **); 54 extern int net_driver_ready(async_sess_t *, devman_handle_t);55 54 extern async_sess_t *net_connect_module(void); 56 55 -
uspace/lib/net/include/nil_remote.h
re86b8f0 r77a69ea 34 34 #define __NET_NIL_REMOTE_H__ 35 35 36 #include <ipc/loc.h> 36 37 #include <net/device.h> 37 38 #include <net/packet.h> -
uspace/lib/net/nil/nil_remote.c
re86b8f0 r77a69ea 36 36 */ 37 37 38 #include <ipc/loc.h> 38 39 #include <nil_remote.h> 39 40 #include <generic.h> … … 123 124 124 125 int nil_device_req(async_sess_t *sess, nic_device_id_t device_id, 125 devman_handle_t handle, size_t mtu)126 service_id_t sid, size_t mtu) 126 127 { 127 128 async_exch_t *exch = async_exchange_begin(sess); 128 129 int rc = async_req_3_0(exch, NET_NIL_DEVICE, (sysarg_t) device_id, 129 (sysarg_t) handle, (sysarg_t) mtu);130 (sysarg_t) sid, (sysarg_t) mtu); 130 131 async_exchange_end(exch); 131 132 return rc; -
uspace/lib/nic/include/nic.h
re86b8f0 r77a69ea 219 219 extern void nic_set_poll_handlers(nic_t *, 220 220 poll_mode_change_handler, poll_request_handler); 221 222 /* Functions called in device_added */223 extern int nic_ready(nic_t *);224 221 225 222 /* General driver functions */ -
uspace/lib/nic/src/nic_driver.c
re86b8f0 r77a69ea 89 89 nic_iface_t *iface) 90 90 { 91 if (driver_ops) {92 if (!driver_ops->device_added)93 driver_ops->device_added = nic_device_added_impl;94 }95 96 91 if (dev_ops) { 97 92 if (!dev_ops->open) … … 464 459 } 465 460 466 /** Notify the NET service that the device is ready467 *468 * @param nic NICF structure469 *470 * @return EOK on success471 *472 */473 int nic_ready(nic_t *nic)474 {475 fibril_rwlock_read_lock(&nic->main_lock);476 477 async_sess_t *session = nic->net_session;478 devman_handle_t handle = nic->dev->handle;479 480 fibril_rwlock_read_unlock(&nic->main_lock);481 482 if (session == NULL)483 return EINVAL;484 485 return net_driver_ready(session, handle);486 }487 488 461 /** Inform the NICF about poll mode 489 462 * -
uspace/lib/nic/src/nic_impl.c
re86b8f0 r77a69ea 805 805 } 806 806 807 /** Default implementation of the device_added method808 *809 * Just calls nic_ready.810 *811 * @param dev812 *813 */814 void nic_device_added_impl(ddf_dev_t *dev)815 {816 nic_ready((nic_t *) dev->driver_data);817 }818 819 807 /** 820 808 * Default handler for unknown methods (outside of the NIC interface).
Note:
See TracChangeset
for help on using the changeset viewer.
