Lines Matching refs:ev
81 struct rfkill_event ev; member
192 static void rfkill_fill_event(struct rfkill_event *ev, struct rfkill *rfkill, in rfkill_fill_event() argument
197 ev->idx = rfkill->idx; in rfkill_fill_event()
198 ev->type = rfkill->type; in rfkill_fill_event()
199 ev->op = op; in rfkill_fill_event()
202 ev->hard = !!(rfkill->state & RFKILL_BLOCK_HW); in rfkill_fill_event()
203 ev->soft = !!(rfkill->state & (RFKILL_BLOCK_SW | in rfkill_fill_event()
211 struct rfkill_int_event *ev; in rfkill_send_events() local
214 ev = kzalloc(sizeof(*ev), GFP_KERNEL); in rfkill_send_events()
215 if (!ev) in rfkill_send_events()
217 rfkill_fill_event(&ev->ev, rfkill, op); in rfkill_send_events()
219 list_add_tail(&ev->list, &data->events); in rfkill_send_events()
1041 struct rfkill_int_event *ev, *tmp; in rfkill_fop_open() local
1059 ev = kzalloc(sizeof(*ev), GFP_KERNEL); in rfkill_fop_open()
1060 if (!ev) in rfkill_fop_open()
1062 rfkill_fill_event(&ev->ev, rfkill, RFKILL_OP_ADD); in rfkill_fop_open()
1063 list_add_tail(&ev->list, &data->events); in rfkill_fop_open()
1077 list_for_each_entry_safe(ev, tmp, &data->events, list) in rfkill_fop_open()
1078 kfree(ev); in rfkill_fop_open()
1102 struct rfkill_int_event *ev; in rfkill_fop_read() local
1125 ev = list_first_entry(&data->events, struct rfkill_int_event, in rfkill_fop_read()
1128 sz = min_t(unsigned long, sizeof(ev->ev), count); in rfkill_fop_read()
1130 if (copy_to_user(buf, &ev->ev, sz)) in rfkill_fop_read()
1133 list_del(&ev->list); in rfkill_fop_read()
1134 kfree(ev); in rfkill_fop_read()
1144 struct rfkill_event ev; in rfkill_fop_write() local
1155 count = min(count, sizeof(ev)); in rfkill_fop_write()
1156 if (copy_from_user(&ev, buf, count)) in rfkill_fop_write()
1159 if (ev.op != RFKILL_OP_CHANGE && ev.op != RFKILL_OP_CHANGE_ALL) in rfkill_fop_write()
1162 if (ev.type >= NUM_RFKILL_TYPES) in rfkill_fop_write()
1167 if (ev.op == RFKILL_OP_CHANGE_ALL) { in rfkill_fop_write()
1168 if (ev.type == RFKILL_TYPE_ALL) { in rfkill_fop_write()
1171 rfkill_global_states[i].cur = ev.soft; in rfkill_fop_write()
1173 rfkill_global_states[ev.type].cur = ev.soft; in rfkill_fop_write()
1178 if (rfkill->idx != ev.idx && ev.op != RFKILL_OP_CHANGE_ALL) in rfkill_fop_write()
1181 if (rfkill->type != ev.type && ev.type != RFKILL_TYPE_ALL) in rfkill_fop_write()
1184 rfkill_set_block(rfkill, ev.soft); in rfkill_fop_write()
1194 struct rfkill_int_event *ev, *tmp; in rfkill_fop_release() local
1201 list_for_each_entry_safe(ev, tmp, &data->events, list) in rfkill_fop_release()
1202 kfree(ev); in rfkill_fop_release()