Changeset bd41ac52 in mainline for uspace/drv/nic/rtl8139
- Timestamp:
- 2018-08-25T22:21:25Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- cca80a2
- Parents:
- e2625b1a
- Location:
- uspace/drv/nic/rtl8139
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/nic/rtl8139/driver.c
re2625b1a rbd41ac52 313 313 314 314 static errno_t rtl8139_poll_mode_change(nic_t *nic_data, nic_poll_mode_t mode, 315 const struct time val*period);315 const struct timespec *period); 316 316 static void rtl8139_poll(nic_t *nic_data); 317 317 … … 2068 2068 */ 2069 2069 static errno_t rtl8139_poll_mode_change(nic_t *nic_data, nic_poll_mode_t mode, 2070 const struct time val*period)2070 const struct timespec *period) 2071 2071 { 2072 2072 assert(nic_data); -
uspace/drv/nic/rtl8139/general.c
re2625b1a rbd41ac52 85 85 */ 86 86 errno_t rtl8139_timer_act_init(rtl8139_timer_act_t *ta, uint32_t timer_freq, 87 const struct time val*time)87 const struct timespec *time) 88 88 { 89 89 if (!ta || timer_freq == 0 || !time) … … 95 95 ta->full_val = seconds_in_reg * tics_per_ms * 1000; 96 96 97 struct time valremains = *time;97 struct timespec remains = *time; 98 98 ta->full_skips = remains.tv_sec / seconds_in_reg; 99 99 remains.tv_sec = remains.tv_sec % seconds_in_reg; 100 100 101 if ( remains.tv_usec> RTL8139_USEC_IN_SEC) {102 remains.tv_sec += remains.tv_usec/ RTL8139_USEC_IN_SEC;103 remains.tv_ usec = remains.tv_usec% RTL8139_USEC_IN_SEC;101 if (NSEC2USEC(remains.tv_nsec) > RTL8139_USEC_IN_SEC) { 102 remains.tv_sec += NSEC2USEC(remains.tv_nsec) / RTL8139_USEC_IN_SEC; 103 remains.tv_nsec = NSEC2USEC(remains.tv_nsec) % RTL8139_USEC_IN_SEC; 104 104 105 105 /* it can be increased above seconds_in_reg again */ … … 108 108 } 109 109 110 ta->last_val = remains.tv_sec * 1000 + remains.tv_usec / 1000;110 ta->last_val = SEC2MSEC(remains.tv_sec) + NSEC2MSEC(remains.tv_nsec); 111 111 ta->last_val *= tics_per_ms; 112 112 -
uspace/drv/nic/rtl8139/general.h
re2625b1a rbd41ac52 36 36 37 37 #include <stddef.h> 38 #include <stdint.h> 38 39 #include <time.h> 39 40 … … 62 63 size_t); 63 64 extern errno_t rtl8139_timer_act_init(rtl8139_timer_act_t *, uint32_t, 64 const struct time val*);65 const struct timespec *); 65 66 extern int rtl8139_timer_act_step(rtl8139_timer_act_t *, uint32_t *); 66 67
Note:
See TracChangeset
for help on using the changeset viewer.