* Find free event timer hardware with specified parameters. */
| 135 | * Find free event timer hardware with specified parameters. |
| 136 | */ |
| 137 | struct eventtimer * |
| 138 | et_find(const char *name, int check, int want) |
| 139 | { |
| 140 | struct eventtimer *et = NULL; |
| 141 | |
| 142 | SLIST_FOREACH(et, &eventtimers, et_all) { |
| 143 | if (et->et_active) |
| 144 | continue; |
| 145 | if (name != NULL && strcasecmp(et->et_name, name) != 0) |
| 146 | continue; |
| 147 | if (name == NULL && et->et_quality < 0) |
| 148 | continue; |
| 149 | if ((et->et_flags & check) != want) |
| 150 | continue; |
| 151 | break; |
| 152 | } |
| 153 | return (et); |
| 154 | } |
| 155 | |
| 156 | /* |
| 157 | * Initialize event timer hardware. Set callbacks. |
no test coverage detected