Searched refs:td (Results 1 - 144 of 144) sorted by relevance

/linux-4.4.14/drivers/usb/host/
H A Dfhci-mem.c27 static void init_td(struct td *td) init_td() argument
29 memset(td, 0, sizeof(*td)); init_td()
30 INIT_LIST_HEAD(&td->node); init_td()
31 INIT_LIST_HEAD(&td->frame_lh); init_td()
41 static struct td *get_empty_td(struct fhci_hcd *fhci) get_empty_td()
43 struct td *td; get_empty_td() local
46 td = list_entry(fhci->empty_tds.next, struct td, node); get_empty_td()
49 td = kmalloc(sizeof(*td), GFP_ATOMIC); get_empty_td()
50 if (!td) get_empty_td()
53 init_td(td); get_empty_td()
56 return td; get_empty_td()
59 void fhci_recycle_empty_td(struct fhci_hcd *fhci, struct td *td) fhci_recycle_empty_td() argument
61 init_td(td); fhci_recycle_empty_td()
62 list_add(&td->node, &fhci->empty_tds); fhci_recycle_empty_td()
89 struct td *fhci_td_fill(struct fhci_hcd *fhci, struct urb *urb, fhci_td_fill()
94 struct td *td = get_empty_td(fhci); fhci_td_fill() local
96 if (!td) fhci_td_fill()
99 td->urb = urb; fhci_td_fill()
100 td->ed = ed; fhci_td_fill()
101 td->type = type; fhci_td_fill()
102 td->toggle = toggle; fhci_td_fill()
103 td->data = data; fhci_td_fill()
104 td->len = len; fhci_td_fill()
105 td->iso_index = index; fhci_td_fill()
106 td->interval = interval; fhci_td_fill()
107 td->start_frame = start_frame; fhci_td_fill()
108 td->ioc = ioc; fhci_td_fill()
109 td->status = USB_TD_OK; fhci_td_fill()
111 urb_priv->tds[index] = td; fhci_td_fill()
113 return td; fhci_td_fill()
H A Dfhci-q.c57 void fhci_add_td_to_frame(struct fhci_time_frame *frame, struct td *td) fhci_add_td_to_frame() argument
59 list_add_tail(&td->frame_lh, &frame->tds_list); fhci_add_td_to_frame()
62 void fhci_add_tds_to_ed(struct ed *ed, struct td **td_list, int number) fhci_add_tds_to_ed()
67 struct td *td = td_list[i]; fhci_add_tds_to_ed() local
68 list_add_tail(&td->node, &ed->td_list); fhci_add_tds_to_ed()
74 static struct td *peek_td_from_ed(struct ed *ed) peek_td_from_ed()
76 struct td *td; peek_td_from_ed() local
79 td = list_entry(ed->td_list.next, struct td, node); peek_td_from_ed()
81 td = NULL; peek_td_from_ed()
83 return td; peek_td_from_ed()
86 struct td *fhci_remove_td_from_frame(struct fhci_time_frame *frame) fhci_remove_td_from_frame()
88 struct td *td; fhci_remove_td_from_frame() local
91 td = list_entry(frame->tds_list.next, struct td, frame_lh); fhci_remove_td_from_frame()
94 td = NULL; fhci_remove_td_from_frame()
96 return td; fhci_remove_td_from_frame()
99 struct td *fhci_peek_td_from_frame(struct fhci_time_frame *frame) fhci_peek_td_from_frame()
101 struct td *td; fhci_peek_td_from_frame() local
104 td = list_entry(frame->tds_list.next, struct td, frame_lh); fhci_peek_td_from_frame()
106 td = NULL; fhci_peek_td_from_frame()
108 return td; fhci_peek_td_from_frame()
111 struct td *fhci_remove_td_from_ed(struct ed *ed) fhci_remove_td_from_ed()
113 struct td *td; fhci_remove_td_from_ed() local
116 td = list_entry(ed->td_list.next, struct td, node); fhci_remove_td_from_ed()
121 ed->td_head = list_entry(ed->td_list.next, struct td, fhci_remove_td_from_ed()
126 td = NULL; fhci_remove_td_from_ed()
128 return td; fhci_remove_td_from_ed()
131 struct td *fhci_remove_td_from_done_list(struct fhci_controller_list *p_list) fhci_remove_td_from_done_list()
133 struct td *td; fhci_remove_td_from_done_list() local
136 td = list_entry(p_list->done_list.next, struct td, node); fhci_remove_td_from_done_list()
139 td = NULL; fhci_remove_td_from_done_list()
141 return td; fhci_remove_td_from_done_list()
146 struct td *td; fhci_move_td_from_ed_to_done_list() local
148 td = ed->td_head; fhci_move_td_from_ed_to_done_list()
149 list_del_init(&td->node); fhci_move_td_from_ed_to_done_list()
153 ed->td_head = list_entry(ed->td_list.next, struct td, node); fhci_move_td_from_ed_to_done_list()
158 ed->toggle_carry = td->toggle; fhci_move_td_from_ed_to_done_list()
159 list_add_tail(&td->node, &usb->hc_list->done_list); fhci_move_td_from_ed_to_done_list()
160 if (td->ioc) fhci_move_td_from_ed_to_done_list()
178 ed->td_head = list_entry(ed->td_list.next, struct td, node); free_urb_priv()
218 void fhci_done_td(struct urb *urb, struct td *td) fhci_done_td() argument
220 struct ed *ed = td->ed; fhci_done_td()
221 u32 cc = td->status; fhci_done_td()
231 len = urb->iso_frame_desc[td->iso_index].length; fhci_done_td()
233 len = td->actual_len; fhci_done_td()
236 urb->iso_frame_desc[td->iso_index].actual_length = len; fhci_done_td()
237 urb->iso_frame_desc[td->iso_index].status = fhci_done_td()
246 if (td->error_cnt >= 3) fhci_done_td()
263 if (td->type != FHCI_TA_SETUP || td->iso_index != 0) fhci_done_td()
264 urb->actual_length += td->actual_len; fhci_done_td()
271 struct td *td = peek_td_from_ed(ed); fhci_del_ed_list() local
272 struct urb *urb = td->urb; fhci_del_ed_list()
276 td = fhci_remove_td_from_ed(ed); fhci_del_ed_list()
278 if (td->status != USB_TD_INPROGRESS) fhci_del_ed_list()
279 fhci_done_td(urb, td); fhci_del_ed_list()
H A Dohci-mem.c40 sizeof (struct td), ohci_mem_init()
72 static inline struct td * dma_to_td()
75 struct td *td; dma_to_td() local
78 td = hc->td_hash [TD_HASH_FUNC(td_dma)]; dma_to_td()
79 while (td && td->td_dma != td_dma) dma_to_td()
80 td = td->td_hash; dma_to_td()
81 return td; dma_to_td()
85 static struct td * td_alloc()
89 struct td *td; td_alloc() local
91 td = dma_pool_alloc (hc->td_cache, mem_flags, &dma); td_alloc()
92 if (td) { td_alloc()
94 memset (td, 0, sizeof *td); td_alloc()
95 td->hwNextTD = cpu_to_hc32 (hc, dma); td_alloc()
96 td->td_dma = dma; td_alloc()
99 return td; td_alloc()
103 td_free (struct ohci_hcd *hc, struct td *td) td_free() argument
105 struct td **prev = &hc->td_hash [TD_HASH_FUNC (td->td_dma)]; td_free()
107 while (*prev && *prev != td) td_free()
110 *prev = td->td_hash; td_free()
111 else if ((td->hwINFO & cpu_to_hc32(hc, TD_DONE)) != 0) td_free()
112 ohci_dbg (hc, "no hash for td %p\n", td); td_free()
113 dma_pool_free (hc->td_cache, td, td->td_dma); td_free()
H A Dfhci-sched.c46 struct td *td; fhci_transaction_confirm() local
52 td = fhci_remove_td_from_frame(usb->actual_frame); fhci_transaction_confirm()
53 td_pkt = td->pkt; fhci_transaction_confirm()
55 td->status = pkt->status; fhci_transaction_confirm()
56 if (td->type == FHCI_TA_IN && td_pkt->info & PKT_DUMMY_PACKET) { fhci_transaction_confirm()
57 if ((td->data + td->actual_len) && trans_len) fhci_transaction_confirm()
58 memcpy(td->data + td->actual_len, pkt->data, fhci_transaction_confirm()
65 ed = td->ed; fhci_transaction_confirm()
68 struct td *td_next = fhci_transaction_confirm()
69 list_entry(ed->td_list.next->next, struct td, fhci_transaction_confirm()
74 td->actual_len = trans_len; fhci_transaction_confirm()
76 } else if ((td->status & USB_TD_ERROR) && fhci_transaction_confirm()
77 !(td->status & USB_TD_TX_ER_NAK)) { fhci_transaction_confirm()
83 if ((td->status & USB_TD_RX_DATA_UNDERUN) || fhci_transaction_confirm()
84 (td->status & USB_TD_TX_ER_STALL) || fhci_transaction_confirm()
85 (td->status & USB_TD_RX_ER_PID) || fhci_transaction_confirm()
86 (++td->error_cnt >= 3)) { fhci_transaction_confirm()
90 if (td->status & USB_TD_RX_DATA_UNDERUN) { fhci_transaction_confirm()
91 fhci_dbg(usb->fhci, "td err fu\n"); fhci_transaction_confirm()
92 td->toggle = !td->toggle; fhci_transaction_confirm()
93 td->actual_len += trans_len; fhci_transaction_confirm()
95 fhci_dbg(usb->fhci, "td err f!u\n"); fhci_transaction_confirm()
98 fhci_dbg(usb->fhci, "td err !f\n"); fhci_transaction_confirm()
100 td->nak_cnt = 0; fhci_transaction_confirm()
101 td->error_cnt++; fhci_transaction_confirm()
102 td->status = USB_TD_OK; fhci_transaction_confirm()
104 } else if (td->status & USB_TD_TX_ER_NAK) { fhci_transaction_confirm()
106 fhci_vdbg(usb->fhci, "td nack\n"); fhci_transaction_confirm()
107 td->nak_cnt++; fhci_transaction_confirm()
108 td->error_cnt = 0; fhci_transaction_confirm()
109 td->status = USB_TD_OK; fhci_transaction_confirm()
112 td->error_cnt = 0; fhci_transaction_confirm()
113 td->nak_cnt = 0; fhci_transaction_confirm()
114 td->toggle = !td->toggle; fhci_transaction_confirm()
115 td->actual_len += trans_len; fhci_transaction_confirm()
117 if (td->len == td->actual_len) fhci_transaction_confirm()
133 struct td *td; fhci_flush_all_transmissions() local
140 while ((td = fhci_peek_td_from_frame(usb->actual_frame)) != NULL) { fhci_flush_all_transmissions()
141 struct packet *pkt = td->pkt; fhci_flush_all_transmissions()
159 static int add_packet(struct fhci_usb *usb, struct ed *ed, struct td *td) add_packet() argument
166 if (td->toggle == USB_TD_TOGGLE_CARRY) add_packet()
167 td->toggle = ed->toggle_carry; add_packet()
171 len = td->len; add_packet()
172 if (td->type != FHCI_TA_IN) add_packet()
173 data = td->data; add_packet()
177 len = min(td->len - td->actual_len, ed->max_pkt_size); add_packet()
178 if (!((td->type == FHCI_TA_IN) && add_packet()
179 ((len + td->actual_len) == td->len))) add_packet()
180 data = td->data + td->actual_len; add_packet()
183 len = min(td->len, ed->max_pkt_size); add_packet()
184 if (!((td->type == FHCI_TA_IN) && add_packet()
185 ((td->len + CRC_SIZE) >= ed->max_pkt_size))) add_packet()
186 data = td->data; add_packet()
221 td->pkt = pkt; add_packet()
233 td->status = USB_TD_INPROGRESS; add_packet()
236 fhci_add_td_to_frame(usb->actual_frame, td); add_packet()
243 } else if (fhci_host_transaction(usb, pkt, td->type, ed->dev_addr, add_packet()
244 ed->ep_addr, ed->mode, ed->speed, td->toggle)) { add_packet()
246 list_del_init(&td->frame_lh); add_packet()
247 td->status = USB_TD_OK; add_packet()
284 struct td *td; scan_ed_list() local
289 td = ed->td_head; list_for_each_entry()
291 if (!td || (td && td->status == USB_TD_INPROGRESS)) list_for_each_entry()
296 td->status = USB_TD_OK; list_for_each_entry()
309 td->start_frame) & 0x7ff) < td->interval)) list_for_each_entry()
312 if (add_packet(usb, ed, td) < 0) list_for_each_entry()
316 td->start_frame = usb->actual_frame->frame_num; list_for_each_entry()
639 struct td *td; process_done_list() local
647 td = fhci_remove_td_from_done_list(fhci->hc_list); process_done_list()
648 while (td != NULL) { process_done_list()
649 urb = td->urb; process_done_list()
651 ed = td->ed; process_done_list()
654 fhci_done_td(urb, td); process_done_list()
676 td = fhci_remove_td_from_done_list(fhci->hc_list); process_done_list()
708 struct td *td; fhci_queue_urb() local
779 td = fhci_td_fill(fhci, urb, urb_priv, ed, cnt, fhci_queue_urb()
790 td = fhci_td_fill(fhci, urb, urb_priv, ed, cnt, fhci_queue_urb()
798 td = fhci_td_fill(fhci, urb, urb_priv, ed, cnt, fhci_queue_urb()
807 td = fhci_td_fill(fhci, urb, urb_priv, ed, cnt++, fhci_queue_urb()
817 td = fhci_td_fill(fhci, urb, urb_priv, ed, cnt++, FHCI_TA_SETUP, fhci_queue_urb()
822 td = fhci_td_fill(fhci, urb, urb_priv, ed, cnt++, fhci_queue_urb()
831 td = fhci_td_fill(fhci, urb, urb_priv, ed, cnt++, fhci_queue_urb()
836 td = fhci_td_fill(fhci, urb, urb_priv, ed, cnt++, fhci_queue_urb()
853 td = fhci_td_fill(fhci, urb, urb_priv, ed, cnt, fhci_queue_urb()
H A Dr8a66597-hcd.c643 static void pipe_setting(struct r8a66597 *r8a66597, struct r8a66597_td *td) pipe_setting() argument
646 struct urb *urb = td->urb; pipe_setting()
648 if (td->pipenum > 0) { pipe_setting()
649 info = &td->pipe->info; pipe_setting()
656 r8a66597_pipe_toggle(r8a66597, td->pipe, 0); pipe_setting()
657 pipe_toggle_set(r8a66597, td->pipe, urb, 0); pipe_setting()
658 clear_all_buffer(r8a66597, td->pipe); pipe_setting()
662 pipe_toggle_restore(r8a66597, td->pipe, urb); pipe_setting()
850 struct r8a66597_td *td, *next; force_dequeue() local
857 list_for_each_entry_safe(td, next, list, queue) { list_for_each_entry_safe()
858 if (td->address != address) list_for_each_entry_safe()
861 urb = td->urb; list_for_each_entry_safe()
862 list_del(&td->queue); list_for_each_entry_safe()
863 kfree(td); list_for_each_entry_safe()
1080 struct r8a66597_td *td) prepare_setup_packet()
1083 __le16 *p = (__le16 *)td->urb->setup_packet; prepare_setup_packet()
1086 r8a66597_write(r8a66597, make_devsel(td->address) | td->maxpacket, prepare_setup_packet()
1099 struct r8a66597_td *td) prepare_packet_read()
1101 struct urb *urb = td->urb; prepare_packet_read()
1108 r8a66597_pipe_toggle(r8a66597, td->pipe, 1); prepare_packet_read()
1111 pipe_irq_disable(r8a66597, td->pipenum); prepare_packet_read()
1112 pipe_start(r8a66597, td->pipe); prepare_packet_read()
1113 pipe_irq_enable(r8a66597, urb, td->pipenum); prepare_packet_read()
1116 pipe_irq_disable(r8a66597, td->pipenum); prepare_packet_read()
1117 pipe_setting(r8a66597, td); prepare_packet_read()
1118 pipe_stop(r8a66597, td->pipe); prepare_packet_read()
1119 r8a66597_write(r8a66597, ~(1 << td->pipenum), BRDYSTS); prepare_packet_read()
1121 if (td->pipe->pipetre) { prepare_packet_read()
1123 td->pipe->pipetre); prepare_packet_read()
1127 td->maxpacket), prepare_packet_read()
1128 td->pipe->pipetrn); prepare_packet_read()
1130 td->pipe->pipetre); prepare_packet_read()
1133 pipe_start(r8a66597, td->pipe); prepare_packet_read()
1134 pipe_irq_enable(r8a66597, urb, td->pipenum); prepare_packet_read()
1141 struct r8a66597_td *td) prepare_packet_write()
1144 struct urb *urb = td->urb; prepare_packet_write()
1147 pipe_stop(r8a66597, td->pipe); prepare_packet_write()
1152 r8a66597_pipe_toggle(r8a66597, td->pipe, 1); prepare_packet_write()
1157 pipe_setting(r8a66597, td); prepare_packet_write()
1158 if (td->pipe->pipetre) prepare_packet_write()
1159 r8a66597_bclr(r8a66597, TRENB, td->pipe->pipetre); prepare_packet_write()
1161 r8a66597_write(r8a66597, ~(1 << td->pipenum), BRDYSTS); prepare_packet_write()
1163 fifo_change_from_pipe(r8a66597, td->pipe); prepare_packet_write()
1164 tmp = r8a66597_read(r8a66597, td->pipe->fifoctr); prepare_packet_write()
1166 pipe_irq_enable(r8a66597, urb, td->pipenum); prepare_packet_write()
1168 packet_write(r8a66597, td->pipenum); prepare_packet_write()
1169 pipe_start(r8a66597, td->pipe); prepare_packet_write()
1174 struct r8a66597_td *td) prepare_status_packet()
1176 struct urb *urb = td->urb; prepare_status_packet()
1178 r8a66597_pipe_toggle(r8a66597, td->pipe, 1); prepare_status_packet()
1179 pipe_stop(r8a66597, td->pipe); prepare_status_packet()
1196 pipe_start(r8a66597, td->pipe); prepare_status_packet()
1209 static int start_transfer(struct r8a66597 *r8a66597, struct r8a66597_td *td) start_transfer() argument
1211 BUG_ON(!td); start_transfer()
1213 switch (td->type) { start_transfer()
1215 if (is_set_address(td->urb->setup_packet)) { start_transfer()
1216 td->set_address = 1; start_transfer()
1217 td->urb->setup_packet[2] = alloc_usb_address(r8a66597, start_transfer()
1218 td->urb); start_transfer()
1219 if (td->urb->setup_packet[2] == 0) start_transfer()
1222 prepare_setup_packet(r8a66597, td); start_transfer()
1225 prepare_packet_read(r8a66597, td); start_transfer()
1228 prepare_packet_write(r8a66597, td); start_transfer()
1231 prepare_status_packet(r8a66597, td); start_transfer()
1241 static int check_transfer_finish(struct r8a66597_td *td, struct urb *urb) check_transfer_finish() argument
1244 if (urb->number_of_packets == td->iso_cnt) check_transfer_finish()
1250 (td->short_packet) || (td->zero_packet)) check_transfer_finish()
1257 static void set_td_timer(struct r8a66597 *r8a66597, struct r8a66597_td *td) set_td_timer() argument
1261 BUG_ON(!td); set_td_timer()
1263 if (!list_empty(&r8a66597->pipe_queue[td->pipenum]) && set_td_timer()
1264 !usb_pipecontrol(td->urb->pipe) && usb_pipein(td->urb->pipe)) { set_td_timer()
1265 r8a66597->timeout_map |= 1 << td->pipenum; set_td_timer()
1266 switch (usb_pipetype(td->urb->pipe)) { set_td_timer()
1276 mod_timer(&r8a66597->td_timer[td->pipenum], set_td_timer()
1282 static void finish_request(struct r8a66597 *r8a66597, struct r8a66597_td *td,
1291 if (likely(td)) {
1292 if (td->set_address && (status != 0 || urb->unlinked))
1295 pipe_toggle_save(r8a66597, td->pipe, urb);
1296 list_del(&td->queue);
1297 kfree(td); variable
1311 td = r8a66597_get_td(r8a66597, pipenum);
1312 if (unlikely(!td))
1315 start_transfer(r8a66597, td);
1316 set_td_timer(r8a66597, td);
1325 struct r8a66597_td *td = r8a66597_get_td(r8a66597, pipenum); packet_read() local
1330 if (unlikely(!td)) packet_read()
1332 urb = td->urb; packet_read()
1334 fifo_change_from_pipe(r8a66597, td->pipe); packet_read()
1335 tmp = r8a66597_read(r8a66597, td->pipe->fifoctr); packet_read()
1337 pipe_stop(r8a66597, td->pipe); packet_read()
1340 finish_request(r8a66597, td, pipenum, td->urb, -EPIPE); packet_read()
1348 urb->iso_frame_desc[td->iso_cnt].offset); packet_read()
1349 urb_len = urb->iso_frame_desc[td->iso_cnt].length; packet_read()
1354 bufsize = min(urb_len, (int) td->maxpacket); packet_read()
1366 td->zero_packet = 1; packet_read()
1368 td->short_packet = 1; packet_read()
1371 urb->iso_frame_desc[td->iso_cnt].actual_length = size; packet_read()
1372 urb->iso_frame_desc[td->iso_cnt].status = status; packet_read()
1373 td->iso_cnt++; packet_read()
1378 if (finish || check_transfer_finish(td, urb)) { packet_read()
1379 pipe_stop(r8a66597, td->pipe); packet_read()
1387 r8a66597_write(r8a66597, BCLR, td->pipe->fifoctr); packet_read()
1389 r8a66597_read_fifo(r8a66597, td->pipe->fifoaddr, packet_read()
1394 finish_request(r8a66597, td, pipenum, urb, status); packet_read()
1402 struct r8a66597_td *td = r8a66597_get_td(r8a66597, pipenum); packet_write() local
1405 if (unlikely(!td)) packet_write()
1407 urb = td->urb; packet_write()
1409 fifo_change_from_pipe(r8a66597, td->pipe); packet_write()
1410 tmp = r8a66597_read(r8a66597, td->pipe->fifoctr); packet_write()
1412 pipe_stop(r8a66597, td->pipe); packet_write()
1415 finish_request(r8a66597, td, pipenum, urb, -EPIPE); packet_write()
1420 bufsize = td->maxpacket; packet_write()
1423 urb->iso_frame_desc[td->iso_cnt].offset); packet_write()
1425 (int)urb->iso_frame_desc[td->iso_cnt].length); packet_write()
1436 r8a66597_write_fifo(r8a66597, td->pipe, buf, size); packet_write()
1437 if (!usb_pipebulk(urb->pipe) || td->maxpacket != size) packet_write()
1438 r8a66597_write(r8a66597, BVAL, td->pipe->fifoctr); packet_write()
1444 urb->iso_frame_desc[td->iso_cnt].actual_length = size; packet_write()
1445 urb->iso_frame_desc[td->iso_cnt].status = 0; packet_write()
1446 td->iso_cnt++; packet_write()
1450 if (check_transfer_finish(td, urb)) { packet_write()
1462 struct r8a66597_td *td = r8a66597_get_td(r8a66597, 0); check_next_phase() local
1466 if (unlikely(!td)) check_next_phase()
1468 urb = td->urb; check_next_phase()
1470 switch (td->type) { check_next_phase()
1473 if (check_transfer_finish(td, urb)) check_next_phase()
1474 td->type = USB_PID_ACK; check_next_phase()
1478 td->type = USB_PID_ACK; check_next_phase()
1480 td->type = USB_PID_OUT; check_next_phase()
1482 td->type = USB_PID_IN; check_next_phase()
1490 finish_request(r8a66597, td, 0, urb, status); check_next_phase()
1492 start_transfer(r8a66597, td); check_next_phase()
1497 struct r8a66597_td *td = r8a66597_get_td(r8a66597, pipenum); get_urb_error() local
1499 if (td) { get_urb_error()
1500 u16 pid = r8a66597_read(r8a66597, td->pipe->pipectr) & PID; get_urb_error()
1515 struct r8a66597_td *td; irq_pipe_ready() local
1521 td = r8a66597_get_td(r8a66597, 0); irq_pipe_ready()
1522 if (td && td->type == USB_PID_IN) irq_pipe_ready()
1532 td = r8a66597_get_td(r8a66597, pipenum); irq_pipe_ready()
1533 if (unlikely(!td)) irq_pipe_ready()
1536 if (td->type == USB_PID_IN) irq_pipe_ready()
1538 else if (td->type == USB_PID_OUT) irq_pipe_ready()
1550 struct r8a66597_td *td; irq_pipe_empty() local
1557 td = r8a66597_get_td(r8a66597, 0); irq_pipe_empty()
1558 if (td && td->type != USB_PID_OUT) irq_pipe_empty()
1566 struct r8a66597_td *td; irq_pipe_empty() local
1567 td = r8a66597_get_td(r8a66597, pipenum); irq_pipe_empty()
1568 if (unlikely(!td)) irq_pipe_empty()
1571 tmp = r8a66597_read(r8a66597, td->pipe->pipectr); irq_pipe_empty()
1575 finish_request(r8a66597, td, pipenum, td->urb, irq_pipe_empty()
1602 struct r8a66597_td *td; irq_pipe_nrdy() local
1603 td = r8a66597_get_td(r8a66597, pipenum); irq_pipe_nrdy()
1604 if (unlikely(!td)) irq_pipe_nrdy()
1609 pipe_stop(r8a66597, td->pipe); irq_pipe_nrdy()
1610 finish_request(r8a66597, td, pipenum, td->urb, status); irq_pipe_nrdy()
1741 struct r8a66597_td *td; r8a66597_interval_timer() local
1751 td = r8a66597_get_td(r8a66597, pipenum); r8a66597_interval_timer()
1752 if (td) r8a66597_interval_timer()
1753 start_transfer(r8a66597, td); r8a66597_interval_timer()
1764 struct r8a66597_td *td, *new_td = NULL; r8a66597_td_timer() local
1774 td = r8a66597_get_td(r8a66597, pipenum); r8a66597_td_timer()
1775 if (!td) { r8a66597_td_timer()
1780 if (td->urb->actual_length) { r8a66597_td_timer()
1781 set_td_timer(r8a66597, td); r8a66597_td_timer()
1785 pipe = td->pipe; r8a66597_td_timer()
1788 new_td = td; r8a66597_td_timer()
1794 new_td = td; r8a66597_td_timer()
1797 } while (td != new_td && td->address == new_td->address); r8a66597_td_timer()
1801 if (td == new_td) r8a66597_td_timer()
1869 struct r8a66597_td *td; r8a66597_make_td() local
1872 td = kzalloc(sizeof(struct r8a66597_td), GFP_ATOMIC); r8a66597_make_td()
1873 if (td == NULL) r8a66597_make_td()
1877 td->pipenum = pipenum; r8a66597_make_td()
1878 td->pipe = hep->hcpriv; r8a66597_make_td()
1879 td->urb = urb; r8a66597_make_td()
1880 td->address = get_urb_to_r8a66597_addr(r8a66597, urb); r8a66597_make_td()
1881 td->maxpacket = usb_maxpacket(urb->dev, urb->pipe, r8a66597_make_td()
1884 td->type = USB_PID_SETUP; r8a66597_make_td()
1886 td->type = USB_PID_IN; r8a66597_make_td()
1888 td->type = USB_PID_OUT; r8a66597_make_td()
1889 INIT_LIST_HEAD(&td->queue); r8a66597_make_td()
1891 return td; r8a66597_make_td()
1900 struct r8a66597_td *td = NULL; r8a66597_urb_enqueue() local
1930 td = r8a66597_make_td(r8a66597, urb, hep); r8a66597_urb_enqueue()
1931 if (td == NULL) { r8a66597_urb_enqueue()
1935 if (list_empty(&r8a66597->pipe_queue[td->pipenum])) r8a66597_urb_enqueue()
1937 list_add_tail(&td->queue, &r8a66597->pipe_queue[td->pipenum]); r8a66597_urb_enqueue()
1938 urb->hcpriv = td; r8a66597_urb_enqueue()
1941 if (td->pipe->info.timer_interval) { r8a66597_urb_enqueue()
1942 r8a66597->interval_map |= 1 << td->pipenum; r8a66597_urb_enqueue()
1943 mod_timer(&r8a66597->interval_timer[td->pipenum], r8a66597_urb_enqueue()
1945 td->pipe->info.timer_interval)); r8a66597_urb_enqueue()
1947 ret = start_transfer(r8a66597, td); r8a66597_urb_enqueue()
1949 list_del(&td->queue); r8a66597_urb_enqueue()
1950 kfree(td); r8a66597_urb_enqueue()
1954 set_td_timer(r8a66597, td); r8a66597_urb_enqueue()
1968 struct r8a66597_td *td; r8a66597_urb_dequeue() local
1978 td = urb->hcpriv; r8a66597_urb_dequeue()
1979 pipe_stop(r8a66597, td->pipe); r8a66597_urb_dequeue()
1980 pipe_irq_disable(r8a66597, td->pipenum); r8a66597_urb_dequeue()
1981 disable_irq_empty(r8a66597, td->pipenum); r8a66597_urb_dequeue()
1982 finish_request(r8a66597, td, td->pipenum, urb, status); r8a66597_urb_dequeue()
1994 struct r8a66597_td *td; r8a66597_endpoint_disable() local
2013 td = r8a66597_get_td(r8a66597, pipenum); r8a66597_endpoint_disable()
2014 if (td) r8a66597_endpoint_disable()
2015 urb = td->urb; r8a66597_endpoint_disable()
2016 finish_request(r8a66597, td, pipenum, urb, -ESHUTDOWN); r8a66597_endpoint_disable()
1079 prepare_setup_packet(struct r8a66597 *r8a66597, struct r8a66597_td *td) prepare_setup_packet() argument
1098 prepare_packet_read(struct r8a66597 *r8a66597, struct r8a66597_td *td) prepare_packet_read() argument
1140 prepare_packet_write(struct r8a66597 *r8a66597, struct r8a66597_td *td) prepare_packet_write() argument
1173 prepare_status_packet(struct r8a66597 *r8a66597, struct r8a66597_td *td) prepare_status_packet() argument
H A Dohci-q.c19 struct td *td; urb_free_priv() local
22 td = urb_priv->td [i]; urb_free_priv()
23 if (td) urb_free_priv()
24 td_free (hc, td); urb_free_priv()
412 struct td *td; ed_get() local
422 /* dummy td; end of td list for ed */ ed_get()
423 td = td_alloc (ohci, GFP_ATOMIC); ed_get()
424 if (!td) { ed_get()
430 ed->dummy = td; ed_get()
431 ed->hwTailP = cpu_to_hc32 (ohci, td->td_dma); ed_get()
518 struct td *td, *td_pt; td_fill() local
540 /* use this td as the next dummy */ td_fill()
541 td_pt = urb_priv->td [index]; td_fill()
544 td = urb_priv->td [index] = urb_priv->ed->dummy; td_fill()
547 td->ed = urb_priv->ed; td_fill()
548 td->next_dl_td = NULL; td_fill()
549 td->index = index; td_fill()
550 td->urb = urb; td_fill()
551 td->data_dma = data; td_fill()
555 td->hwINFO = cpu_to_hc32 (ohci, info); td_fill()
557 td->hwCBP = cpu_to_hc32 (ohci, data & 0xFFFFF000); td_fill()
558 *ohci_hwPSWp(ohci, td, 0) = cpu_to_hc16 (ohci, td_fill()
561 td->hwCBP = cpu_to_hc32 (ohci, data); td_fill()
564 td->hwBE = cpu_to_hc32 (ohci, data + len - 1); td_fill()
566 td->hwBE = 0; td_fill()
567 td->hwNextTD = cpu_to_hc32 (ohci, td_pt->td_dma); td_fill()
570 list_add_tail (&td->td_list, &td->ed->td_list); td_fill()
573 hash = TD_HASH_FUNC (td->td_dma); td_fill()
574 td->td_hash = ohci->td_hash [hash]; td_fill()
575 ohci->td_hash [hash] = td; td_fill()
579 td->ed->hwTailP = td->hwNextTD; td_fill()
754 static int td_done(struct ohci_hcd *ohci, struct urb *urb, struct td *td) td_done() argument
756 u32 tdINFO = hc32_to_cpup (ohci, &td->hwINFO); td_done()
760 list_del (&td->td_list); td_done()
764 u16 tdPSW = ohci_hwPSW(ohci, td, 0); td_done()
776 dlen = urb->iso_frame_desc [td->index].length; td_done()
784 urb->iso_frame_desc [td->index].actual_length = dlen; td_done()
785 urb->iso_frame_desc [td->index].status = cc_to_error [cc]; td_done()
789 "urb %p iso td %p (%d) len %d cc %d\n", td_done()
790 urb, td, 1 + td->index, dlen, cc); td_done()
798 u32 tdBE = hc32_to_cpup (ohci, &td->hwBE); td_done()
810 if ((type != PIPE_CONTROL || td->index != 0) && tdBE != 0) { td_done()
811 if (td->hwCBP == 0) td_done()
812 urb->actual_length += tdBE - td->data_dma + 1; td_done()
815 hc32_to_cpup (ohci, &td->hwCBP) td_done()
816 - td->data_dma; td_done()
821 "urb %p td %p (%d) cc %d, len=%d/%d\n", td_done()
822 urb, td, 1 + td->index, cc, td_done()
831 static void ed_halted(struct ohci_hcd *ohci, struct td *td, int cc) ed_halted() argument
833 struct urb *urb = td->urb; ed_halted()
835 struct ed *ed = td->ed; ed_halted()
836 struct list_head *tmp = td->td_list.next; ed_halted()
839 /* clear ed halt; this is the td that caused it, but keep it inactive ed_halted()
851 struct td *next; ed_halted()
853 next = list_entry (tmp, struct td, td_list); ed_halted()
859 /* NOTE: if multi-td control DATA segments get supported, ed_halted()
860 * this urb had one of them, this td wasn't the last td ed_halted()
891 hc32_to_cpu (ohci, td->hwINFO), ed_halted()
897 static void add_to_done_list(struct ohci_hcd *ohci, struct td *td) add_to_done_list() argument
899 struct td *td2, *td_prev; add_to_done_list()
902 if (td->next_dl_td) add_to_done_list()
906 ed = td->ed; add_to_done_list()
907 td2 = td_prev = td; add_to_done_list()
921 * Make td->next_dl_td point to td itself, to mark the fact add_to_done_list()
922 * that td is on the done list. add_to_done_list()
924 ohci->dl_end = td->next_dl_td = td; add_to_done_list()
936 struct td *td = NULL; update_done_list() local
948 td = dma_to_td (ohci, td_dma); update_done_list()
949 if (!td) { update_done_list()
954 td->hwINFO |= cpu_to_hc32 (ohci, TD_DONE); update_done_list()
955 cc = TD_CC_GET (hc32_to_cpup (ohci, &td->hwINFO)); update_done_list()
962 && (td->ed->hwHeadP & cpu_to_hc32 (ohci, ED_H))) update_done_list()
963 ed_halted(ohci, td, cc); update_done_list()
965 td_dma = hc32_to_cpup (ohci, &td->hwNextTD); update_done_list()
966 add_to_done_list(ohci, td); update_done_list()
994 struct td *td; finish_unlinks() local
997 td = list_first_entry(&ed->td_list, struct td, td_list); finish_unlinks()
1001 if (td->td_dma != head && finish_unlinks()
1006 if (td->next_dl_td) finish_unlinks()
1034 struct td *td; finish_unlinks() local
1040 td = list_entry (entry, struct td, td_list); finish_unlinks()
1041 urb = td->urb; finish_unlinks()
1042 urb_priv = td->urb->hcpriv; finish_unlinks()
1045 prev = &td->hwNextTD; finish_unlinks()
1051 *prev = td->hwNextTD | savebits; finish_unlinks()
1058 tdINFO = hc32_to_cpup(ohci, &td->hwINFO); finish_unlinks()
1065 td_done (ohci, urb, td); finish_unlinks()
1145 static void takeback_td(struct ohci_hcd *ohci, struct td *td) takeback_td() argument
1147 struct urb *urb = td->urb; takeback_td()
1149 struct ed *ed = td->ed; takeback_td()
1153 status = td_done(ohci, urb, td); takeback_td()
1168 td = list_entry(ed->td_list.next, struct td, td_list); takeback_td()
1169 if (!(td->hwINFO & cpu_to_hc32(ohci, TD_DONE))) { takeback_td()
1195 struct td *td; process_done_list() local
1198 td = ohci->dl_start; process_done_list()
1199 if (td == ohci->dl_end) process_done_list()
1202 ohci->dl_start = td->next_dl_td; process_done_list()
1204 takeback_td(ohci, td); process_done_list()
H A Dfhci-tds.c77 struct usb_td __iomem *td, next_bd()
83 return ++td; next_bd()
156 struct usb_td __iomem *td; fhci_create_ep() local
172 ep_mem_size = ring_len * sizeof(*td) + sizeof(struct fhci_ep_pram); fhci_create_ep()
207 ep->ep_pram_ptr = (void __iomem *)ep->td_base + sizeof(*td) * ring_len; fhci_create_ep()
215 td = ep->td_base; fhci_create_ep()
217 out_be32(&td->buf_ptr, 0); fhci_create_ep()
218 out_be16(&td->status, 0); fhci_create_ep()
219 out_be16(&td->length, 0); fhci_create_ep()
220 out_be16(&td->extra, 0); fhci_create_ep()
221 td++; fhci_create_ep()
223 td--; fhci_create_ep()
224 out_be16(&td->status, TD_W); /* for last TD set Wrap bit */ fhci_create_ep()
225 out_be16(&td->length, 0); fhci_create_ep()
285 struct usb_td __iomem *td; fhci_td_transaction_confirm() local
297 td = ep->conf_td; fhci_td_transaction_confirm()
298 td_status = in_be16(&td->status); fhci_td_transaction_confirm()
299 td_length = in_be16(&td->length); fhci_td_transaction_confirm()
300 buf = in_be32(&td->buf_ptr); fhci_td_transaction_confirm()
301 extra_data = in_be16(&td->extra); fhci_td_transaction_confirm()
311 clrbits16(&td->status, ~TD_W); fhci_td_transaction_confirm()
312 out_be16(&td->length, 0); fhci_td_transaction_confirm()
313 out_be32(&td->buf_ptr, 0); fhci_td_transaction_confirm()
314 out_be16(&td->extra, 0); fhci_td_transaction_confirm()
390 struct usb_td __iomem *td; fhci_host_transaction() local
396 td = ep->empty_td; fhci_host_transaction()
397 td_status = in_be16(&td->status); fhci_host_transaction()
399 if (td_status & TD_R && in_be16(&td->length)) { fhci_host_transaction()
408 pkt->priv_data = td; fhci_host_transaction()
409 out_be32(&td->buf_ptr, virt_to_phys(pkt->data)); fhci_host_transaction()
425 out_be16(&td->extra, extra_data); fhci_host_transaction()
454 out_be16(&td->status, td_status); fhci_host_transaction()
458 out_be16(&td->length, pkt->len + CRC_SIZE); fhci_host_transaction()
460 out_be16(&td->length, pkt->len); fhci_host_transaction()
477 struct usb_td __iomem *td; fhci_flush_bds() local
480 td = ep->td_base; fhci_flush_bds()
482 td_status = in_be16(&td->status); fhci_flush_bds()
483 buf = in_be32(&td->buf_ptr); fhci_flush_bds()
484 extra_data = in_be16(&td->extra); fhci_flush_bds()
488 out_be16(&td->status, (td_status & ~TD_R) | TD_TO); fhci_flush_bds()
490 else if (in_be32(&td->buf_ptr) == DUMMY_BD_BUFFER) fhci_flush_bds()
491 out_be32(&td->buf_ptr, DUMMY2_BD_BUFFER); fhci_flush_bds()
496 td++; fhci_flush_bds()
501 td = ep->td_base; fhci_flush_bds()
503 out_be16(&td->status, 0); fhci_flush_bds()
504 out_be16(&td->length, 0); fhci_flush_bds()
505 out_be32(&td->buf_ptr, 0); fhci_flush_bds()
506 out_be16(&td->extra, 0); fhci_flush_bds()
507 td++; fhci_flush_bds()
508 } while (!(in_be16(&td->status) & TD_W)); fhci_flush_bds()
509 out_be16(&td->status, TD_W); /* for last TD set Wrap bit */ fhci_flush_bds()
510 out_be16(&td->length, 0); fhci_flush_bds()
511 out_be32(&td->buf_ptr, 0); fhci_flush_bds()
512 out_be16(&td->extra, 0); fhci_flush_bds()
534 struct usb_td __iomem *td; fhci_flush_actual_frame() local
542 td = cpm_muram_addr(tb_ptr); fhci_flush_actual_frame()
543 td_status = in_be16(&td->status); fhci_flush_actual_frame()
544 buf_ptr = in_be32(&td->buf_ptr); fhci_flush_actual_frame()
545 extra_data = in_be16(&td->extra); fhci_flush_actual_frame()
548 out_be16(&td->status, (td_status & ~TD_R) | TD_TO); fhci_flush_actual_frame()
550 out_be32(&td->buf_ptr, 0); fhci_flush_actual_frame()
556 td = next_bd(ep->td_base, td, td_status); fhci_flush_actual_frame()
557 td_status = in_be16(&td->status); fhci_flush_actual_frame()
558 buf_ptr = in_be32(&td->buf_ptr); fhci_flush_actual_frame()
559 extra_data = in_be16(&td->extra); fhci_flush_actual_frame()
598 struct usb_td __iomem *td; fhci_host_transmit_actual_frame() local
602 td = cpm_muram_addr(tb_ptr); fhci_host_transmit_actual_frame()
604 if (in_be32(&td->buf_ptr) == DUMMY_BD_BUFFER) { fhci_host_transmit_actual_frame()
605 struct usb_td __iomem *old_td = td; fhci_host_transmit_actual_frame()
608 td_status = in_be16(&td->status); fhci_host_transmit_actual_frame()
610 td = next_bd(ep->td_base, td, td_status); fhci_host_transmit_actual_frame()
611 tb_ptr = cpm_muram_offset(td); fhci_host_transmit_actual_frame()
615 if (in_be16(&td->status) & TD_R) fhci_host_transmit_actual_frame()
76 next_bd(struct usb_td __iomem *base, struct usb_td __iomem *td, u16 status) next_bd() argument
H A Duhci-q.c21 * Technically, updating td->status here is a race, but it's not really a
109 struct uhci_td *td; uhci_alloc_td() local
111 td = dma_pool_alloc(uhci->td_pool, GFP_ATOMIC, &dma_handle); uhci_alloc_td()
112 if (!td) uhci_alloc_td()
115 td->dma_handle = dma_handle; uhci_alloc_td()
116 td->frame = -1; uhci_alloc_td()
118 INIT_LIST_HEAD(&td->list); uhci_alloc_td()
119 INIT_LIST_HEAD(&td->fl_list); uhci_alloc_td()
121 return td; uhci_alloc_td()
124 static void uhci_free_td(struct uhci_hcd *uhci, struct uhci_td *td) uhci_free_td() argument
126 if (!list_empty(&td->list)) uhci_free_td()
127 dev_WARN(uhci_dev(uhci), "td %p still in list!\n", td); uhci_free_td() local
128 if (!list_empty(&td->fl_list)) uhci_free_td()
129 dev_WARN(uhci_dev(uhci), "td %p still in fl_list!\n", td); uhci_free_td() local
131 dma_pool_free(uhci->td_pool, td, td->dma_handle); uhci_free_td()
134 static inline void uhci_fill_td(struct uhci_hcd *uhci, struct uhci_td *td, uhci_fill_td() argument
137 td->status = cpu_to_hc32(uhci, status); uhci_fill_td()
138 td->token = cpu_to_hc32(uhci, token); uhci_fill_td()
139 td->buffer = cpu_to_hc32(uhci, buffer); uhci_fill_td()
142 static void uhci_add_td_to_urbp(struct uhci_td *td, struct urb_priv *urbp) uhci_add_td_to_urbp() argument
144 list_add_tail(&td->list, &urbp->td_list); uhci_add_td_to_urbp()
147 static void uhci_remove_td_from_urbp(struct uhci_td *td) uhci_remove_td_from_urbp() argument
149 list_del_init(&td->list); uhci_remove_td_from_urbp()
156 struct uhci_td *td, unsigned framenum) uhci_insert_td_in_frame_list()
160 td->frame = framenum; uhci_insert_td_in_frame_list()
169 list_add_tail(&td->fl_list, &ftd->fl_list); uhci_insert_td_in_frame_list()
171 td->link = ltd->link; uhci_insert_td_in_frame_list()
173 ltd->link = LINK_TO_TD(uhci, td); uhci_insert_td_in_frame_list()
175 td->link = uhci->frame[framenum]; uhci_insert_td_in_frame_list()
177 uhci->frame[framenum] = LINK_TO_TD(uhci, td); uhci_insert_td_in_frame_list()
178 uhci->frame_cpu[framenum] = td; uhci_insert_td_in_frame_list()
183 struct uhci_td *td) uhci_remove_td_from_frame_list()
186 if (td->frame == -1) { uhci_remove_td_from_frame_list()
187 WARN_ON(!list_empty(&td->fl_list)); uhci_remove_td_from_frame_list()
191 if (uhci->frame_cpu[td->frame] == td) { uhci_remove_td_from_frame_list()
192 if (list_empty(&td->fl_list)) { uhci_remove_td_from_frame_list()
193 uhci->frame[td->frame] = td->link; uhci_remove_td_from_frame_list()
194 uhci->frame_cpu[td->frame] = NULL; uhci_remove_td_from_frame_list()
198 ntd = list_entry(td->fl_list.next, uhci_remove_td_from_frame_list()
201 uhci->frame[td->frame] = LINK_TO_TD(uhci, ntd); uhci_remove_td_from_frame_list()
202 uhci->frame_cpu[td->frame] = ntd; uhci_remove_td_from_frame_list()
207 ptd = list_entry(td->fl_list.prev, struct uhci_td, fl_list); uhci_remove_td_from_frame_list()
208 ptd->link = td->link; uhci_remove_td_from_frame_list()
211 list_del_init(&td->fl_list); uhci_remove_td_from_frame_list()
212 td->frame = -1; uhci_remove_td_from_frame_list()
239 struct uhci_td *td; uhci_unlink_isochronous_tds() local
241 list_for_each_entry(td, &urbp->td_list, list) uhci_unlink_isochronous_tds()
242 uhci_remove_td_from_frame_list(uhci, td); uhci_unlink_isochronous_tds()
319 struct uhci_td *td; uhci_cleanup_queue() local
343 td = list_entry(urbp->td_list.prev, struct uhci_td, uhci_cleanup_queue()
345 ptd->link = td->link; uhci_cleanup_queue()
361 td = list_entry(urbp->td_list.next, struct uhci_td, list); uhci_cleanup_queue()
363 qh->initial_toggle = uhci_toggle(td_token(uhci, td)); uhci_cleanup_queue()
377 struct uhci_td *td; uhci_fixup_toggles() local
399 td = list_entry(urbp->td_list.next, struct uhci_td, list); uhci_fixup_toggles()
400 if (toggle > 1 || uhci_toggle(td_token(uhci, td)) == toggle) { uhci_fixup_toggles()
401 td = list_entry(urbp->td_list.prev, struct uhci_td, uhci_fixup_toggles()
403 toggle = uhci_toggle(td_token(uhci, td)) ^ 1; uhci_fixup_toggles()
407 list_for_each_entry(td, &urbp->td_list, list) { uhci_fixup_toggles()
408 td->token ^= cpu_to_hc32(uhci, uhci_fixup_toggles()
490 struct uhci_td *td = list_entry(urbp->td_list.next, uhci_activate_qh() local
493 qh->element = LINK_TO_TD(uhci, td); uhci_activate_qh()
744 struct uhci_td *td, *tmp; uhci_free_urb_priv() local
750 list_for_each_entry_safe(td, tmp, &urbp->td_list, list) { uhci_free_urb_priv()
751 uhci_remove_td_from_urbp(td); uhci_free_urb_priv()
752 uhci_free_td(uhci, td); uhci_free_urb_priv()
761 * <status> is (td_status(uhci, td) & 0xF60000), a.k.a.
762 * uhci_status_bits(td_status(uhci, td)).
793 struct uhci_td *td; uhci_submit_control() local
813 td = qh->dummy_td; uhci_submit_control()
814 uhci_add_td_to_urbp(td, urbp); uhci_submit_control()
815 uhci_fill_td(uhci, td, status, destination | uhci_explen(8), uhci_submit_control()
817 plink = &td->link; uhci_submit_control()
845 td = uhci_alloc_td(uhci); uhci_submit_control()
846 if (!td) uhci_submit_control()
848 *plink = LINK_TO_TD(uhci, td); uhci_submit_control()
853 uhci_add_td_to_urbp(td, urbp); uhci_submit_control()
854 uhci_fill_td(uhci, td, status, uhci_submit_control()
856 plink = &td->link; uhci_submit_control()
865 td = uhci_alloc_td(uhci); uhci_submit_control()
866 if (!td) uhci_submit_control()
868 *plink = LINK_TO_TD(uhci, td); uhci_submit_control()
874 uhci_add_td_to_urbp(td, urbp); uhci_submit_control()
875 uhci_fill_td(uhci, td, status | TD_CTRL_IOC, uhci_submit_control()
877 plink = &td->link; uhci_submit_control()
882 td = uhci_alloc_td(uhci); uhci_submit_control()
883 if (!td) uhci_submit_control()
885 *plink = LINK_TO_TD(uhci, td); uhci_submit_control()
887 uhci_fill_td(uhci, td, 0, USB_PID_OUT | uhci_explen(0), 0); uhci_submit_control()
890 qh->dummy_td = td; uhci_submit_control()
919 struct uhci_td *td; uhci_submit_common() local
964 td = qh->dummy_td; uhci_submit_common()
975 td = uhci_alloc_td(uhci); uhci_submit_common()
976 if (!td) uhci_submit_common()
978 *plink = LINK_TO_TD(uhci, td); uhci_submit_common()
980 uhci_add_td_to_urbp(td, urbp); uhci_submit_common()
981 uhci_fill_td(uhci, td, status, uhci_submit_common()
985 plink = &td->link; uhci_submit_common()
1011 td = uhci_alloc_td(uhci); uhci_submit_common()
1012 if (!td) uhci_submit_common()
1014 *plink = LINK_TO_TD(uhci, td); uhci_submit_common()
1016 uhci_add_td_to_urbp(td, urbp); uhci_submit_common()
1017 uhci_fill_td(uhci, td, status, uhci_submit_common()
1021 plink = &td->link; uhci_submit_common()
1032 td->status |= cpu_to_hc32(uhci, TD_CTRL_IOC); uhci_submit_common()
1037 td = uhci_alloc_td(uhci); uhci_submit_common()
1038 if (!td) uhci_submit_common()
1040 *plink = LINK_TO_TD(uhci, td); uhci_submit_common()
1042 uhci_fill_td(uhci, td, 0, USB_PID_OUT | uhci_explen(0), 0); uhci_submit_common()
1045 qh->dummy_td = td; uhci_submit_common()
1126 struct uhci_td *td; uhci_fixup_short_transfer() local
1130 td = list_entry(urbp->td_list.prev, struct uhci_td, list); uhci_fixup_short_transfer()
1137 qh->element = LINK_TO_TD(uhci, td); uhci_fixup_short_transfer()
1138 tmp = td->list.prev; uhci_fixup_short_transfer()
1151 td = qh->post_td; uhci_fixup_short_transfer()
1152 qh->element = td->link; uhci_fixup_short_transfer()
1159 td = list_entry(tmp, struct uhci_td, list); uhci_fixup_short_transfer()
1162 uhci_remove_td_from_urbp(td); uhci_fixup_short_transfer()
1163 uhci_free_td(uhci, td); uhci_fixup_short_transfer()
1175 struct uhci_td *td, *tmp; uhci_result_common() local
1179 list_for_each_entry_safe(td, tmp, &urbp->td_list, list) { uhci_result_common()
1183 ctrlstat = td_status(uhci, td); uhci_result_common()
1193 uhci_packetout(td_token(uhci, td))); uhci_result_common()
1209 } else if (len < uhci_expected_length(td_token(uhci, td))) { uhci_result_common()
1214 if (td->list.next != urbp->td_list.prev) uhci_result_common()
1223 else if (&td->list != urbp->td_list.prev) uhci_result_common()
1227 uhci_remove_td_from_urbp(td); uhci_result_common()
1230 qh->post_td = td; uhci_result_common()
1244 qh->initial_toggle = uhci_toggle(td_token(uhci, td)) ^ uhci_result_common()
1258 struct uhci_td *td = NULL; /* Since urb->number_of_packets > 0 */ uhci_submit_isochronous() local
1338 td = uhci_alloc_td(uhci); uhci_submit_isochronous()
1339 if (!td) uhci_submit_isochronous()
1342 uhci_add_td_to_urbp(td, urbp); uhci_submit_isochronous()
1343 uhci_fill_td(uhci, td, status, destination | uhci_submit_isochronous()
1350 td->status |= cpu_to_hc32(uhci, TD_CTRL_IOC); uhci_submit_isochronous()
1354 list_for_each_entry(td, &urbp->td_list, list) { uhci_submit_isochronous()
1355 uhci_insert_td_in_frame_list(uhci, td, frame); uhci_submit_isochronous()
1372 struct uhci_td *td, *tmp; uhci_result_isochronous() local
1376 list_for_each_entry_safe(td, tmp, &urbp->td_list, list) { uhci_result_isochronous()
1386 ctrlstat = td_status(uhci, td); uhci_result_isochronous()
1401 uhci_remove_td_from_urbp(td); uhci_result_isochronous()
1402 uhci_free_td(uhci, td); uhci_result_isochronous()
1644 struct uhci_td *td = list_entry(urbp->td_list.next, uhci_scan_qh() local
1647 td->status |= cpu_to_hc32(uhci, TD_CTRL_IOC); uhci_scan_qh()
1672 struct uhci_td *td; uhci_advance_check() local
1693 td = list_entry(urbp->td_list.next, struct uhci_td, list); uhci_advance_check()
1694 status = td_status(uhci, td); uhci_advance_check()
155 uhci_insert_td_in_frame_list(struct uhci_hcd *uhci, struct uhci_td *td, unsigned framenum) uhci_insert_td_in_frame_list() argument
182 uhci_remove_td_from_frame_list(struct uhci_hcd *uhci, struct uhci_td *td) uhci_remove_td_from_frame_list() argument
H A Dimx21-dbg.c42 int frame, struct td *td) {} debug_isoc_completed()
44 int frame, struct td *td, int cc, int len) {}
132 int frame, struct td *td) debug_isoc_submitted()
138 trace->schedule_frame = td->frame; debug_isoc_submitted()
140 trace->request_len = td->len; debug_isoc_submitted()
141 trace->td = td; debug_isoc_submitted()
145 int frame, struct td *td, int cc, int len) debug_isoc_completed()
153 if (trace->td == td) { debug_isoc_completed()
157 trace->td = NULL; debug_isoc_completed()
41 debug_isoc_submitted(struct imx21 *imx21, int frame, struct td *td) debug_isoc_submitted() argument
43 debug_isoc_completed(struct imx21 *imx21, int frame, struct td *td, int cc, int len) debug_isoc_completed() argument
131 debug_isoc_submitted(struct imx21 *imx21, int frame, struct td *td) debug_isoc_submitted() argument
144 debug_isoc_completed(struct imx21 *imx21, int frame, struct td *td, int cc, int len) debug_isoc_completed() argument
H A Duhci-debug.c42 static int uhci_show_td(struct uhci_hcd *uhci, struct uhci_td *td, char *buf, uhci_show_td() argument
49 status = td_status(uhci, td); uhci_show_td()
50 out += sprintf(out, "%*s[%p] link (%08x) ", space, "", td, uhci_show_td()
51 hc32_to_cpu(uhci, td->link)); uhci_show_td()
68 token = td_token(uhci, td); uhci_show_td()
91 out += sprintf(out, "(buf=%08x)\n", hc32_to_cpu(uhci, td->buffer)); uhci_show_td()
103 struct uhci_td *td; uhci_show_urbp() local
138 list_for_each_entry(td, &urbp->td_list, list) { uhci_show_urbp()
142 out += uhci_show_td(uhci, td, out, uhci_show_urbp()
147 if (td_status(uhci, td) & TD_CTRL_ACTIVE) uhci_show_urbp()
221 struct uhci_td *td = list_entry(urbp->td_list.next, uhci_show_qh() local
224 if (element != LINK_TO_TD(uhci, td)) uhci_show_qh()
378 struct uhci_td *td; uhci_sprint_schedule() local
419 td = uhci->frame_cpu[i]; uhci_sprint_schedule()
421 if (!td) uhci_sprint_schedule()
430 head = &td->fl_list; uhci_sprint_schedule()
433 td = list_entry(tmp, struct uhci_td, fl_list); uhci_sprint_schedule()
435 if (link != LINK_TO_TD(uhci, td)) { uhci_sprint_schedule()
445 out += uhci_show_td(uhci, td, out, uhci_sprint_schedule()
450 link = td->link; uhci_sprint_schedule()
H A Dohci-dbg.c255 const struct td *td) ohci_dump_td()
257 u32 tmp = hc32_to_cpup (ohci, &td->hwINFO); ohci_dump_td()
259 ohci_dbg (ohci, "%s td %p%s; urb %p index %d; hw next td %08x\n", ohci_dump_td()
260 label, td, ohci_dump_td()
262 td->urb, td->index, ohci_dump_td()
263 hc32_to_cpup (ohci, &td->hwNextTD)); ohci_dump_td()
284 cbp = hc32_to_cpup (ohci, &td->hwCBP); ohci_dump_td()
285 be = hc32_to_cpup (ohci, &td->hwBE); ohci_dump_td()
296 hc32_to_cpup (ohci, &td->hwCBP) & ~0x0fff, ohci_dump_td()
297 hc32_to_cpup (ohci, &td->hwBE)); ohci_dump_td()
299 u16 psw = ohci_hwPSW (ohci, td, i); ohci_dump_td()
350 struct td *td; ohci_dump_ed() local
351 td = list_entry (tmp, struct td, td_list); ohci_dump_ed()
352 ohci_dump_td (ohci, " ->", td); ohci_dump_ed()
415 struct td *td; show_list() local
435 td = list_entry (entry, struct td, td_list); show_list()
436 info = hc32_to_cpup (ohci, &td->hwINFO); show_list()
437 cbp = hc32_to_cpup (ohci, &td->hwCBP); show_list()
438 be = hc32_to_cpup (ohci, &td->hwBE); show_list()
441 td, show_list()
450 TD_CC_GET (info), td->urb, info); show_list()
254 ohci_dump_td(const struct ohci_hcd *ohci, const char *label, const struct td *td) ohci_dump_td() argument
H A Dimx21-hcd.c203 etd->td = NULL; reset_etd()
571 struct td *td; schedule_isoc_etds() local
590 td = list_entry(ep_priv->td_list.next, struct td, list); schedule_isoc_etds()
591 list_del(&td->list); schedule_isoc_etds()
592 urb_priv = td->urb->hcpriv; schedule_isoc_etds()
595 if (frame_after(cur_frame, td->frame)) { schedule_isoc_etds()
597 cur_frame, td->frame); schedule_isoc_etds()
599 td->urb->iso_frame_desc[ schedule_isoc_etds()
600 td->isoc_index].actual_length = 0; schedule_isoc_etds()
601 td->urb->iso_frame_desc[td->isoc_index].status = -EXDEV; schedule_isoc_etds()
603 urb_done(hcd, td->urb, urb_priv->isoc_status); schedule_isoc_etds()
608 etd->td = td; schedule_isoc_etds()
609 etd->ep = td->ep; schedule_isoc_etds()
610 etd->urb = td->urb; schedule_isoc_etds()
611 etd->len = td->len; schedule_isoc_etds()
612 etd->dma_handle = td->dma_handle; schedule_isoc_etds()
613 etd->cpu_buffer = td->cpu_buffer; schedule_isoc_etds()
615 debug_isoc_submitted(imx21, cur_frame, td); schedule_isoc_etds()
617 dir = usb_pipeout(td->urb->pipe) ? TD_DIR_OUT : TD_DIR_IN; schedule_isoc_etds()
618 setup_etd_dword0(imx21, etd_num, td->urb, dir, etd->dmem_size); schedule_isoc_etds()
622 ((td->frame & 0xFFFF) << DW2_STARTFRM)); schedule_isoc_etds()
625 (td->len << DW3_PKTLEN0)); schedule_isoc_etds()
638 struct td *td = etd->td; isoc_etd_done() local
640 int isoc_index = td->isoc_index; isoc_etd_done()
661 imx21_hc_get_frame(hcd), td, cc, bytes_xfrd); isoc_etd_done()
667 cc, imx21_hc_get_frame(hcd), td->frame, isoc_etd_done()
668 bytes_xfrd, td->len, urb, etd_num, isoc_index); isoc_etd_done()
683 etd->td = NULL; isoc_etd_done()
747 struct td *td = NULL; imx21_hc_urb_enqueue_isoc() local
758 sizeof(struct td) * urb->number_of_packets, mem_flags); imx21_hc_urb_enqueue_isoc()
821 struct td, list)->frame + urb->interval); imx21_hc_urb_enqueue_isoc()
844 td = urb_priv->isoc_td; imx21_hc_urb_enqueue_isoc()
845 for (; i < urb->number_of_packets; i++, td++) { imx21_hc_urb_enqueue_isoc()
847 td->ep = ep; imx21_hc_urb_enqueue_isoc()
848 td->urb = urb; imx21_hc_urb_enqueue_isoc()
849 td->len = urb->iso_frame_desc[i].length; imx21_hc_urb_enqueue_isoc()
850 td->isoc_index = i; imx21_hc_urb_enqueue_isoc()
851 td->frame = wrap_frame(urb->start_frame + urb->interval * i); imx21_hc_urb_enqueue_isoc()
852 td->dma_handle = urb->transfer_dma + offset; imx21_hc_urb_enqueue_isoc()
853 td->cpu_buffer = urb->transfer_buffer + offset; imx21_hc_urb_enqueue_isoc()
854 list_add_tail(&td->list, &ep_priv->td_list); imx21_hc_urb_enqueue_isoc()
858 urb->number_of_packets, urb->start_frame, td->frame); imx21_hc_urb_enqueue_isoc()
884 struct td *td, *tmp; dequeue_isoc_urb() local
899 list_for_each_entry_safe(td, tmp, &ep_priv->td_list, list) { dequeue_isoc_urb()
900 if (td->urb == urb) { dequeue_isoc_urb()
901 dev_vdbg(imx21->dev, "removing td %p\n", td); dequeue_isoc_urb()
902 list_del(&td->list); dequeue_isoc_urb()
H A Dxhci-ring.c608 /* Only giveback urb when this is the last td in urb */ xhci_giveback_urb_in_irq()
1737 struct xhci_td *td, union xhci_trb *event_trb) xhci_cleanup_halted_endpoint()
1749 xhci_cleanup_stalled_ring(xhci, ep_index, td); xhci_cleanup_halted_endpoint()
1798 * Finish the td processing, remove the td from td list;
1801 static int finish_td(struct xhci_hcd *xhci, struct xhci_td *td, finish_td() argument
1832 ep->stopped_td = td; finish_td()
1844 ep_ring->stream_id, td, event_trb); finish_td()
1847 while (ep_ring->dequeue != td->last_trb) finish_td()
1854 urb = td->urb; finish_td()
1867 if (td->urb->transfer_flags & URB_SHORT_NOT_OK) finish_td()
1872 list_del_init(&td->td_list); finish_td()
1874 if (!list_empty(&td->cancelled_td_list)) finish_td()
1875 list_del_init(&td->cancelled_td_list); finish_td()
1896 static int process_ctrl_td(struct xhci_hcd *xhci, struct xhci_td *td, process_ctrl_td() argument
1920 } else if (event_trb != td->last_trb) { process_ctrl_td()
1929 if (td->urb->transfer_flags & URB_SHORT_NOT_OK) process_ctrl_td()
1935 if (event_trb == ep_ring->dequeue || event_trb == td->last_trb) process_ctrl_td()
1938 td->urb->actual_length = process_ctrl_td()
1941 return finish_td(xhci, td, event_trb, event, ep, status, false); process_ctrl_td()
1944 if (event_trb != ep_ring->dequeue && event_trb != td->last_trb) process_ctrl_td()
1945 td->urb->actual_length = process_ctrl_td()
1946 td->urb->transfer_buffer_length - process_ctrl_td()
1950 return finish_td(xhci, td, event_trb, event, ep, status, false); process_ctrl_td()
1962 event_trb != td->last_trb) process_ctrl_td()
1963 td->urb->actual_length = process_ctrl_td()
1964 td->urb->transfer_buffer_length - process_ctrl_td()
1966 else if (!td->urb_length_set) process_ctrl_td()
1967 td->urb->actual_length = 0; process_ctrl_td()
1969 return finish_td(xhci, td, event_trb, event, ep, status, false); process_ctrl_td()
1977 if (event_trb == td->last_trb) { process_ctrl_td()
1978 if (td->urb_length_set) { process_ctrl_td()
1982 (td->urb->transfer_flags process_ctrl_td()
1988 td->urb->actual_length = process_ctrl_td()
1989 td->urb->transfer_buffer_length; process_ctrl_td()
1998 td->urb_length_set = true; process_ctrl_td()
1999 td->urb->actual_length = process_ctrl_td()
2000 td->urb->transfer_buffer_length - process_ctrl_td()
2008 return finish_td(xhci, td, event_trb, event, ep, status, false); process_ctrl_td()
2014 static int process_isoc_td(struct xhci_hcd *xhci, struct xhci_td *td, process_isoc_td() argument
2030 urb_priv = td->urb->hcpriv; process_isoc_td()
2032 frame = &td->urb->iso_frame_desc[idx]; process_isoc_td()
2046 frame->status = td->urb->transfer_flags & URB_SHORT_NOT_OK ? process_isoc_td()
2065 if (event_trb != td->last_trb) process_isoc_td()
2079 td->urb->actual_length += frame->length; process_isoc_td()
2083 td->urb->actual_length += frame->actual_length; process_isoc_td()
2097 td->urb->actual_length += len; process_isoc_td()
2101 return finish_td(xhci, td, event_trb, event, ep, status, false); process_isoc_td()
2104 static int skip_isoc_td(struct xhci_hcd *xhci, struct xhci_td *td, skip_isoc_td() argument
2114 urb_priv = td->urb->hcpriv; skip_isoc_td()
2116 frame = &td->urb->iso_frame_desc[idx]; skip_isoc_td()
2125 while (ep_ring->dequeue != td->last_trb) skip_isoc_td()
2129 return finish_td(xhci, td, NULL, event, ep, status, true); skip_isoc_td()
2135 static int process_bulk_intr_td(struct xhci_hcd *xhci, struct xhci_td *td, process_bulk_intr_td() argument
2150 if (event_trb != td->last_trb || process_bulk_intr_td()
2154 if (td->urb->transfer_flags & URB_SHORT_NOT_OK) process_bulk_intr_td()
2166 if (td->urb->transfer_flags & URB_SHORT_NOT_OK) process_bulk_intr_td()
2178 td->urb->ep->desc.bEndpointAddress, process_bulk_intr_td()
2179 td->urb->transfer_buffer_length, process_bulk_intr_td()
2183 td->urb->actual_length = process_bulk_intr_td()
2186 if (td->urb->transfer_buffer_length < process_bulk_intr_td()
2187 td->urb->actual_length) { process_bulk_intr_td()
2190 td->urb->actual_length = 0; process_bulk_intr_td()
2194 } else if (event_trb == td->last_trb) { process_bulk_intr_td()
2196 td->urb->actual_length = process_bulk_intr_td()
2197 td->urb->transfer_buffer_length - process_bulk_intr_td()
2199 if (td->urb->transfer_buffer_length < process_bulk_intr_td()
2200 td->urb->actual_length) { process_bulk_intr_td()
2204 td->urb->actual_length = 0; process_bulk_intr_td()
2205 if (td->urb->transfer_flags & URB_SHORT_NOT_OK) process_bulk_intr_td()
2212 if (td->urb->transfer_flags & URB_SHORT_NOT_OK) process_bulk_intr_td()
2218 td->urb->actual_length = process_bulk_intr_td()
2219 td->urb->transfer_buffer_length; process_bulk_intr_td()
2230 td->urb->actual_length = 0; process_bulk_intr_td()
2236 td->urb->actual_length += process_bulk_intr_td()
2243 td->urb->actual_length += process_bulk_intr_td()
2248 return finish_td(xhci, td, event_trb, event, ep, status, false); process_bulk_intr_td()
2266 struct xhci_td *td = NULL; variable in typeref:struct:xhci_td
2320 /* Count current td numbers if ep->skip is set */
2467 td = list_entry(ep_ring->td_list.next, struct xhci_td, td_list);
2473 td->last_trb, event_dma, false);
2491 !usb_endpoint_xfer_isoc(&td->urb->ep->desc)) {
2509 ep_ring->dequeue, td->last_trb,
2514 ret = skip_isoc_td(xhci, td, event, ep, &status);
2523 xhci_dbg(xhci, "Found td. Clear skip flag.\n");
2544 if (usb_endpoint_xfer_control(&td->urb->ep->desc))
2545 ret = process_ctrl_td(xhci, td, event_trb, event, ep,
2547 else if (usb_endpoint_xfer_isoc(&td->urb->ep->desc))
2548 ret = process_isoc_td(xhci, td, event_trb, event, ep,
2551 ret = process_bulk_intr_td(xhci, td, event_trb, event,
2569 urb = td->urb;
2598 * Process them as short transfer until reach the td pointed by
2900 struct xhci_td *td; prepare_transfer() local
2918 td = urb_priv->td[td_index]; prepare_transfer()
2920 INIT_LIST_HEAD(&td->td_list); prepare_transfer()
2921 INIT_LIST_HEAD(&td->cancelled_td_list); prepare_transfer()
2929 td->urb = urb; prepare_transfer()
2931 list_add_tail(&td->td_list, &ep_ring->td_list); prepare_transfer()
2932 td->start_seg = ep_ring->enq_seg; prepare_transfer()
2933 td->first_trb = ep_ring->enqueue; prepare_transfer()
2935 urb_priv->td[td_index] = td; prepare_transfer()
3090 struct xhci_td *td; queue_bulk_sg_tx() local
3121 /* Deal with URB_ZERO_PACKET - need one more td/trb */ queue_bulk_sg_tx()
3126 xhci_dbg(xhci, "Creating zero length td.\n"); queue_bulk_sg_tx()
3134 td = urb_priv->td[0]; queue_bulk_sg_tx()
3184 td->last_trb = ep_ring->enqueue; queue_bulk_sg_tx()
3188 urb_priv->td[1]->last_trb = ep_ring->enqueue; queue_bulk_sg_tx()
3260 struct xhci_td *td; xhci_queue_bulk_tx() local
3306 /* Deal with URB_ZERO_PACKET - need one more td/trb */ xhci_queue_bulk_tx()
3311 xhci_dbg(xhci, "Creating zero length td.\n"); xhci_queue_bulk_tx()
3319 td = urb_priv->td[0]; xhci_queue_bulk_tx()
3360 td->last_trb = ep_ring->enqueue; xhci_queue_bulk_tx()
3364 urb_priv->td[1]->last_trb = ep_ring->enqueue; xhci_queue_bulk_tx()
3418 struct xhci_td *td; xhci_queue_ctrl_tx() local
3447 td = urb_priv->td[0]; xhci_queue_ctrl_tx()
3509 td->last_trb = ep_ring->enqueue; xhci_queue_ctrl_tx()
3700 struct xhci_td *td; xhci_queue_isoc_tx() local
3758 td = urb_priv->td[i]; xhci_queue_isoc_tx()
3807 td->last_trb = ep_ring->enqueue; xhci_queue_isoc_tx()
3812 /* Set BEI bit except for the last td */ xhci_queue_isoc_tx()
3870 list_del_init(&urb_priv->td[i]->td_list); xhci_queue_isoc_tx()
3875 * overwrite them. td->first_trb and td->start_seg are already set. xhci_queue_isoc_tx()
3877 urb_priv->td[0]->last_trb = ep_ring->enqueue; xhci_queue_isoc_tx()
3879 td_to_noop(xhci, ep_ring, urb_priv->td[0], true); xhci_queue_isoc_tx()
3882 ep_ring->enqueue = urb_priv->td[0]->first_trb; xhci_queue_isoc_tx()
3883 ep_ring->enq_seg = urb_priv->td[0]->start_seg; xhci_queue_isoc_tx()
3922 * Do not insert any td of the urb to the ring if the check failed. xhci_queue_isoc_tx_prepare()
1734 xhci_cleanup_halted_endpoint(struct xhci_hcd *xhci, unsigned int slot_id, unsigned int ep_index, unsigned int stream_id, struct xhci_td *td, union xhci_trb *event_trb) xhci_cleanup_halted_endpoint() argument
H A Dohci.h44 struct td *dummy; /* next TD to activate */
73 struct td *pending_td;
87 struct td { struct
131 struct td *td_hash; /* dma-->td hashtable */
132 struct td *next_dl_td;
144 * Hardware transfer status codes -- CC from td->hwINFO or td->hwPSW
339 struct td *td [0]; // all TDs in this request member in struct:urb_priv
344 // sizeof (struct td) ~= 64 == 2^6 ...
390 struct td *td_hash [TD_HASH_SIZE];
391 struct td *dl_start, *dl_end; /* the done list */
674 const struct td *td, int index) ohci_hwPSWp()
677 &td->hwPSW[index ^ 1] : &td->hwPSW[index]); ohci_hwPSWp()
681 const struct td *td, int index) ohci_hwPSW()
683 return hc16_to_cpup(ohci, ohci_hwPSWp(ohci, td, index)); ohci_hwPSW()
673 ohci_hwPSWp(const struct ohci_hcd *ohci, const struct td *td, int index) ohci_hwPSWp() argument
680 ohci_hwPSW(const struct ohci_hcd *ohci, const struct td *td, int index) ohci_hwPSW() argument
H A Dfhci-hcd.c175 struct td *td; fhci_mem_free() local
176 struct td *next_td; fhci_mem_free()
183 list_for_each_entry_safe(td, next_td, &fhci->empty_tds, node) { fhci_mem_free()
184 list_del(&td->node); fhci_mem_free()
185 kfree(td); fhci_mem_free()
221 struct td *td; fhci_mem_init() local
223 td = kmalloc(sizeof(*td), GFP_KERNEL); fhci_mem_init()
224 if (!td) fhci_mem_init()
226 fhci_recycle_empty_td(fhci, td); fhci_mem_init()
403 /* 1 td fro setup,1 for ack */ fhci_urb_enqueue()
406 /* one td for every 4096 bytes(can be up to 8k) */ fhci_urb_enqueue()
524 struct td *td = fhci_remove_td_from_ed(ed); fhci_endpoint_disable() local
525 fhci_urb_complete_free(fhci, td->urb); fhci_endpoint_disable()
H A Dfhci.h342 struct td *td_head; /* a pointer to the current TD handled */
345 struct td { struct
348 unsigned int actual_len; /* actual bytes transferred on this td */
371 * field for the corresponding structure td */
396 struct td **tds;
520 void fhci_recycle_empty_td(struct fhci_hcd *fhci, struct td *td);
523 struct td *fhci_td_fill(struct fhci_hcd *fhci, struct urb *urb,
527 void fhci_add_tds_to_ed(struct ed *ed, struct td **td_list, int number);
571 struct td *fhci_remove_td_from_ed(struct ed *ed);
572 struct td *fhci_remove_td_from_frame(struct fhci_time_frame *frame);
574 struct td *fhci_peek_td_from_frame(struct fhci_time_frame *frame);
575 void fhci_add_td_to_frame(struct fhci_time_frame *frame, struct td *td);
576 struct td *fhci_remove_td_from_done_list(struct fhci_controller_list *p_list);
577 void fhci_done_td(struct urb *urb, struct td *td);
H A Dimx21-hcd.h335 struct td *isoc_td;
350 struct td { struct
365 struct td *td; member in struct:etd_priv
414 struct td *td; member in struct:debug_isoc_trace
H A Dohci-hcd.c191 urb_priv = kzalloc (sizeof (urb_priv_t) + size * sizeof (struct td *), ohci_urb_enqueue()
201 urb_priv->td [i] = td_alloc (ohci, mem_flags); ohci_urb_enqueue()
202 if (!urb_priv->td [i]) { ohci_urb_enqueue()
732 struct td *td, *td_start, *td_next; io_watchdog_func() local
776 td = ed->pending_td; io_watchdog_func()
779 if (!td) { io_watchdog_func()
783 td = td_next; io_watchdog_func()
789 td_start = td; io_watchdog_func()
790 td_next = list_prepare_entry(td, &ed->td_list, td_list); io_watchdog_func()
794 td = td_next; /* head pointer has passed this TD */ io_watchdog_func()
796 if (td != td_start) { io_watchdog_func()
803 ed->pending_td = td; io_watchdog_func()
1015 struct urb *urb = priv->td[0]->urb; ohci_restart()
1266 pr_debug ("%s: block sizes: ed %Zd td %Zd\n", hcd_name, ohci_hcd_mod_init()
1267 sizeof (struct ed), sizeof (struct td)); ohci_hcd_mod_init()
H A Dr8a66597.h160 struct r8a66597_td *td; r8a66597_get_urb() local
162 td = r8a66597_get_td(r8a66597, pipenum); r8a66597_get_urb()
163 return (td ? td->urb : NULL); r8a66597_get_urb()
H A Duhci-hcd.h223 #define td_token(uhci, td) hc32_to_cpu((uhci), (td)->token)
251 * td->link points to either another TD (not necessarily for the same urb or
274 #define td_status(uhci, td) hc32_to_cpu((uhci), \
275 ACCESS_ONCE((td)->status))
277 #define LINK_TO_TD(uhci, td) (cpu_to_hc32((uhci), (td)->dma_handle))
H A Dehci-dbg.c109 ehci_dbg(ehci, "%s td %p n%08x %08x t%08x p0=%08x\n", label, qtd, dbg_qtd()
416 struct ehci_qtd *td; qh_lines() local
453 td = list_entry (entry, struct ehci_qtd, qtd_list); qh_lines()
454 scratch = hc32_to_cpup(ehci, &td->hw_token); qh_lines()
456 if (hw_curr == td->qtd_dma) qh_lines()
458 else if (hw->hw_qtd_next == cpu_to_hc32(ehci, td->qtd_dma)) qh_lines()
461 if (td->hw_alt_next == ehci->async->hw->hw_alt_next) qh_lines()
463 else if (td->hw_alt_next != list_end) qh_lines()
468 td, mark, ({ char *tmp; qh_lines()
477 td->urb); qh_lines()
H A Dehci-mem.c98 /* dummy td enables safe urb queuing */ ehci_qh_alloc()
101 ehci_dbg (ehci, "no dummy td\n"); ehci_qh_alloc()
H A Dxhci.c1369 urb_priv->td[i] = buffer; xhci_urb_enqueue()
1536 struct xhci_td *td; xhci_urb_dequeue() local
1556 td = urb_priv->td[i]; xhci_urb_dequeue()
1557 if (!list_empty(&td->td_list)) xhci_urb_dequeue()
1558 list_del_init(&td->td_list); xhci_urb_dequeue()
1559 if (!list_empty(&td->cancelled_td_list)) xhci_urb_dequeue()
1560 list_del_init(&td->cancelled_td_list); xhci_urb_dequeue()
1600 urb_priv->td[i]->start_seg, xhci_urb_dequeue()
1601 urb_priv->td[i]->first_trb)); xhci_urb_dequeue()
1604 td = urb_priv->td[i]; xhci_urb_dequeue()
1605 list_add_tail(&td->cancelled_td_list, &ep->cancelled_td_list); xhci_urb_dequeue()
2925 unsigned int ep_index, struct xhci_td *td) xhci_cleanup_stalled_ring()
2929 struct usb_device *udev = td->urb->dev; xhci_cleanup_stalled_ring()
2938 ep_index, ep->stopped_stream, td, &deq_state); xhci_cleanup_stalled_ring()
2924 xhci_cleanup_stalled_ring(struct xhci_hcd *xhci, unsigned int ep_index, struct xhci_td *td) xhci_cleanup_stalled_ring() argument
H A Dfotg210-hcd.c128 fotg210_dbg(fotg210, "%s td %p n%08x %08x t%08x p0=%08x\n", label, qtd, dbg_qtd()
369 struct fotg210_qtd *td; qh_lines() local
405 list_for_each_entry(td, &qh->qtd_list, qtd_list) { qh_lines()
406 scratch = hc32_to_cpup(fotg210, &td->hw_token); qh_lines()
408 if (hw_curr == td->qtd_dma) qh_lines()
410 else if (hw->hw_qtd_next == cpu_to_hc32(fotg210, td->qtd_dma)) qh_lines()
413 if (td->hw_alt_next == fotg210->async->hw->hw_alt_next) qh_lines()
415 else if (td->hw_alt_next != list_end) qh_lines()
420 td, mark, ({ char *tmp; qh_lines()
437 td->urb); qh_lines()
1890 /* dummy td enables safe urb queuing */ fotg210_qh_alloc()
1893 fotg210_dbg(fotg210, "no dummy td\n"); fotg210_qh_alloc()
3011 /* to avoid racing the HC, use the dummy td instead of qh_append_tds()
3012 * the first td of our list (becomes new dummy). both qh_append_tds()
5000 * from automatically advancing to the next td after short reads. hcd_fotg210_init()
H A Disp116x.h555 printk(KERN_WARNING "td: %x %d%c%d %d,%d,%d %x %x%x%x\n", dump_ptd()
H A Dehci-q.c1057 /* to avoid racing the HC, use the dummy td instead of qh_append_tds()
1058 * the first td of our list (becomes new dummy). both qh_append_tds()
H A Doxu210hp-hcd.c653 /* dummy td enables safe urb queuing */ oxu_qh_alloc()
656 oxu_dbg(oxu, "no dummy td\n"); oxu_qh_alloc()
1579 /* to avoid racing the HC, use the dummy td instead of qh_append_tds()
1580 * the first td of our list (becomes new dummy). both qh_append_tds()
2629 * from automatically advancing to the next td after short reads. oxu_hcd_init()
H A Duhci-hcd.c613 dev_err(uhci_dev(uhci), "unable to create td dma_pool\n"); uhci_start()
H A Dxhci-mem.c446 /* td list should be empty since all URBs have been cancelled, xhci_reinit_cached_ring()
1775 kfree(urb_priv->td[0]); xhci_urb_free_priv()
H A Dxhci.h1428 struct xhci_td *td[0]; member in struct:urb_priv
1910 unsigned int ep_index, struct xhci_td *td);
H A Dehci-hcd.c520 * from automatically advancing to the next td after short reads. ehci_init()
H A Dehci-sched.c2040 /* might need to cross a buffer page within a td */ sitd_sched_init()
/linux-4.4.14/drivers/clk/tegra/
H A Dclk-dfll.c178 * Integrated I2C controller registers - relative to td->i2c_controller_base
322 static inline u32 dfll_readl(struct tegra_dfll *td, u32 offs) dfll_readl() argument
324 return __raw_readl(td->base + offs); dfll_readl()
327 static inline void dfll_writel(struct tegra_dfll *td, u32 val, u32 offs) dfll_writel() argument
330 __raw_writel(val, td->base + offs); dfll_writel()
333 static inline void dfll_wmb(struct tegra_dfll *td) dfll_wmb() argument
335 dfll_readl(td, DFLL_CTRL); dfll_wmb()
340 static inline u32 dfll_i2c_readl(struct tegra_dfll *td, u32 offs) dfll_i2c_readl() argument
342 return __raw_readl(td->i2c_base + offs); dfll_i2c_readl()
345 static inline void dfll_i2c_writel(struct tegra_dfll *td, u32 val, u32 offs) dfll_i2c_writel() argument
347 __raw_writel(val, td->i2c_base + offs); dfll_i2c_writel()
350 static inline void dfll_i2c_wmb(struct tegra_dfll *td) dfll_i2c_wmb() argument
352 dfll_i2c_readl(td, DFLL_I2C_CFG); dfll_i2c_wmb()
357 * @td: DFLL instance
362 static bool dfll_is_running(struct tegra_dfll *td) dfll_is_running() argument
364 return td->mode >= DFLL_OPEN_LOOP; dfll_is_running()
382 struct tegra_dfll *td = dev_get_drvdata(dev); tegra_dfll_runtime_resume() local
385 ret = clk_enable(td->ref_clk); tegra_dfll_runtime_resume()
391 ret = clk_enable(td->soc_clk); tegra_dfll_runtime_resume()
394 clk_disable(td->ref_clk); tegra_dfll_runtime_resume()
398 ret = clk_enable(td->i2c_clk); tegra_dfll_runtime_resume()
401 clk_disable(td->soc_clk); tegra_dfll_runtime_resume()
402 clk_disable(td->ref_clk); tegra_dfll_runtime_resume()
419 struct tegra_dfll *td = dev_get_drvdata(dev); tegra_dfll_runtime_suspend() local
421 clk_disable(td->ref_clk); tegra_dfll_runtime_suspend()
422 clk_disable(td->soc_clk); tegra_dfll_runtime_suspend()
423 clk_disable(td->i2c_clk); tegra_dfll_runtime_suspend()
435 * @td: DFLL instance
441 static void dfll_tune_low(struct tegra_dfll *td) dfll_tune_low() argument
443 td->tune_range = DFLL_TUNE_LOW; dfll_tune_low()
445 dfll_writel(td, td->soc->tune0_low, DFLL_TUNE0); dfll_tune_low()
446 dfll_writel(td, td->soc->tune1, DFLL_TUNE1); dfll_tune_low()
447 dfll_wmb(td); dfll_tune_low()
449 if (td->soc->set_clock_trimmers_low) dfll_tune_low()
450 td->soc->set_clock_trimmers_low(); dfll_tune_low()
477 * @td: DFLL instance
483 static void dfll_set_mode(struct tegra_dfll *td, dfll_set_mode() argument
486 td->mode = mode; dfll_set_mode()
487 dfll_writel(td, mode - 1, DFLL_CTRL); dfll_set_mode()
488 dfll_wmb(td); dfll_set_mode()
497 * @td: DFLL instance
503 static int dfll_i2c_set_output_enabled(struct tegra_dfll *td, bool enable) dfll_i2c_set_output_enabled() argument
507 val = dfll_i2c_readl(td, DFLL_OUTPUT_CFG); dfll_i2c_set_output_enabled()
514 dfll_i2c_writel(td, val, DFLL_OUTPUT_CFG); dfll_i2c_set_output_enabled()
515 dfll_i2c_wmb(td); dfll_i2c_set_output_enabled()
522 * @td: struct tegra_dfll *
527 static void dfll_load_i2c_lut(struct tegra_dfll *td) dfll_load_i2c_lut() argument
533 if (i < td->lut_min) dfll_load_i2c_lut()
534 lut_index = td->lut_min; dfll_load_i2c_lut()
535 else if (i > td->lut_max) dfll_load_i2c_lut()
536 lut_index = td->lut_max; dfll_load_i2c_lut()
540 val = regulator_list_hardware_vsel(td->vdd_reg, dfll_load_i2c_lut()
541 td->i2c_lut[lut_index]); dfll_load_i2c_lut()
542 __raw_writel(val, td->lut_base + i * 4); dfll_load_i2c_lut()
545 dfll_i2c_wmb(td); dfll_load_i2c_lut()
550 * @td: DFLL instance
558 static void dfll_init_i2c_if(struct tegra_dfll *td) dfll_init_i2c_if() argument
562 if (td->i2c_slave_addr > 0x7f) { dfll_init_i2c_if()
563 val = td->i2c_slave_addr << DFLL_I2C_CFG_SLAVE_ADDR_SHIFT_10BIT; dfll_init_i2c_if()
566 val = td->i2c_slave_addr << DFLL_I2C_CFG_SLAVE_ADDR_SHIFT_7BIT; dfll_init_i2c_if()
570 dfll_i2c_writel(td, val, DFLL_I2C_CFG); dfll_init_i2c_if()
572 dfll_i2c_writel(td, td->i2c_reg, DFLL_I2C_VDD_REG_ADDR); dfll_init_i2c_if()
574 val = DIV_ROUND_UP(td->i2c_clk_rate, td->i2c_fs_rate * 8); dfll_init_i2c_if()
580 __raw_writel(val, td->i2c_controller_base + DFLL_I2C_CLK_DIVISOR); dfll_init_i2c_if()
581 dfll_i2c_wmb(td); dfll_init_i2c_if()
586 * @td: DFLL instance
592 static void dfll_init_out_if(struct tegra_dfll *td) dfll_init_out_if() argument
596 td->lut_min = 0; dfll_init_out_if()
597 td->lut_max = td->i2c_lut_size - 1; dfll_init_out_if()
598 td->lut_safe = td->lut_min + 1; dfll_init_out_if()
600 dfll_i2c_writel(td, 0, DFLL_OUTPUT_CFG); dfll_init_out_if()
601 val = (td->lut_safe << DFLL_OUTPUT_CFG_SAFE_SHIFT) | dfll_init_out_if()
602 (td->lut_max << DFLL_OUTPUT_CFG_MAX_SHIFT) | dfll_init_out_if()
603 (td->lut_min << DFLL_OUTPUT_CFG_MIN_SHIFT); dfll_init_out_if()
604 dfll_i2c_writel(td, val, DFLL_OUTPUT_CFG); dfll_init_out_if()
605 dfll_i2c_wmb(td); dfll_init_out_if()
607 dfll_writel(td, 0, DFLL_OUTPUT_FORCE); dfll_init_out_if()
608 dfll_i2c_writel(td, 0, DFLL_INTR_EN); dfll_init_out_if()
609 dfll_i2c_writel(td, DFLL_INTR_MAX_MASK | DFLL_INTR_MIN_MASK, dfll_init_out_if()
612 dfll_load_i2c_lut(td); dfll_init_out_if()
613 dfll_init_i2c_if(td); dfll_init_out_if()
622 * @td: DFLL instance
630 static int find_lut_index_for_rate(struct tegra_dfll *td, unsigned long rate) find_lut_index_for_rate() argument
637 opp = dev_pm_opp_find_freq_ceil(td->soc->dev, &rate); find_lut_index_for_rate()
646 for (i = 0; i < td->i2c_lut_size; i++) { find_lut_index_for_rate()
647 if (regulator_list_voltage(td->vdd_reg, td->i2c_lut[i]) == uv) find_lut_index_for_rate()
656 * @td: DFLL instance
665 static int dfll_calculate_rate_request(struct tegra_dfll *td, dfll_calculate_rate_request() argument
678 if (rate < td->dvco_rate_min) { dfll_calculate_rate_request()
682 td->dvco_rate_min / 1000); dfll_calculate_rate_request()
684 dev_err(td->dev, "%s: Rate %lu is too low\n", dfll_calculate_rate_request()
689 rate = td->dvco_rate_min; dfll_calculate_rate_request()
693 val = DVCO_RATE_TO_MULT(rate, td->ref_rate); dfll_calculate_rate_request()
695 dev_err(td->dev, "%s: Rate %lu is above dfll range\n", dfll_calculate_rate_request()
700 req->dvco_target_rate = MULT_TO_DVCO_RATE(req->mult_bits, td->ref_rate); dfll_calculate_rate_request()
703 req->lut_index = find_lut_index_for_rate(td, req->dvco_target_rate); dfll_calculate_rate_request()
712 * @td: DFLL instance
718 static void dfll_set_frequency_request(struct tegra_dfll *td, dfll_set_frequency_request() argument
723 int coef = 128; /* FIXME: td->cg_scale? */; dfll_set_frequency_request()
725 force_val = (req->lut_index - td->lut_safe) * coef / td->cg; dfll_set_frequency_request()
734 dfll_writel(td, val, DFLL_FREQ_REQ); dfll_set_frequency_request()
735 dfll_wmb(td); dfll_set_frequency_request()
740 * @td: DFLL instance
750 static int dfll_request_rate(struct tegra_dfll *td, unsigned long rate) dfll_request_rate() argument
755 if (td->mode == DFLL_UNINITIALIZED) { dfll_request_rate()
756 dev_err(td->dev, "%s: Cannot set DFLL rate in %s mode\n", dfll_request_rate()
757 __func__, mode_name[td->mode]); dfll_request_rate()
761 ret = dfll_calculate_rate_request(td, &req, rate); dfll_request_rate()
765 td->last_unrounded_rate = rate; dfll_request_rate()
766 td->last_req = req; dfll_request_rate()
768 if (td->mode == DFLL_CLOSED_LOOP) dfll_request_rate()
769 dfll_set_frequency_request(td, &td->last_req); dfll_request_rate()
780 * @td: DFLL instance
785 static int dfll_disable(struct tegra_dfll *td) dfll_disable() argument
787 if (td->mode != DFLL_OPEN_LOOP) { dfll_disable()
788 dev_err(td->dev, "cannot disable DFLL in %s mode\n", dfll_disable()
789 mode_name[td->mode]); dfll_disable()
793 dfll_set_mode(td, DFLL_DISABLED); dfll_disable()
794 pm_runtime_put_sync(td->dev); dfll_disable()
801 * @td: DFLL instance
806 static int dfll_enable(struct tegra_dfll *td) dfll_enable() argument
808 if (td->mode != DFLL_DISABLED) { dfll_enable()
809 dev_err(td->dev, "cannot enable DFLL in %s mode\n", dfll_enable()
810 mode_name[td->mode]); dfll_enable()
814 pm_runtime_get_sync(td->dev); dfll_enable()
815 dfll_set_mode(td, DFLL_OPEN_LOOP); dfll_enable()
822 * @td: DFLL instance
831 static void dfll_set_open_loop_config(struct tegra_dfll *td) dfll_set_open_loop_config() argument
836 if (td->tune_range != DFLL_TUNE_LOW) dfll_set_open_loop_config()
837 dfll_tune_low(td); dfll_set_open_loop_config()
839 val = dfll_readl(td, DFLL_FREQ_REQ); dfll_set_open_loop_config()
842 dfll_writel(td, val, DFLL_FREQ_REQ); dfll_set_open_loop_config()
843 dfll_wmb(td); dfll_set_open_loop_config()
848 * @td: DFLL instance
854 static int dfll_lock(struct tegra_dfll *td) dfll_lock() argument
856 struct dfll_rate_req *req = &td->last_req; dfll_lock()
858 switch (td->mode) { dfll_lock()
864 dev_err(td->dev, "%s: Cannot lock DFLL at rate 0\n", dfll_lock()
869 dfll_i2c_set_output_enabled(td, true); dfll_lock()
870 dfll_set_mode(td, DFLL_CLOSED_LOOP); dfll_lock()
871 dfll_set_frequency_request(td, req); dfll_lock()
875 BUG_ON(td->mode > DFLL_CLOSED_LOOP); dfll_lock()
876 dev_err(td->dev, "%s: Cannot lock DFLL in %s mode\n", dfll_lock()
877 __func__, mode_name[td->mode]); dfll_lock()
884 * @td: DFLL instance
889 static int dfll_unlock(struct tegra_dfll *td) dfll_unlock() argument
891 switch (td->mode) { dfll_unlock()
893 dfll_set_open_loop_config(td); dfll_unlock()
894 dfll_set_mode(td, DFLL_OPEN_LOOP); dfll_unlock()
895 dfll_i2c_set_output_enabled(td, false); dfll_unlock()
902 BUG_ON(td->mode > DFLL_CLOSED_LOOP); dfll_unlock()
903 dev_err(td->dev, "%s: Cannot unlock DFLL in %s mode\n", dfll_unlock()
904 __func__, mode_name[td->mode]); dfll_unlock()
920 struct tegra_dfll *td = clk_hw_to_dfll(hw); dfll_clk_is_enabled() local
922 return dfll_is_running(td); dfll_clk_is_enabled()
927 struct tegra_dfll *td = clk_hw_to_dfll(hw); dfll_clk_enable() local
930 ret = dfll_enable(td); dfll_clk_enable()
934 ret = dfll_lock(td); dfll_clk_enable()
936 dfll_disable(td); dfll_clk_enable()
943 struct tegra_dfll *td = clk_hw_to_dfll(hw); dfll_clk_disable() local
946 ret = dfll_unlock(td); dfll_clk_disable()
948 dfll_disable(td); dfll_clk_disable()
954 struct tegra_dfll *td = clk_hw_to_dfll(hw); dfll_clk_recalc_rate() local
956 return td->last_unrounded_rate; dfll_clk_recalc_rate()
963 struct tegra_dfll *td = clk_hw_to_dfll(hw); dfll_clk_determine_rate() local
967 ret = dfll_calculate_rate_request(td, &req, clk_req->rate); dfll_clk_determine_rate()
983 struct tegra_dfll *td = clk_hw_to_dfll(hw); dfll_clk_set_rate() local
985 return dfll_request_rate(td, rate); dfll_clk_set_rate()
1005 * @td: DFLL instance
1011 static int dfll_register_clk(struct tegra_dfll *td) dfll_register_clk() argument
1015 dfll_clk_init_data.name = td->output_clock_name; dfll_register_clk()
1016 td->dfll_clk_hw.init = &dfll_clk_init_data; dfll_register_clk()
1018 td->dfll_clk = clk_register(td->dev, &td->dfll_clk_hw); dfll_register_clk()
1019 if (IS_ERR(td->dfll_clk)) { dfll_register_clk()
1020 dev_err(td->dev, "DFLL clock registration error\n"); dfll_register_clk()
1024 ret = of_clk_add_provider(td->dev->of_node, of_clk_src_simple_get, dfll_register_clk()
1025 td->dfll_clk); dfll_register_clk()
1027 dev_err(td->dev, "of_clk_add_provider() failed\n"); dfll_register_clk()
1029 clk_unregister(td->dfll_clk); dfll_register_clk()
1038 * @td: DFLL instance
1043 static void dfll_unregister_clk(struct tegra_dfll *td) dfll_unregister_clk() argument
1045 of_clk_del_provider(td->dev->of_node); dfll_unregister_clk()
1046 clk_unregister(td->dfll_clk); dfll_unregister_clk()
1047 td->dfll_clk = NULL; dfll_unregister_clk()
1075 * @td: DFLL instance
1086 static u64 dfll_read_monitor_rate(struct tegra_dfll *td) dfll_read_monitor_rate() argument
1091 if (!dfll_is_running(td)) dfll_read_monitor_rate()
1094 v = dfll_readl(td, DFLL_MONITOR_DATA); dfll_read_monitor_rate()
1096 pre_scaler_rate = dfll_calc_monitored_rate(v, td->ref_rate); dfll_read_monitor_rate()
1098 s = dfll_readl(td, DFLL_FREQ_REQ); dfll_read_monitor_rate()
1107 struct tegra_dfll *td = data; attr_enable_get() local
1109 *val = dfll_is_running(td); attr_enable_get()
1115 struct tegra_dfll *td = data; attr_enable_set() local
1117 return val ? dfll_enable(td) : dfll_disable(td); attr_enable_set()
1124 struct tegra_dfll *td = data; attr_lock_get() local
1126 *val = (td->mode == DFLL_CLOSED_LOOP); attr_lock_get()
1132 struct tegra_dfll *td = data; attr_lock_set() local
1134 return val ? dfll_lock(td) : dfll_unlock(td); attr_lock_set()
1141 struct tegra_dfll *td = data; attr_rate_get() local
1143 *val = dfll_read_monitor_rate(td); attr_rate_get()
1150 struct tegra_dfll *td = data; attr_rate_set() local
1152 return dfll_request_rate(td, val); attr_rate_set()
1159 struct tegra_dfll *td = s->private; attr_registers_show() local
1164 val = dfll_i2c_readl(td, offs); attr_registers_show()
1166 val = dfll_readl(td, offs); attr_registers_show()
1173 dfll_i2c_readl(td, offs)); attr_registers_show()
1176 dfll_i2c_readl(td, offs)); attr_registers_show()
1181 __raw_readl(td->i2c_controller_base + offs)); attr_registers_show()
1186 __raw_readl(td->lut_base + offs)); attr_registers_show()
1203 static int dfll_debug_init(struct tegra_dfll *td) dfll_debug_init() argument
1207 if (!td || (td->mode == DFLL_UNINITIALIZED)) dfll_debug_init()
1210 td->debugfs_dir = debugfs_create_dir("tegra_dfll_fcpu", NULL); dfll_debug_init()
1211 if (!td->debugfs_dir) dfll_debug_init()
1217 td->debugfs_dir, td, &enable_fops)) dfll_debug_init()
1221 td->debugfs_dir, td, &lock_fops)) dfll_debug_init()
1225 td->debugfs_dir, td, &rate_fops)) dfll_debug_init()
1229 td->debugfs_dir, td, &attr_registers_fops)) dfll_debug_init()
1235 debugfs_remove_recursive(td->debugfs_dir); dfll_debug_init()
1247 * @td: DFLL instance
1253 static void dfll_set_default_params(struct tegra_dfll *td) dfll_set_default_params() argument
1257 val = DIV_ROUND_UP(td->ref_rate, td->sample_rate * 32); dfll_set_default_params()
1259 dfll_writel(td, val, DFLL_CONFIG); dfll_set_default_params()
1261 val = (td->force_mode << DFLL_PARAMS_FORCE_MODE_SHIFT) | dfll_set_default_params()
1262 (td->cf << DFLL_PARAMS_CF_PARAM_SHIFT) | dfll_set_default_params()
1263 (td->ci << DFLL_PARAMS_CI_PARAM_SHIFT) | dfll_set_default_params()
1264 (td->cg << DFLL_PARAMS_CG_PARAM_SHIFT) | dfll_set_default_params()
1265 (td->cg_scale ? DFLL_PARAMS_CG_SCALE : 0); dfll_set_default_params()
1266 dfll_writel(td, val, DFLL_PARAMS); dfll_set_default_params()
1268 dfll_tune_low(td); dfll_set_default_params()
1269 dfll_writel(td, td->droop_ctrl, DFLL_DROOP_CTRL); dfll_set_default_params()
1270 dfll_writel(td, DFLL_MONITOR_CTRL_FREQ, DFLL_MONITOR_CTRL); dfll_set_default_params()
1275 * @td: DFLL instance
1281 static int dfll_init_clks(struct tegra_dfll *td) dfll_init_clks() argument
1283 td->ref_clk = devm_clk_get(td->dev, "ref"); dfll_init_clks()
1284 if (IS_ERR(td->ref_clk)) { dfll_init_clks()
1285 dev_err(td->dev, "missing ref clock\n"); dfll_init_clks()
1286 return PTR_ERR(td->ref_clk); dfll_init_clks()
1289 td->soc_clk = devm_clk_get(td->dev, "soc"); dfll_init_clks()
1290 if (IS_ERR(td->soc_clk)) { dfll_init_clks()
1291 dev_err(td->dev, "missing soc clock\n"); dfll_init_clks()
1292 return PTR_ERR(td->soc_clk); dfll_init_clks()
1295 td->i2c_clk = devm_clk_get(td->dev, "i2c"); dfll_init_clks()
1296 if (IS_ERR(td->i2c_clk)) { dfll_init_clks()
1297 dev_err(td->dev, "missing i2c clock\n"); dfll_init_clks()
1298 return PTR_ERR(td->i2c_clk); dfll_init_clks()
1300 td->i2c_clk_rate = clk_get_rate(td->i2c_clk); dfll_init_clks()
1307 * @td: DFLL instance
1314 static int dfll_init(struct tegra_dfll *td) dfll_init() argument
1318 td->ref_rate = clk_get_rate(td->ref_clk); dfll_init()
1319 if (td->ref_rate != REF_CLOCK_RATE) { dfll_init()
1320 dev_err(td->dev, "unexpected ref clk rate %lu, expecting %lu", dfll_init()
1321 td->ref_rate, REF_CLOCK_RATE); dfll_init()
1325 reset_control_deassert(td->dvco_rst); dfll_init()
1327 ret = clk_prepare(td->ref_clk); dfll_init()
1329 dev_err(td->dev, "failed to prepare ref_clk\n"); dfll_init()
1333 ret = clk_prepare(td->soc_clk); dfll_init()
1335 dev_err(td->dev, "failed to prepare soc_clk\n"); dfll_init()
1339 ret = clk_prepare(td->i2c_clk); dfll_init()
1341 dev_err(td->dev, "failed to prepare i2c_clk\n"); dfll_init()
1345 td->last_unrounded_rate = 0; dfll_init()
1347 pm_runtime_enable(td->dev); dfll_init()
1348 pm_runtime_get_sync(td->dev); dfll_init()
1350 dfll_set_mode(td, DFLL_DISABLED); dfll_init()
1351 dfll_set_default_params(td); dfll_init()
1353 if (td->soc->init_clock_trimmers) dfll_init()
1354 td->soc->init_clock_trimmers(); dfll_init()
1356 dfll_set_open_loop_config(td); dfll_init()
1358 dfll_init_out_if(td); dfll_init()
1360 pm_runtime_put_sync(td->dev); dfll_init()
1365 clk_unprepare(td->soc_clk); dfll_init()
1367 clk_unprepare(td->ref_clk); dfll_init()
1369 reset_control_assert(td->dvco_rst); dfll_init()
1382 static int find_vdd_map_entry_exact(struct tegra_dfll *td, int uV) find_vdd_map_entry_exact() argument
1386 n_voltages = regulator_count_voltages(td->vdd_reg); find_vdd_map_entry_exact()
1388 reg_uV = regulator_list_voltage(td->vdd_reg, i); find_vdd_map_entry_exact()
1396 dev_err(td->dev, "no voltage map entry for %d uV\n", uV); find_vdd_map_entry_exact()
1404 static int find_vdd_map_entry_min(struct tegra_dfll *td, int uV) find_vdd_map_entry_min() argument
1408 n_voltages = regulator_count_voltages(td->vdd_reg); find_vdd_map_entry_min()
1410 reg_uV = regulator_list_voltage(td->vdd_reg, i); find_vdd_map_entry_min()
1418 dev_err(td->dev, "no voltage map entry rounding to %d uV\n", uV); find_vdd_map_entry_min()
1424 * @td: DFLL instance
1429 * the soc-specific platform driver (td->soc->opp_dev) and the PMIC
1432 * On success, fills in td->i2c_lut and returns 0, or -err on failure.
1434 static int dfll_build_i2c_lut(struct tegra_dfll *td) dfll_build_i2c_lut() argument
1446 opp = dev_pm_opp_find_freq_floor(td->soc->dev, &rate); dfll_build_i2c_lut()
1448 dev_err(td->dev, "couldn't get vmax opp, empty opp table?\n"); dfll_build_i2c_lut()
1453 v = td->soc->min_millivolts * 1000; dfll_build_i2c_lut()
1454 lut = find_vdd_map_entry_exact(td, v); dfll_build_i2c_lut()
1457 td->i2c_lut[0] = lut; dfll_build_i2c_lut()
1460 opp = dev_pm_opp_find_freq_ceil(td->soc->dev, &rate); dfll_build_i2c_lut()
1465 if (v_opp <= td->soc->min_millivolts * 1000) dfll_build_i2c_lut()
1466 td->dvco_rate_min = dev_pm_opp_get_freq(opp); dfll_build_i2c_lut()
1473 selector = find_vdd_map_entry_min(td, v); dfll_build_i2c_lut()
1476 if (selector != td->i2c_lut[j - 1]) dfll_build_i2c_lut()
1477 td->i2c_lut[j++] = selector; dfll_build_i2c_lut()
1481 selector = find_vdd_map_entry_exact(td, v); dfll_build_i2c_lut()
1484 if (selector != td->i2c_lut[j - 1]) dfll_build_i2c_lut()
1485 td->i2c_lut[j++] = selector; dfll_build_i2c_lut()
1490 td->i2c_lut_size = j; dfll_build_i2c_lut()
1492 if (!td->dvco_rate_min) dfll_build_i2c_lut()
1493 dev_err(td->dev, "no opp above DFLL minimum voltage %d mV\n", dfll_build_i2c_lut()
1494 td->soc->min_millivolts); dfll_build_i2c_lut()
1506 * @td: DFLL instance
1514 static bool read_dt_param(struct tegra_dfll *td, const char *param, u32 *dest) read_dt_param() argument
1516 int err = of_property_read_u32(td->dev->of_node, param, dest); read_dt_param()
1519 dev_err(td->dev, "failed to read DT parameter %s: %d\n", read_dt_param()
1529 * @td: DFLL instance
1535 static int dfll_fetch_i2c_params(struct tegra_dfll *td) dfll_fetch_i2c_params() argument
1543 if (!read_dt_param(td, "nvidia,i2c-fs-rate", &td->i2c_fs_rate)) dfll_fetch_i2c_params()
1546 regmap = regulator_get_regmap(td->vdd_reg); dfll_fetch_i2c_params()
1550 td->i2c_slave_addr = i2c_client->addr; dfll_fetch_i2c_params()
1552 ret = regulator_get_hardware_vsel_register(td->vdd_reg, dfll_fetch_i2c_params()
1556 dev_err(td->dev, dfll_fetch_i2c_params()
1560 td->i2c_reg = vsel_reg; dfll_fetch_i2c_params()
1562 ret = dfll_build_i2c_lut(td); dfll_fetch_i2c_params()
1564 dev_err(td->dev, "couldn't build I2C LUT\n"); dfll_fetch_i2c_params()
1573 * @td: DFLL instance
1578 static int dfll_fetch_common_params(struct tegra_dfll *td) dfll_fetch_common_params() argument
1582 ok &= read_dt_param(td, "nvidia,droop-ctrl", &td->droop_ctrl); dfll_fetch_common_params()
1583 ok &= read_dt_param(td, "nvidia,sample-rate", &td->sample_rate); dfll_fetch_common_params()
1584 ok &= read_dt_param(td, "nvidia,force-mode", &td->force_mode); dfll_fetch_common_params()
1585 ok &= read_dt_param(td, "nvidia,cf", &td->cf); dfll_fetch_common_params()
1586 ok &= read_dt_param(td, "nvidia,ci", &td->ci); dfll_fetch_common_params()
1587 ok &= read_dt_param(td, "nvidia,cg", &td->cg); dfll_fetch_common_params()
1588 td->cg_scale = of_property_read_bool(td->dev->of_node, dfll_fetch_common_params()
1591 if (of_property_read_string(td->dev->of_node, "clock-output-names", dfll_fetch_common_params()
1592 &td->output_clock_name)) { dfll_fetch_common_params()
1593 dev_err(td->dev, "missing clock-output-names property\n"); dfll_fetch_common_params()
1617 struct tegra_dfll *td; tegra_dfll_register() local
1625 td = devm_kzalloc(&pdev->dev, sizeof(*td), GFP_KERNEL); tegra_dfll_register()
1626 if (!td) tegra_dfll_register()
1628 td->dev = &pdev->dev; tegra_dfll_register()
1629 platform_set_drvdata(pdev, td); tegra_dfll_register()
1631 td->soc = soc; tegra_dfll_register()
1633 td->vdd_reg = devm_regulator_get(td->dev, "vdd-cpu"); tegra_dfll_register()
1634 if (IS_ERR(td->vdd_reg)) { tegra_dfll_register()
1635 dev_err(td->dev, "couldn't get vdd_cpu regulator\n"); tegra_dfll_register()
1636 return PTR_ERR(td->vdd_reg); tegra_dfll_register()
1639 td->dvco_rst = devm_reset_control_get(td->dev, "dvco"); tegra_dfll_register()
1640 if (IS_ERR(td->dvco_rst)) { tegra_dfll_register()
1641 dev_err(td->dev, "couldn't get dvco reset\n"); tegra_dfll_register()
1642 return PTR_ERR(td->dvco_rst); tegra_dfll_register()
1645 ret = dfll_fetch_common_params(td); tegra_dfll_register()
1647 dev_err(td->dev, "couldn't parse device tree parameters\n"); tegra_dfll_register()
1651 ret = dfll_fetch_i2c_params(td); tegra_dfll_register()
1657 dev_err(td->dev, "no control register resource\n"); tegra_dfll_register()
1661 td->base = devm_ioremap(td->dev, mem->start, resource_size(mem)); tegra_dfll_register()
1662 if (!td->base) { tegra_dfll_register()
1663 dev_err(td->dev, "couldn't ioremap DFLL control registers\n"); tegra_dfll_register()
1669 dev_err(td->dev, "no i2c_base resource\n"); tegra_dfll_register()
1673 td->i2c_base = devm_ioremap(td->dev, mem->start, resource_size(mem)); tegra_dfll_register()
1674 if (!td->i2c_base) { tegra_dfll_register()
1675 dev_err(td->dev, "couldn't ioremap i2c_base resource\n"); tegra_dfll_register()
1681 dev_err(td->dev, "no i2c_controller_base resource\n"); tegra_dfll_register()
1685 td->i2c_controller_base = devm_ioremap(td->dev, mem->start, tegra_dfll_register()
1687 if (!td->i2c_controller_base) { tegra_dfll_register()
1688 dev_err(td->dev, tegra_dfll_register()
1695 dev_err(td->dev, "no lut_base resource\n"); tegra_dfll_register()
1699 td->lut_base = devm_ioremap(td->dev, mem->start, resource_size(mem)); tegra_dfll_register()
1700 if (!td->lut_base) { tegra_dfll_register()
1701 dev_err(td->dev, tegra_dfll_register()
1706 ret = dfll_init_clks(td); tegra_dfll_register()
1713 ret = dfll_init(td); tegra_dfll_register()
1717 ret = dfll_register_clk(td); tegra_dfll_register()
1724 dfll_debug_init(td); tegra_dfll_register()
1741 struct tegra_dfll *td = platform_get_drvdata(pdev); tegra_dfll_unregister() local
1744 if (td->mode != DFLL_DISABLED) { tegra_dfll_unregister()
1750 debugfs_remove_recursive(td->debugfs_dir); tegra_dfll_unregister()
1752 dfll_unregister_clk(td); tegra_dfll_unregister()
1755 clk_unprepare(td->ref_clk); tegra_dfll_unregister()
1756 clk_unprepare(td->soc_clk); tegra_dfll_unregister()
1757 clk_unprepare(td->i2c_clk); tegra_dfll_unregister()
1759 reset_control_assert(td->dvco_rst); tegra_dfll_unregister()
/linux-4.4.14/drivers/usb/c67x00/
H A Dc67x00-sched.c32 * in both urb->interval and td->privdata.
80 * an urb can be dequeued while a td is in progress
81 * after checking the td, the toggle bit might need to
96 #define td_udev(td) ((td)->ep_data->dev)
129 #define td_residue(td) ((__s8)(td->residue))
130 #define td_ly_base_addr(td) (__le16_to_cpu((td)->ly_base_addr))
131 #define td_port_length(td) (__le16_to_cpu((td)->port_length))
132 #define td_next_td_addr(td) (__le16_to_cpu((td)->next_td_addr))
134 #define td_active(td) ((td)->retry_cnt & TD_RETRYCNTMASK_ACT_FLG)
135 #define td_length(td) (td_port_length(td) & TD_PORTLENMASK_DL)
137 #define td_sequence_ok(td) (!td->status || \
138 (!(td->status & TD_STATUSMASK_SEQ) == \
139 !(td->ctrl_reg & SEQ_SEL)))
141 #define td_acked(td) (!td->status || \
142 (td->status & TD_STATUSMASK_ACK))
143 #define td_actual_bytes(td) (td_length(td) - td_residue(td))
150 static void dbg_td(struct c67x00_hcd *c67x00, struct c67x00_td *td, char *msg) dbg_td() argument
154 dev_dbg(dev, "### %s at 0x%04x\n", msg, td->td_addr); dbg_td()
155 dev_dbg(dev, "urb: 0x%p\n", td->urb); dbg_td()
156 dev_dbg(dev, "endpoint: %4d\n", usb_pipeendpoint(td->pipe)); dbg_td()
157 dev_dbg(dev, "pipeout: %4d\n", usb_pipeout(td->pipe)); dbg_td()
158 dev_dbg(dev, "ly_base_addr: 0x%04x\n", td_ly_base_addr(td)); dbg_td()
159 dev_dbg(dev, "port_length: 0x%04x\n", td_port_length(td)); dbg_td()
160 dev_dbg(dev, "pid_ep: 0x%02x\n", td->pid_ep); dbg_td()
161 dev_dbg(dev, "dev_addr: 0x%02x\n", td->dev_addr); dbg_td()
162 dev_dbg(dev, "ctrl_reg: 0x%02x\n", td->ctrl_reg); dbg_td()
163 dev_dbg(dev, "status: 0x%02x\n", td->status); dbg_td()
164 dev_dbg(dev, "retry_cnt: 0x%02x\n", td->retry_cnt); dbg_td()
165 dev_dbg(dev, "residue: 0x%02x\n", td->residue); dbg_td()
166 dev_dbg(dev, "next_td_addr: 0x%04x\n", td_next_td_addr(td)); dbg_td()
167 dev_dbg(dev, "data: %*ph\n", td_length(td), td->data); dbg_td()
214 struct c67x00_td *td; c67x00_release_urb() local
232 list_for_each_entry(td, &c67x00->td_list, td_list) c67x00_release_urb()
233 if (urb == td->urb) c67x00_release_urb()
234 td->urb = NULL; c67x00_release_urb()
581 struct c67x00_td *td; c67x00_create_td() local
591 td = kzalloc(sizeof(*td), GFP_ATOMIC); c67x00_create_td()
592 if (!td) c67x00_create_td()
595 td->pipe = urb->pipe; c67x00_create_td()
596 td->ep_data = urbp->ep_data; c67x00_create_td()
598 if ((td_udev(td)->speed == USB_SPEED_LOW) && c67x00_create_td()
602 switch (usb_pipetype(td->pipe)) { c67x00_create_td()
624 td->td_addr = c67x00->next_td_addr; c67x00_create_td()
628 td->ly_base_addr = __cpu_to_le16(c67x00->next_buf_addr); c67x00_create_td()
629 td->port_length = __cpu_to_le16((c67x00->sie->sie_num << 15) | c67x00_create_td()
631 td->pid_ep = ((pid & 0xF) << TD_PIDEP_OFFSET) | c67x00_create_td()
632 (usb_pipeendpoint(td->pipe) & 0xF); c67x00_create_td()
633 td->dev_addr = usb_pipedevice(td->pipe) & 0x7F; c67x00_create_td()
634 td->ctrl_reg = cmd; c67x00_create_td()
635 td->status = 0; c67x00_create_td()
636 td->retry_cnt = (tt << TT_OFFSET) | (active_flag << 4) | retry_cnt; c67x00_create_td()
637 td->residue = 0; c67x00_create_td()
638 td->next_td_addr = __cpu_to_le16(c67x00->next_td_addr); c67x00_create_td()
641 td->data = data; c67x00_create_td()
642 td->urb = urb; c67x00_create_td()
643 td->privdata = privdata; c67x00_create_td()
647 list_add_tail(&td->td_list, &c67x00->td_list); c67x00_create_td()
651 static inline void c67x00_release_td(struct c67x00_td *td) c67x00_release_td() argument
653 list_del_init(&td->td_list); c67x00_release_td()
654 kfree(td); c67x00_release_td()
691 return ret; /* td wasn't created */ c67x00_add_data_urb()
811 struct c67x00_td *td, *ttd; c67x00_fill_frame() local
817 list_for_each_entry_safe(td, ttd, &c67x00->td_list, td_list) { c67x00_fill_frame()
818 dbg_td(c67x00, td, "Unprocessed td"); c67x00_fill_frame()
819 c67x00_release_td(td); c67x00_fill_frame()
843 c67x00_parse_td(struct c67x00_hcd *c67x00, struct c67x00_td *td) c67x00_parse_td() argument
846 td->td_addr, td, CY_TD_SIZE); c67x00_parse_td()
848 if (usb_pipein(td->pipe) && td_actual_bytes(td)) c67x00_parse_td()
849 c67x00_ll_read_mem_le16(c67x00->sie->dev, td_ly_base_addr(td), c67x00_parse_td()
850 td->data, td_actual_bytes(td)); c67x00_parse_td()
853 static int c67x00_td_to_error(struct c67x00_hcd *c67x00, struct c67x00_td *td) c67x00_td_to_error() argument
855 if (td->status & TD_STATUSMASK_ERR) { c67x00_td_to_error()
856 dbg_td(c67x00, td, "ERROR_FLAG"); c67x00_td_to_error()
859 if (td->status & TD_STATUSMASK_STALL) { c67x00_td_to_error()
860 /* dbg_td(c67x00, td, "STALL"); */ c67x00_td_to_error()
863 if (td->status & TD_STATUSMASK_TMOUT) { c67x00_td_to_error()
864 dbg_td(c67x00, td, "TIMEOUT"); c67x00_td_to_error()
871 static inline int c67x00_end_of_data(struct c67x00_td *td) c67x00_end_of_data() argument
874 struct urb *urb = td->urb; c67x00_end_of_data()
877 act_bytes = td_actual_bytes(td); c67x00_end_of_data()
882 maxps = usb_maxpacket(td_udev(td), td->pipe, usb_pipeout(td->pipe)); c67x00_end_of_data()
899 /* Remove all td's from the list which come
905 struct c67x00_td *td, *tmp; c67x00_clear_pipe() local
906 td = last_td; c67x00_clear_pipe()
908 while (td->td_list.next != &c67x00->td_list) { c67x00_clear_pipe()
909 td = list_entry(td->td_list.next, struct c67x00_td, td_list); c67x00_clear_pipe()
910 if (td->pipe == last_td->pipe) { c67x00_clear_pipe()
911 c67x00_release_td(td); c67x00_clear_pipe()
912 td = tmp; c67x00_clear_pipe()
914 tmp = td; c67x00_clear_pipe()
921 struct c67x00_td *td) c67x00_handle_successful_td()
923 struct urb *urb = td->urb; c67x00_handle_successful_td()
928 urb->actual_length += td_actual_bytes(td); c67x00_handle_successful_td()
930 switch (usb_pipetype(td->pipe)) { c67x00_handle_successful_td()
933 switch (td->privdata) { c67x00_handle_successful_td()
943 if (c67x00_end_of_data(td)) { c67x00_handle_successful_td()
945 c67x00_clear_pipe(c67x00, td); c67x00_handle_successful_td()
958 if (unlikely(c67x00_end_of_data(td))) { c67x00_handle_successful_td()
959 c67x00_clear_pipe(c67x00, td); c67x00_handle_successful_td()
966 static void c67x00_handle_isoc(struct c67x00_hcd *c67x00, struct c67x00_td *td) c67x00_handle_isoc() argument
968 struct urb *urb = td->urb; c67x00_handle_isoc()
976 cnt = td->privdata; c67x00_handle_isoc()
978 if (td->status & TD_ERROR_MASK) c67x00_handle_isoc()
981 urb->iso_frame_desc[cnt].actual_length = td_actual_bytes(td); c67x00_handle_isoc()
982 urb->iso_frame_desc[cnt].status = c67x00_td_to_error(c67x00, td); c67x00_handle_isoc()
995 struct c67x00_td *td, *tmp; c67x00_check_td_list() local
1000 list_for_each_entry_safe(td, tmp, &c67x00->td_list, td_list) { c67x00_check_td_list()
1002 c67x00_parse_td(c67x00, td); c67x00_check_td_list()
1003 urb = td->urb; /* urb can be NULL! */ c67x00_check_td_list()
1008 if (usb_pipeisoc(td->pipe)) { c67x00_check_td_list()
1010 c67x00_handle_isoc(c67x00, td); c67x00_check_td_list()
1014 /* When an error occurs, all td's for that pipe go into an c67x00_check_td_list()
1017 if (td->status & TD_ERROR_MASK) { c67x00_check_td_list()
1019 c67x00_td_to_error(c67x00, td)); c67x00_check_td_list()
1023 if ((td->status & TD_STATUSMASK_NAK) || !td_sequence_ok(td) || c67x00_check_td_list()
1024 !td_acked(td)) c67x00_check_td_list()
1030 if (unlikely(td->status & TD_STATUSMASK_OVF)) { c67x00_check_td_list()
1031 if (td_residue(td) & TD_RESIDUE_OVERFLOW) { c67x00_check_td_list()
1039 c67x00_handle_successful_td(c67x00, td); c67x00_check_td_list()
1043 c67x00_clear_pipe(c67x00, td); c67x00_check_td_list()
1045 usb_settoggle(td_udev(td), usb_pipeendpoint(td->pipe), c67x00_check_td_list()
1046 usb_pipeout(td->pipe), c67x00_check_td_list()
1047 !(td->ctrl_reg & SEQ_SEL)); c67x00_check_td_list()
1049 tmp = list_entry(td->td_list.next, typeof(*td), td_list); c67x00_check_td_list()
1050 c67x00_release_td(td); c67x00_check_td_list()
1065 * Send td to C67X00
1067 static void c67x00_send_td(struct c67x00_hcd *c67x00, struct c67x00_td *td) c67x00_send_td() argument
1069 int len = td_length(td); c67x00_send_td()
1071 if (len && ((td->pid_ep & TD_PIDEPMASK_PID) != TD_PID_IN)) c67x00_send_td()
1072 c67x00_ll_write_mem_le16(c67x00->sie->dev, td_ly_base_addr(td), c67x00_send_td()
1073 td->data, len); c67x00_send_td()
1076 td->td_addr, td, CY_TD_SIZE); c67x00_send_td()
1081 struct c67x00_td *td; c67x00_send_frame() local
1085 "%s: td list should not be empty here!\n", c67x00_send_frame()
1088 list_for_each_entry(td, &c67x00->td_list, td_list) { c67x00_send_frame()
1089 if (td->td_list.next == &c67x00->td_list) c67x00_send_frame()
1090 td->next_td_addr = 0; /* Last td in list */ c67x00_send_frame()
1092 c67x00_send_td(c67x00, td); c67x00_send_frame()
1112 /* no td's are being processed (current == 0) c67x00_do_work()
920 c67x00_handle_successful_td(struct c67x00_hcd *c67x00, struct c67x00_td *td) c67x00_handle_successful_td() argument
H A Dc67x00.h170 #define SIE_TD_SIZE 0x200 /* size of the td list */
/linux-4.4.14/tools/perf/bench/
H A Dsched-pipe.c57 struct thread_data *td = __tdata; worker_thread() local
62 if (!td->nr) { worker_thread()
63 ret = read(td->pipe_read, &m, sizeof(int)); worker_thread()
65 ret = write(td->pipe_write, &m, sizeof(int)); worker_thread()
68 ret = write(td->pipe_write, &m, sizeof(int)); worker_thread()
70 ret = read(td->pipe_read, &m, sizeof(int)); worker_thread()
80 struct thread_data threads[2], *td; bench_sched_pipe() local
103 td = threads + t; bench_sched_pipe()
105 td->nr = t; bench_sched_pipe()
108 td->pipe_read = pipe_1[0]; bench_sched_pipe()
109 td->pipe_write = pipe_2[1]; bench_sched_pipe()
111 td->pipe_write = pipe_1[1]; bench_sched_pipe()
112 td->pipe_read = pipe_2[0]; bench_sched_pipe()
120 td = threads + t; bench_sched_pipe()
122 ret = pthread_create(&td->pthread, NULL, worker_thread, td); bench_sched_pipe()
127 td = threads + t; bench_sched_pipe()
129 ret = pthread_join(td->pthread, NULL); bench_sched_pipe()
H A Dnuma.c439 struct thread_data *td; parse_setup_cpu_list() local
526 td = g->threads + t; parse_setup_cpu_list()
536 CPU_ZERO(&td->bind_cpumask); parse_setup_cpu_list()
539 CPU_SET(cpu, &td->bind_cpumask); parse_setup_cpu_list()
576 struct thread_data *td; parse_setup_node_list() local
648 td = g->threads + t; parse_setup_node_list()
655 td->bind_node = bind_node; parse_setup_node_list()
828 struct thread_data *td; count_process_nodes() local
833 td = g->threads + task_nr; count_process_nodes()
835 node = numa_node_of_cpu(td->curr_cpu); count_process_nodes()
864 struct thread_data *td; count_node_processes() local
869 td = g->threads + task_nr; count_node_processes()
871 n = numa_node_of_cpu(td->curr_cpu); count_node_processes()
936 struct thread_data *td = g->threads + t; calc_convergence() local
939 cpu = td->curr_cpu; calc_convergence()
949 loops_done = td->loops_done; calc_convergence()
1033 struct thread_data *td = __tdata; worker_thread() local
1035 int process_nr = td->process_nr; worker_thread()
1036 int thread_nr = td->thread_nr; worker_thread()
1038 int task_nr = td->task_nr; worker_thread()
1042 u64 val = td->val; worker_thread()
1052 bind_to_cpumask(td->bind_cpumask); worker_thread()
1053 bind_to_memnode(td->bind_node); worker_thread()
1058 process_data = td->process_data; worker_thread()
1108 pthread_mutex_lock(td->process_lock); worker_thread()
1110 pthread_mutex_unlock(td->process_lock); worker_thread()
1116 pthread_mutex_lock(td->process_lock); worker_thread()
1118 pthread_mutex_unlock(td->process_lock); worker_thread()
1130 td->loops_done = l; worker_thread()
1201 td->runtime_ns = diff.tv_sec * 1000000000ULL; worker_thread()
1202 td->runtime_ns += diff.tv_usec * 1000ULL; worker_thread()
1203 td->speed_gbs = bytes_done / (td->runtime_ns / 1e9) / 1e9; worker_thread()
1206 td->system_time_ns = rusage.ru_stime.tv_sec * 1000000000ULL; worker_thread()
1207 td->system_time_ns += rusage.ru_stime.tv_usec * 1000ULL; worker_thread()
1208 td->user_time_ns = rusage.ru_utime.tv_sec * 1000000000ULL; worker_thread()
1209 td->user_time_ns += rusage.ru_utime.tv_usec * 1000ULL; worker_thread()
1226 struct thread_data *td; worker_process() local
1241 td = g->threads + task_nr; worker_process()
1243 bind_to_memnode(td->bind_node); worker_process()
1244 bind_to_cpumask(td->bind_cpumask); worker_process()
1256 td = g->threads + task_nr; worker_process()
1258 td->process_data = process_data; worker_process()
1259 td->process_nr = process_nr; worker_process()
1260 td->thread_nr = t; worker_process()
1261 td->task_nr = task_nr; worker_process()
1262 td->val = rand(); worker_process()
1263 td->curr_cpu = -1; worker_process()
1264 td->process_lock = &process_lock; worker_process()
1266 ret = pthread_create(pthreads + t, NULL, worker_thread, td); worker_process()
1307 struct thread_data *td = g->threads + t; init_thread_data() local
1311 td->bind_node = -1; init_thread_data()
1314 CPU_ZERO(&td->bind_cpumask); init_thread_data()
1316 CPU_SET(cpu, &td->bind_cpumask); init_thread_data()
1574 struct thread_data *td; __bench_numa() local
1578 td = g->threads + p*g->p.nr_threads + t; __bench_numa()
1580 print_res(tname, td->speed_gbs, __bench_numa()
1582 print_res(tname, td->system_time_ns / 1e9, __bench_numa()
1584 print_res(tname, td->user_time_ns / 1e9, __bench_numa()
H A Dfutex-wake-parallel.c75 static void wakeup_threads(struct thread_data *td, pthread_attr_t thread_attr) wakeup_threads() argument
88 if (pthread_create(&td[i].worker, &thread_attr, wakeup_threads()
89 waking_workerfn, (void *)&td[i])) wakeup_threads()
94 if (pthread_join(td[i].worker, NULL)) wakeup_threads()
/linux-4.4.14/drivers/hid/
H A Dhid-multitouch.c127 static void mt_post_parse_default_settings(struct mt_device *td);
128 static void mt_post_parse(struct mt_device *td);
170 static int cypress_compute_slot(struct mt_device *td) cypress_compute_slot() argument
172 if (td->curdata.contactid != 0 || td->num_received == 0) cypress_compute_slot()
173 return td->curdata.contactid; cypress_compute_slot()
276 struct mt_device *td = hid_get_drvdata(hdev); mt_show_quirks() local
278 return sprintf(buf, "%u\n", td->mtclass.quirks); mt_show_quirks()
286 struct mt_device *td = hid_get_drvdata(hdev); mt_set_quirks() local
293 td->mtclass.quirks = val; mt_set_quirks()
295 if (td->cc_index < 0) mt_set_quirks()
296 td->mtclass.quirks &= ~MT_QUIRK_CONTACT_CNT_ACCURATE; mt_set_quirks()
314 struct mt_device *td = hid_get_drvdata(hdev); mt_get_feature() local
325 if (td->mtclass.name != MT_CLS_WIN_8) mt_get_feature()
350 struct mt_device *td = hid_get_drvdata(hdev); mt_feature_mapping() local
360 if (td->inputmode < 0) { mt_feature_mapping()
361 td->inputmode = field->report->id; mt_feature_mapping()
362 td->inputmode_index = usage->usage_index; mt_feature_mapping()
378 td->maxcontact_report_id = field->report->id; mt_feature_mapping()
379 td->maxcontacts = field->value[0]; mt_feature_mapping()
380 if (!td->maxcontacts && mt_feature_mapping()
382 td->maxcontacts = field->logical_maximum; mt_feature_mapping()
383 if (td->mtclass.maxcontacts) mt_feature_mapping()
385 td->maxcontacts = td->mtclass.maxcontacts; mt_feature_mapping()
396 td->is_buttonpad = true; mt_feature_mapping()
417 static void mt_store_field(struct hid_usage *usage, struct mt_device *td, mt_store_field() argument
420 struct mt_fields *f = td->fields; mt_store_field()
432 struct mt_device *td = hid_get_drvdata(hdev); mt_touch_input_mapping() local
433 struct mt_class *cls = &td->mtclass; mt_touch_input_mapping()
438 td->mt_flags |= INPUT_MT_DIRECT; mt_touch_input_mapping()
445 td->mt_flags |= INPUT_MT_POINTER; mt_touch_input_mapping()
446 td->inputmode_value = MT_INPUTMODE_TOUCHPAD; mt_touch_input_mapping()
451 td->buttons_count++; mt_touch_input_mapping()
473 mt_store_field(usage, td, hi); mt_touch_input_mapping()
488 mt_store_field(usage, td, hi); mt_touch_input_mapping()
502 mt_store_field(usage, td, hi); mt_touch_input_mapping()
505 mt_store_field(usage, td, hi); mt_touch_input_mapping()
510 mt_store_field(usage, td, hi); mt_touch_input_mapping()
513 mt_store_field(usage, td, hi); mt_touch_input_mapping()
514 td->touches_by_report++; mt_touch_input_mapping()
515 td->mt_report_id = field->report->id; mt_touch_input_mapping()
523 mt_store_field(usage, td, hi); mt_touch_input_mapping()
534 mt_store_field(usage, td, hi); mt_touch_input_mapping()
541 mt_store_field(usage, td, hi); mt_touch_input_mapping()
548 td->cc_index = field->index; mt_touch_input_mapping()
549 td->cc_value_index = usage->usage_index; mt_touch_input_mapping()
552 /* we don't set td->last_slot_field as contactcount and mt_touch_input_mapping()
587 static int mt_compute_slot(struct mt_device *td, struct input_dev *input) mt_compute_slot() argument
589 __s32 quirks = td->mtclass.quirks; mt_compute_slot()
592 return td->curdata.contactid; mt_compute_slot()
595 return cypress_compute_slot(td); mt_compute_slot()
598 return td->num_received; mt_compute_slot()
601 return td->curdata.contactid - 1; mt_compute_slot()
603 return input_mt_get_slot_by_key(input, td->curdata.contactid); mt_compute_slot()
610 static void mt_complete_slot(struct mt_device *td, struct input_dev *input) mt_complete_slot() argument
612 if ((td->mtclass.quirks & MT_QUIRK_CONTACT_CNT_ACCURATE) && mt_complete_slot()
613 td->num_received >= td->num_expected) mt_complete_slot()
616 if (td->curvalid || (td->mtclass.quirks & MT_QUIRK_ALWAYS_VALID)) { mt_complete_slot()
617 int slotnum = mt_compute_slot(td, input); mt_complete_slot()
618 struct mt_slot *s = &td->curdata; mt_complete_slot()
621 if (slotnum < 0 || slotnum >= td->maxcontacts) mt_complete_slot()
624 if ((td->mtclass.quirks & MT_QUIRK_IGNORE_DUPLICATES) && mt) { mt_complete_slot()
654 td->num_received++; mt_complete_slot()
661 static void mt_sync_frame(struct mt_device *td, struct input_dev *input) mt_sync_frame() argument
665 td->num_received = 0; mt_sync_frame()
681 struct mt_device *td = hid_get_drvdata(hid); mt_process_mt_event() local
682 __s32 quirks = td->mtclass.quirks; mt_process_mt_event()
689 td->curvalid = value; mt_process_mt_event()
691 td->curdata.inrange_state = value; mt_process_mt_event()
695 td->curvalid = value; mt_process_mt_event()
696 td->curdata.touch_state = value; mt_process_mt_event()
700 td->curvalid = value; mt_process_mt_event()
703 td->curdata.contactid = value; mt_process_mt_event()
706 td->curdata.p = value; mt_process_mt_event()
710 td->curdata.cx = value; mt_process_mt_event()
712 td->curdata.x = value; mt_process_mt_event()
716 td->curdata.cy = value; mt_process_mt_event()
718 td->curdata.y = value; mt_process_mt_event()
721 td->curdata.w = value; mt_process_mt_event()
724 td->curdata.h = value; mt_process_mt_event()
741 if (usage->hid == td->last_slot_field) mt_process_mt_event()
742 mt_complete_slot(td, field->hidinput->input); mt_process_mt_event()
750 struct mt_device *td = hid_get_drvdata(hid); mt_touch_report() local
759 if (td->cc_index >= 0) { mt_touch_report()
760 struct hid_field *field = report->field[td->cc_index]; mt_touch_report()
761 int value = field->value[td->cc_value_index]; mt_touch_report()
763 td->num_expected = value; mt_touch_report()
778 if (td->num_received >= td->num_expected) mt_touch_report()
779 mt_sync_frame(td, report->field[0]->hidinput->input); mt_touch_report()
785 struct mt_device *td = hid_get_drvdata(hdev); mt_touch_input_configured() local
786 struct mt_class *cls = &td->mtclass; mt_touch_input_configured()
790 if (!td->maxcontacts) mt_touch_input_configured()
791 td->maxcontacts = MT_DEFAULT_MAXCONTACT; mt_touch_input_configured()
793 mt_post_parse(td); mt_touch_input_configured()
794 if (td->serial_maybe) mt_touch_input_configured()
795 mt_post_parse_default_settings(td); mt_touch_input_configured()
798 td->mt_flags |= INPUT_MT_POINTER; mt_touch_input_configured()
801 td->mt_flags |= INPUT_MT_DROP_UNUSED; mt_touch_input_configured()
804 if ((td->mt_flags & INPUT_MT_POINTER) && (td->buttons_count == 1)) mt_touch_input_configured()
805 td->is_buttonpad = true; mt_touch_input_configured()
807 if (td->is_buttonpad) mt_touch_input_configured()
810 ret = input_mt_init_slots(input, td->maxcontacts, td->mt_flags); mt_touch_input_configured()
814 td->mt_flags = 0; mt_touch_input_configured()
822 struct mt_device *td = hid_get_drvdata(hdev); mt_input_mapping() local
830 if (!td->mtclass.export_all_inputs && mt_input_mapping()
846 (field->report->id != td->mt_report_id) && mt_input_mapping()
847 (td->mt_report_id != -1)) mt_input_mapping()
880 struct mt_device *td = hid_get_drvdata(hid); mt_event() local
882 if (field->report->id == td->mt_report_id) mt_event()
890 struct mt_device *td = hid_get_drvdata(hid); mt_report() local
896 if (report->id == td->mt_report_id) mt_report()
905 struct mt_device *td = hid_get_drvdata(hdev); mt_set_input_mode() local
908 struct mt_class *cls = &td->mtclass; mt_set_input_mode()
912 if (td->inputmode < 0) mt_set_input_mode()
916 r = re->report_id_hash[td->inputmode]; mt_set_input_mode()
930 r->field[0]->value[td->inputmode_index] = td->inputmode_value; mt_set_input_mode()
937 struct mt_device *td = hid_get_drvdata(hdev); mt_set_maxcontacts() local
942 if (td->maxcontact_report_id < 0) mt_set_maxcontacts()
945 if (!td->mtclass.maxcontacts) mt_set_maxcontacts()
949 r = re->report_id_hash[td->maxcontact_report_id]; mt_set_maxcontacts()
951 max = td->mtclass.maxcontacts; mt_set_maxcontacts()
961 static void mt_post_parse_default_settings(struct mt_device *td) mt_post_parse_default_settings() argument
963 __s32 quirks = td->mtclass.quirks; mt_post_parse_default_settings()
966 if (td->touches_by_report == 1) { mt_post_parse_default_settings()
974 td->mtclass.quirks = quirks; mt_post_parse_default_settings()
977 static void mt_post_parse(struct mt_device *td) mt_post_parse() argument
979 struct mt_fields *f = td->fields; mt_post_parse()
980 struct mt_class *cls = &td->mtclass; mt_post_parse()
982 if (td->touches_by_report > 0) { mt_post_parse()
983 int field_count_per_touch = f->length / td->touches_by_report; mt_post_parse()
984 td->last_slot_field = f->usages[field_count_per_touch - 1]; mt_post_parse()
987 if (td->cc_index < 0) mt_post_parse()
993 struct mt_device *td = hid_get_drvdata(hdev); mt_input_configured() local
999 if (hi->report->id == td->mt_report_id) { mt_input_configured()
1064 struct mt_device *td; mt_probe() local
1104 td = devm_kzalloc(&hdev->dev, sizeof(struct mt_device), GFP_KERNEL); mt_probe()
1105 if (!td) { mt_probe()
1109 td->mtclass = *mtclass; mt_probe()
1110 td->inputmode = -1; mt_probe()
1111 td->maxcontact_report_id = -1; mt_probe()
1112 td->inputmode_value = MT_INPUTMODE_TOUCHSCREEN; mt_probe()
1113 td->cc_index = -1; mt_probe()
1114 td->mt_report_id = -1; mt_probe()
1115 hid_set_drvdata(hdev, td); mt_probe()
1117 td->fields = devm_kzalloc(&hdev->dev, sizeof(struct mt_fields), mt_probe()
1119 if (!td->fields) { mt_probe()
1125 td->serial_maybe = true; mt_probe()
1141 devm_kfree(&hdev->dev, td->fields); mt_probe()
1142 td->fields = NULL; mt_probe()
/linux-4.4.14/tools/perf/tests/
H A Dmmap-thread-lookup.c28 static int thread_init(struct thread_data *td) thread_init() argument
41 td->map = map; thread_init()
42 td->tid = syscall(SYS_gettid); thread_init()
44 pr_debug("tid = %d, map = %p\n", td->tid, map); thread_init()
50 struct thread_data *td = arg; thread_fn() local
54 if (thread_init(td)) thread_fn()
58 ret = write(td->ready[1], &go, sizeof(int)); thread_fn()
69 munmap(td->map, page_size); thread_fn()
75 struct thread_data *td = &threads[i]; thread_create() local
78 if (pipe(td->ready)) thread_create()
81 err = pthread_create(&td->pt, NULL, thread_fn, td); thread_create()
84 ssize_t ret = read(td->ready[0], &go, sizeof(int)); thread_create()
88 close(td->ready[0]); thread_create()
89 close(td->ready[1]); thread_create()
182 struct thread_data *td = &threads[i]; mmap_events() local
186 thread = machine__findnew_thread(machine, getpid(), td->tid); mmap_events()
188 pr_debug("looking for map %p\n", td->map); mmap_events()
192 (unsigned long) (td->map + 1), &al); mmap_events()
/linux-4.4.14/drivers/scsi/snic/
H A Dsnic_trc.c33 struct snic_trc_data *td = NULL; snic_get_trc_buf() local
37 td = &trc->buf[trc->wr_idx]; snic_get_trc_buf()
53 td->ts = 0; /* Marker for checking the record, for complete data*/ snic_get_trc_buf()
58 return td; snic_get_trc_buf()
65 snic_fmt_trc_data(struct snic_trc_data *td, char *buf, int buf_sz) snic_fmt_trc_data() argument
70 jiffies_to_timespec(td->ts, &tmspec); snic_fmt_trc_data()
76 td->fn, snic_fmt_trc_data()
77 td->hno, snic_fmt_trc_data()
78 td->tag, snic_fmt_trc_data()
79 td->data[0], td->data[1], td->data[2], td->data[3], snic_fmt_trc_data()
80 td->data[4]); snic_fmt_trc_data()
91 struct snic_trc_data *td = NULL; snic_get_trc_data() local
101 td = &trc->buf[trc->rd_idx]; snic_get_trc_data()
103 if (td->ts == 0) { snic_get_trc_data()
115 return snic_fmt_trc_data(td, buf, buf_sz); snic_get_trc_data()
/linux-4.4.14/drivers/mtd/nand/
H A Dnand_bbt.c95 static int check_pattern_no_oob(uint8_t *buf, struct nand_bbt_descr *td) check_pattern_no_oob() argument
97 if (memcmp(buf, td->pattern, td->len)) check_pattern_no_oob()
107 * @td: search pattern descriptor
112 static int check_pattern(uint8_t *buf, int len, int paglen, struct nand_bbt_descr *td) check_pattern() argument
114 if (td->options & NAND_BBT_NO_OOB) check_pattern()
115 return check_pattern_no_oob(buf, td); check_pattern()
118 if (memcmp(buf + paglen + td->offs, td->pattern, td->len)) check_pattern()
127 * @td: search pattern descriptor
133 static int check_short_pattern(uint8_t *buf, struct nand_bbt_descr *td) check_short_pattern() argument
136 if (memcmp(buf + td->offs, td->pattern, td->len)) check_short_pattern()
143 * @td: BBT descriptor used for computation
147 static u32 add_marker_len(struct nand_bbt_descr *td) add_marker_len() argument
151 if (!(td->options & NAND_BBT_NO_OOB)) add_marker_len()
154 len = td->len; add_marker_len()
155 if (td->options & NAND_BBT_VERSION) add_marker_len()
166 * @td: the bbt describtion table
172 struct nand_bbt_descr *td, int offs) read_bbt()
178 int bits = td->options & NAND_BBT_NRBITS_MSK; read_bbt()
181 int reserved_block_code = td->reserved_block_code; read_bbt()
184 marker_len = add_marker_len(td); read_bbt()
257 * @td: descriptor for the bad block table
264 static int read_abs_bbt(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_descr *td, int chip) read_abs_bbt() argument
269 if (td->options & NAND_BBT_PERCHIP) { read_abs_bbt()
273 res = read_bbt(mtd, buf, td->pages[i], read_abs_bbt()
275 td, offs); read_abs_bbt()
281 res = read_bbt(mtd, buf, td->pages[0], read_abs_bbt()
282 mtd->size >> this->bbt_erase_shift, td, 0); read_abs_bbt()
291 struct nand_bbt_descr *td) scan_read_data()
296 len = td->len; scan_read_data()
297 if (td->options & NAND_BBT_VERSION) scan_read_data()
345 size_t len, struct nand_bbt_descr *td) scan_read()
347 if (td->options & NAND_BBT_NO_OOB) scan_read()
348 return scan_read_data(mtd, buf, offs, td); scan_read()
369 static u32 bbt_get_ver_offs(struct mtd_info *mtd, struct nand_bbt_descr *td) bbt_get_ver_offs() argument
371 u32 ver_offs = td->veroffs; bbt_get_ver_offs()
373 if (!(td->options & NAND_BBT_NO_OOB)) bbt_get_ver_offs()
382 * @td: descriptor for the bad block table
389 struct nand_bbt_descr *td, struct nand_bbt_descr *md) read_abs_bbts()
394 if (td->options & NAND_BBT_VERSION) { read_abs_bbts()
395 scan_read(mtd, buf, (loff_t)td->pages[0] << this->page_shift, read_abs_bbts()
396 mtd->writesize, td); read_abs_bbts()
397 td->version[0] = buf[bbt_get_ver_offs(mtd, td)]; read_abs_bbts()
399 td->pages[0], td->version[0]); read_abs_bbts()
513 * @td: descriptor for the bad block table
524 static int search_bbt(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_descr *td) search_bbt() argument
534 if (td->options & NAND_BBT_LASTBLOCK) { search_bbt()
543 if (td->options & NAND_BBT_PERCHIP) { search_bbt()
554 td->version[i] = 0; search_bbt()
555 td->pages[i] = -1; search_bbt()
557 for (block = 0; block < td->maxblocks; block++) { search_bbt()
563 scan_read(mtd, buf, offs, mtd->writesize, td); search_bbt()
564 if (!check_pattern(buf, scanlen, mtd->writesize, td)) { search_bbt()
565 td->pages[i] = actblock << blocktopage; search_bbt()
566 if (td->options & NAND_BBT_VERSION) { search_bbt()
567 offs = bbt_get_ver_offs(mtd, td); search_bbt()
568 td->version[i] = buf[offs]; search_bbt()
577 if (td->pages[i] == -1) search_bbt()
581 td->pages[i], td->version[i]); search_bbt()
590 * @td: descriptor for the bad block table
596 struct nand_bbt_descr *td, search_read_bbts()
600 search_bbt(mtd, buf, td); search_read_bbts()
611 * @td: descriptor for the bad block table
618 struct nand_bbt_descr *td, struct nand_bbt_descr *md, write_bbt()
627 uint8_t rcode = td->reserved_block_code; write_bbt()
640 if (td->options & NAND_BBT_PERCHIP) { write_bbt()
659 * page nr. in td->pages. write_bbt()
661 if (td->pages[chip] != -1) { write_bbt()
662 page = td->pages[chip]; write_bbt()
670 if (td->options & NAND_BBT_LASTBLOCK) { write_bbt()
678 for (i = 0; i < td->maxblocks; i++) { write_bbt()
697 bits = td->options & NAND_BBT_NRBITS_MSK; write_bbt()
718 if (td->options & NAND_BBT_SAVECONTENT) { write_bbt()
744 } else if (td->options & NAND_BBT_NO_OOB) { write_bbt()
746 offs = td->len; write_bbt()
748 if (td->options & NAND_BBT_VERSION) write_bbt()
758 memcpy(buf, td->pattern, td->len); write_bbt()
770 memcpy(&buf[ooboffs + td->offs], td->pattern, td->len); write_bbt()
773 if (td->options & NAND_BBT_VERSION) write_bbt()
774 buf[ooboffs + td->veroffs] = td->version[chip]; write_bbt()
794 td->options & NAND_BBT_NO_OOB ? NULL : write_bbt()
800 (unsigned long long)to, td->version[chip]); write_bbt()
803 td->pages[chip] = page; write_bbt()
842 struct nand_bbt_descr *td = this->bbt_td; check_create() local
847 if (td->options & NAND_BBT_PERCHIP) check_create()
859 chipsel = (td->options & NAND_BBT_PERCHIP) ? i : -1; check_create()
862 if (td->pages[i] == -1 && md->pages[i] == -1) { check_create()
865 } else if (td->pages[i] == -1) { check_create()
869 rd = td; check_create()
871 } else if (td->version[i] == md->version[i]) { check_create()
872 rd = td; check_create()
873 if (!(td->options & NAND_BBT_VERSION)) check_create()
875 } else if (((int8_t)(td->version[i] - md->version[i])) > 0) { check_create()
876 rd = td; check_create()
883 if (td->pages[i] == -1) { check_create()
887 rd = td; check_create()
893 if (!(td->options & NAND_BBT_CREATE)) check_create()
900 td->version[i] = 1; check_create()
934 td->version[i] = max(td->version[i], md->version[i]); check_create()
935 md->version[i] = td->version[i]; check_create()
939 if ((writeops & 0x01) && (td->options & NAND_BBT_WRITE)) { check_create()
940 res = write_bbt(mtd, buf, td, md, chipsel); check_create()
947 res = write_bbt(mtd, buf, md, td, chipsel); check_create()
958 * @td: bad block table descriptor
963 static void mark_bbt_region(struct mtd_info *mtd, struct nand_bbt_descr *td) mark_bbt_region() argument
970 if (td->options & NAND_BBT_PERCHIP) { mark_bbt_region()
979 if ((td->options & NAND_BBT_ABSPAGE) || mark_bbt_region()
980 !(td->options & NAND_BBT_WRITE)) { mark_bbt_region()
981 if (td->pages[i] == -1) mark_bbt_region()
983 block = td->pages[i] >> (this->bbt_erase_shift - this->page_shift); mark_bbt_region()
987 td->reserved_block_code) mark_bbt_region()
993 if (td->options & NAND_BBT_LASTBLOCK) mark_bbt_region()
994 block = ((i + 1) * nrblocks) - td->maxblocks; mark_bbt_region()
997 for (j = 0; j < td->maxblocks; j++) { mark_bbt_region()
1009 if (update && td->reserved_block_code) mark_bbt_region()
1080 struct nand_bbt_descr *td = this->bbt_td; nand_scan_bbt() local
1096 if (!td) { nand_scan_bbt()
1103 verify_bbt_descr(mtd, td); nand_scan_bbt()
1116 if (td->options & NAND_BBT_ABSPAGE) { nand_scan_bbt()
1117 read_abs_bbts(mtd, buf, td, md); nand_scan_bbt()
1120 search_read_bbts(mtd, buf, td, md); nand_scan_bbt()
1128 mark_bbt_region(mtd, td); nand_scan_bbt()
1154 struct nand_bbt_descr *td = this->bbt_td; nand_update_bbt() local
1157 if (!this->bbt || !td) nand_update_bbt()
1168 if (td->options & NAND_BBT_PERCHIP) { nand_update_bbt()
1176 td->version[chip]++; nand_update_bbt()
1181 if (td->options & NAND_BBT_WRITE) { nand_update_bbt()
1182 res = write_bbt(mtd, buf, td, md, chipsel); nand_update_bbt()
1188 res = write_bbt(mtd, buf, md, td, chipsel); nand_update_bbt()
171 read_bbt(struct mtd_info *mtd, uint8_t *buf, int page, int num, struct nand_bbt_descr *td, int offs) read_bbt() argument
290 scan_read_data(struct mtd_info *mtd, uint8_t *buf, loff_t offs, struct nand_bbt_descr *td) scan_read_data() argument
344 scan_read(struct mtd_info *mtd, uint8_t *buf, loff_t offs, size_t len, struct nand_bbt_descr *td) scan_read() argument
388 read_abs_bbts(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_descr *td, struct nand_bbt_descr *md) read_abs_bbts() argument
595 search_read_bbts(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_descr *td, struct nand_bbt_descr *md) search_read_bbts() argument
617 write_bbt(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_descr *td, struct nand_bbt_descr *md, int chipsel) write_bbt() argument
/linux-4.4.14/drivers/base/power/
H A Ddomain_governor.c20 constraint_ns = dev_gpd_data(dev)->td.effective_constraint_ns; dev_update_qos_constraint()
45 struct gpd_timing_data *td = &dev_gpd_data(dev)->td; default_stop_ok() local
53 if (!td->constraint_changed) { default_stop_ok()
54 bool ret = td->cached_stop_ok; default_stop_ok()
59 td->constraint_changed = false; default_stop_ok()
60 td->cached_stop_ok = false; default_stop_ok()
61 td->effective_constraint_ns = -1; default_stop_ok()
80 constraint_ns -= td->suspend_latency_ns + default_stop_ok()
81 td->resume_latency_ns; default_stop_ok()
85 td->effective_constraint_ns = constraint_ns; default_stop_ok()
86 td->cached_stop_ok = constraint_ns >= 0; default_stop_ok()
92 return td->cached_stop_ok; default_stop_ok()
160 struct gpd_timing_data *td; default_power_down_ok() local
168 td = &to_gpd_data(pdd)->td; default_power_down_ok()
169 constraint_ns = td->effective_constraint_ns; default_power_down_ok()
H A Ddomain.c267 to_gpd_data(pdd)->td.constraint_changed = true; genpd_dev_pm_qos_notifier()
392 struct gpd_timing_data *td = &dev_gpd_data(dev)->td; pm_genpd_runtime_suspend() local
431 if (elapsed_ns > td->suspend_latency_ns) { pm_genpd_runtime_suspend()
432 td->suspend_latency_ns = elapsed_ns; pm_genpd_runtime_suspend()
436 td->constraint_changed = true; pm_genpd_runtime_suspend()
465 struct gpd_timing_data *td = &dev_gpd_data(dev)->td; pm_genpd_runtime_resume() local
502 if (elapsed_ns > td->resume_latency_ns) { pm_genpd_runtime_resume()
503 td->resume_latency_ns = elapsed_ns; pm_genpd_runtime_resume()
507 td->constraint_changed = true; pm_genpd_runtime_resume()
1160 struct gpd_timing_data *td) genpd_alloc_dev_data()
1175 if (td) genpd_alloc_dev_data()
1176 gpd_data->td = *td; genpd_alloc_dev_data()
1179 gpd_data->td.constraint_changed = true; genpd_alloc_dev_data()
1180 gpd_data->td.effective_constraint_ns = -1; genpd_alloc_dev_data()
1223 * @td: Set of PM QoS timing parameters to attach to the device.
1226 struct gpd_timing_data *td) __pm_genpd_add_device()
1236 gpd_data = genpd_alloc_dev_data(dev, genpd, td); __pm_genpd_add_device()
1158 genpd_alloc_dev_data(struct device *dev, struct generic_pm_domain *genpd, struct gpd_timing_data *td) genpd_alloc_dev_data() argument
1225 __pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev, struct gpd_timing_data *td) __pm_genpd_add_device() argument
/linux-4.4.14/drivers/md/
H A Ddm-thin-metadata.c742 struct dm_thin_device *td, *tmp; __write_changed_details() local
746 list_for_each_entry_safe(td, tmp, &pmd->thin_devices, list) { __write_changed_details()
747 if (!td->changed) __write_changed_details()
750 key = td->id; __write_changed_details()
752 details.mapped_blocks = cpu_to_le64(td->mapped_blocks); __write_changed_details()
753 details.transaction_id = cpu_to_le64(td->transaction_id); __write_changed_details()
754 details.creation_time = cpu_to_le32(td->creation_time); __write_changed_details()
755 details.snapshotted_time = cpu_to_le32(td->snapshotted_time); __write_changed_details()
763 if (td->open_count) __write_changed_details()
764 td->changed = 0; __write_changed_details()
766 list_del(&td->list); __write_changed_details()
767 kfree(td); __write_changed_details()
866 struct dm_thin_device *td, *tmp; dm_pool_metadata_close() local
869 list_for_each_entry_safe(td, tmp, &pmd->thin_devices, list) { dm_pool_metadata_close()
870 if (td->open_count) dm_pool_metadata_close()
873 list_del(&td->list); dm_pool_metadata_close()
874 kfree(td); dm_pool_metadata_close()
900 * __open_device: Returns @td corresponding to device with id @dev,
901 * creating it if @create is set and incrementing @td->open_count.
902 * On failure, @td is undefined.
906 struct dm_thin_device **td) __open_device()
925 *td = td2; __open_device()
948 *td = kmalloc(sizeof(**td), GFP_NOIO); __open_device()
949 if (!*td) __open_device()
952 (*td)->pmd = pmd; __open_device()
953 (*td)->id = dev; __open_device()
954 (*td)->open_count = 1; __open_device()
955 (*td)->changed = changed; __open_device()
956 (*td)->aborted_with_changes = false; __open_device()
957 (*td)->mapped_blocks = le64_to_cpu(details_le.mapped_blocks); __open_device()
958 (*td)->transaction_id = le64_to_cpu(details_le.transaction_id); __open_device()
959 (*td)->creation_time = le32_to_cpu(details_le.creation_time); __open_device()
960 (*td)->snapshotted_time = le32_to_cpu(details_le.snapshotted_time); __open_device()
962 list_add(&(*td)->list, &pmd->thin_devices); __open_device()
967 static void __close_device(struct dm_thin_device *td) __close_device() argument
969 --td->open_count; __close_device()
979 struct dm_thin_device *td; __create_thin() local
1005 r = __open_device(pmd, dev, 1, &td); __create_thin()
1011 __close_device(td); __create_thin()
1033 struct dm_thin_device *td; __set_snapshot_details() local
1035 r = __open_device(pmd, origin, 0, &td); __set_snapshot_details()
1039 td->changed = 1; __set_snapshot_details()
1040 td->snapshotted_time = time; __set_snapshot_details()
1042 snap->mapped_blocks = td->mapped_blocks; __set_snapshot_details()
1044 __close_device(td); __set_snapshot_details()
1055 struct dm_thin_device *td; __create_snap() local
1086 r = __open_device(pmd, dev, 1, &td); __create_snap()
1090 r = __set_snapshot_details(pmd, td, origin, pmd->time); __create_snap()
1091 __close_device(td); __create_snap()
1123 struct dm_thin_device *td; __delete_device() local
1126 r = __open_device(pmd, dev, 0, &td); __delete_device()
1130 if (td->open_count > 1) { __delete_device()
1131 __close_device(td); __delete_device()
1135 list_del(&td->list); __delete_device()
1136 kfree(td); __delete_device()
1361 struct dm_thin_device **td) dm_pool_open_thin_device()
1367 r = __open_device(pmd, dev, 0, td); dm_pool_open_thin_device()
1373 int dm_pool_close_thin_device(struct dm_thin_device *td) dm_pool_close_thin_device() argument
1375 down_write(&td->pmd->root_lock); dm_pool_close_thin_device()
1376 __close_device(td); dm_pool_close_thin_device()
1377 up_write(&td->pmd->root_lock); dm_pool_close_thin_device()
1382 dm_thin_id dm_thin_dev_id(struct dm_thin_device *td) dm_thin_dev_id() argument
1384 return td->id; dm_thin_dev_id()
1388 * Check whether @time (of block creation) is older than @td's last snapshot.
1393 static bool __snapshotted_since(struct dm_thin_device *td, uint32_t time) __snapshotted_since() argument
1395 return td->snapshotted_time > time; __snapshotted_since()
1398 int dm_thin_find_block(struct dm_thin_device *td, dm_block_t block, dm_thin_find_block() argument
1403 struct dm_pool_metadata *pmd = td->pmd; dm_thin_find_block()
1404 dm_block_t keys[2] = { td->id, block }; dm_thin_find_block()
1428 result->shared = __snapshotted_since(td, exception_time); dm_thin_find_block()
1436 int dm_thin_find_mapped_range(struct dm_thin_device *td, dm_thin_find_mapped_range() argument
1452 r = dm_thin_find_block(td, begin, true, &lookup); dm_thin_find_mapped_range()
1472 r = dm_thin_find_block(td, begin, true, &lookup); dm_thin_find_mapped_range()
1492 static int __insert(struct dm_thin_device *td, dm_block_t block, __insert() argument
1497 struct dm_pool_metadata *pmd = td->pmd; __insert()
1498 dm_block_t keys[2] = { td->id, block }; __insert()
1508 td->changed = 1; __insert()
1510 td->mapped_blocks++; __insert()
1515 int dm_thin_insert_block(struct dm_thin_device *td, dm_block_t block, dm_thin_insert_block() argument
1520 down_write(&td->pmd->root_lock); dm_thin_insert_block()
1521 if (!td->pmd->fail_io) dm_thin_insert_block()
1522 r = __insert(td, block, data_block); dm_thin_insert_block()
1523 up_write(&td->pmd->root_lock); dm_thin_insert_block()
1528 static int __remove(struct dm_thin_device *td, dm_block_t block) __remove() argument
1531 struct dm_pool_metadata *pmd = td->pmd; __remove()
1532 dm_block_t keys[2] = { td->id, block }; __remove()
1538 td->mapped_blocks--; __remove()
1539 td->changed = 1; __remove()
1544 static int __remove_range(struct dm_thin_device *td, dm_block_t begin, dm_block_t end) __remove_range() argument
1548 struct dm_pool_metadata *pmd = td->pmd; __remove_range()
1549 dm_block_t keys[1] = { td->id }; __remove_range()
1592 td->mapped_blocks -= total_count; __remove_range()
1593 td->changed = 1; __remove_range()
1603 int dm_thin_remove_block(struct dm_thin_device *td, dm_block_t block) dm_thin_remove_block() argument
1607 down_write(&td->pmd->root_lock); dm_thin_remove_block()
1608 if (!td->pmd->fail_io) dm_thin_remove_block()
1609 r = __remove(td, block); dm_thin_remove_block()
1610 up_write(&td->pmd->root_lock); dm_thin_remove_block()
1615 int dm_thin_remove_range(struct dm_thin_device *td, dm_thin_remove_range() argument
1620 down_write(&td->pmd->root_lock); dm_thin_remove_range()
1621 if (!td->pmd->fail_io) dm_thin_remove_range()
1622 r = __remove_range(td, begin, end); dm_thin_remove_range()
1623 up_write(&td->pmd->root_lock); dm_thin_remove_range()
1642 bool dm_thin_changed_this_transaction(struct dm_thin_device *td) dm_thin_changed_this_transaction() argument
1646 down_read(&td->pmd->root_lock); dm_thin_changed_this_transaction()
1647 r = td->changed; dm_thin_changed_this_transaction()
1648 up_read(&td->pmd->root_lock); dm_thin_changed_this_transaction()
1656 struct dm_thin_device *td, *tmp; dm_pool_changed_this_transaction() local
1659 list_for_each_entry_safe(td, tmp, &pmd->thin_devices, list) { dm_pool_changed_this_transaction()
1660 if (td->changed) { dm_pool_changed_this_transaction()
1661 r = td->changed; dm_pool_changed_this_transaction()
1670 bool dm_thin_aborted_changes(struct dm_thin_device *td) dm_thin_aborted_changes() argument
1674 down_read(&td->pmd->root_lock); dm_thin_aborted_changes()
1675 r = td->aborted_with_changes; dm_thin_aborted_changes()
1676 up_read(&td->pmd->root_lock); dm_thin_aborted_changes()
1716 struct dm_thin_device *td; __set_abort_with_changes_flags() local
1718 list_for_each_entry(td, &pmd->thin_devices, list) __set_abort_with_changes_flags()
1719 td->aborted_with_changes = td->changed; __set_abort_with_changes_flags()
1792 int dm_thin_get_mapped_count(struct dm_thin_device *td, dm_block_t *result) dm_thin_get_mapped_count() argument
1795 struct dm_pool_metadata *pmd = td->pmd; dm_thin_get_mapped_count()
1799 *result = td->mapped_blocks; dm_thin_get_mapped_count()
1807 static int __highest_block(struct dm_thin_device *td, dm_block_t *result) __highest_block() argument
1812 struct dm_pool_metadata *pmd = td->pmd; __highest_block()
1814 r = dm_btree_lookup(&pmd->tl_info, pmd->root, &td->id, &value_le); __highest_block()
1823 int dm_thin_get_highest_mapped_block(struct dm_thin_device *td, dm_thin_get_highest_mapped_block() argument
1827 struct dm_pool_metadata *pmd = td->pmd; dm_thin_get_highest_mapped_block()
1831 r = __highest_block(td, result); dm_thin_get_highest_mapped_block()
904 __open_device(struct dm_pool_metadata *pmd, dm_thin_id dev, int create, struct dm_thin_device **td) __open_device() argument
1360 dm_pool_open_thin_device(struct dm_pool_metadata *pmd, dm_thin_id dev, struct dm_thin_device **td) dm_pool_open_thin_device() argument
H A Ddm-thin-metadata.h129 struct dm_thin_device **td);
131 int dm_pool_close_thin_device(struct dm_thin_device *td);
133 dm_thin_id dm_thin_dev_id(struct dm_thin_device *td);
146 int dm_thin_find_block(struct dm_thin_device *td, dm_block_t block,
153 int dm_thin_find_mapped_range(struct dm_thin_device *td,
166 int dm_thin_insert_block(struct dm_thin_device *td, dm_block_t block,
169 int dm_thin_remove_block(struct dm_thin_device *td, dm_block_t block);
170 int dm_thin_remove_range(struct dm_thin_device *td,
176 bool dm_thin_changed_this_transaction(struct dm_thin_device *td);
180 bool dm_thin_aborted_changes(struct dm_thin_device *td);
182 int dm_thin_get_highest_mapped_block(struct dm_thin_device *td,
185 int dm_thin_get_mapped_count(struct dm_thin_device *td, dm_block_t *result);
H A Ddm.c774 static int open_table_device(struct table_device *td, dev_t dev, open_table_device() argument
782 BUG_ON(td->dm_dev.bdev); open_table_device()
784 bdev = blkdev_get_by_dev(dev, td->dm_dev.mode | FMODE_EXCL, _claim_ptr); open_table_device()
790 blkdev_put(bdev, td->dm_dev.mode | FMODE_EXCL); open_table_device()
794 td->dm_dev.bdev = bdev; open_table_device()
801 static void close_table_device(struct table_device *td, struct mapped_device *md) close_table_device() argument
803 if (!td->dm_dev.bdev) close_table_device()
806 bd_unlink_disk_holder(td->dm_dev.bdev, dm_disk(md)); close_table_device()
807 blkdev_put(td->dm_dev.bdev, td->dm_dev.mode | FMODE_EXCL); close_table_device()
808 td->dm_dev.bdev = NULL; close_table_device()
813 struct table_device *td; find_table_device() local
815 list_for_each_entry(td, l, list) find_table_device()
816 if (td->dm_dev.bdev->bd_dev == dev && td->dm_dev.mode == mode) find_table_device()
817 return td; find_table_device()
825 struct table_device *td; dm_get_table_device() local
828 td = find_table_device(&md->table_devices, dev, mode); dm_get_table_device()
829 if (!td) { dm_get_table_device()
830 td = kmalloc(sizeof(*td), GFP_KERNEL); dm_get_table_device()
831 if (!td) { dm_get_table_device()
836 td->dm_dev.mode = mode; dm_get_table_device()
837 td->dm_dev.bdev = NULL; dm_get_table_device()
839 if ((r = open_table_device(td, dev, md))) { dm_get_table_device()
841 kfree(td); dm_get_table_device()
845 format_dev_t(td->dm_dev.name, dev); dm_get_table_device()
847 atomic_set(&td->count, 0); dm_get_table_device()
848 list_add(&td->list, &md->table_devices); dm_get_table_device()
850 atomic_inc(&td->count); dm_get_table_device()
853 *result = &td->dm_dev; dm_get_table_device()
860 struct table_device *td = container_of(d, struct table_device, dm_dev); dm_put_table_device() local
863 if (atomic_dec_and_test(&td->count)) { dm_put_table_device()
864 close_table_device(td, md); dm_put_table_device()
865 list_del(&td->list); dm_put_table_device()
866 kfree(td); dm_put_table_device()
877 struct table_device *td = list_entry(tmp, struct table_device, list); list_for_each_safe() local
880 td->dm_dev.name, atomic_read(&td->count)); list_for_each_safe()
881 kfree(td); list_for_each_safe()
H A Ddm-thin.c120 static void build_key(struct dm_thin_device *td, enum lock_space ls, build_key() argument
124 key->dev = dm_thin_dev_id(td); build_key()
129 static void build_data_key(struct dm_thin_device *td, dm_block_t b, build_data_key() argument
132 build_key(td, PHYSICAL, b, b + 1llu, key); build_data_key()
135 static void build_virtual_key(struct dm_thin_device *td, dm_block_t b, build_virtual_key() argument
138 build_key(td, VIRTUAL, b, b + 1llu, key); build_virtual_key()
304 struct dm_thin_device *td; member in struct:thin_c
699 dm_thin_changed_this_transaction(tc->td); bio_triggers_commit()
728 if (dm_thin_aborted_changes(tc->td)) { issue()
934 r = dm_thin_insert_block(tc->td, m->virt_begin, m->data_block); process_prepared_mapping()
988 r = dm_thin_remove_range(tc->td, m->cell->key.block_begin, m->cell->key.block_end); process_prepared_discard_no_passdown()
1051 r = dm_thin_remove_range(tc->td, m->virt_begin, m->virt_end); process_prepared_discard_passdown()
1516 r = dm_thin_find_mapped_range(tc->td, begin, end, &virt_begin, &virt_end, break_up_discard_bio()
1525 build_key(tc->td, PHYSICAL, data_begin, data_begin + (virt_end - virt_begin), &data_key); break_up_discard_bio()
1597 build_key(tc->td, VIRTUAL, begin, end, &virt_key); process_discard_bio()
1693 build_data_key(tc->td, lookup_result->block, &key); process_shared_bio()
1776 r = dm_thin_find_block(tc->td, block, 1, &lookup_result); process_cell()
1829 build_virtual_key(tc->td, block, &key); process_bio()
1844 r = dm_thin_find_block(tc->td, block, 1, &lookup_result); __process_bio_read_only()
2541 struct dm_thin_device *td = tc->td; thin_bio_map() local
2568 build_virtual_key(tc->td, block, &key); thin_bio_map()
2572 r = dm_thin_find_block(td, block, 0, &result); thin_bio_map()
2598 build_data_key(tc->td, result.block, &key); thin_bio_map()
3935 dm_pool_close_thin_device(tc->td); thin_dtr()
4028 r = dm_pool_open_thin_device(tc->pool->pmd, tc->dev_id, &tc->td); thin_ctr()
4077 dm_pool_close_thin_device(tc->td); thin_ctr()
4186 if (!tc->td) thin_status()
4191 r = dm_thin_get_mapped_count(tc->td, &mapped); thin_status()
4197 r = dm_thin_get_highest_mapped_block(tc->td, &highest); thin_status()
/linux-4.4.14/drivers/dma/
H A Dtimb_dma.c122 struct timb_dma *td = tdchantotd(td_chan); __td_enable_chan_irq() local
126 ier = ioread32(td->membase + TIMBDMA_IER); __td_enable_chan_irq()
130 iowrite32(ier, td->membase + TIMBDMA_IER); __td_enable_chan_irq()
137 struct timb_dma *td = (struct timb_dma *)((u8 *)td_chan - __td_dma_done_ack() local
142 dev_dbg(chan2dev(&td_chan->chan), "Checking irq: %d, td: %p\n", id, td); __td_dma_done_ack()
144 isr = ioread32(td->membase + TIMBDMA_ISR) & (1 << id); __td_dma_done_ack()
146 iowrite32(isr, td->membase + TIMBDMA_ISR); __td_dma_done_ack()
269 static u32 __td_ier_mask(struct timb_dma *td) __td_ier_mask() argument
274 for (i = 0; i < td->dma.chancnt; i++) { __td_ier_mask()
275 struct timb_dma_chan *td_chan = td->channels + i; __td_ier_mask()
583 struct timb_dma *td = (struct timb_dma *)data; td_tasklet() local
589 isr = ioread32(td->membase + TIMBDMA_ISR); td_tasklet()
590 ipr = isr & __td_ier_mask(td); td_tasklet()
593 iowrite32(ipr, td->membase + TIMBDMA_ISR); td_tasklet()
595 for (i = 0; i < td->dma.chancnt; i++) td_tasklet()
597 struct timb_dma_chan *td_chan = td->channels + i; td_tasklet()
605 ier = __td_ier_mask(td); td_tasklet()
606 iowrite32(ier, td->membase + TIMBDMA_IER); td_tasklet()
612 struct timb_dma *td = devid; td_irq() local
613 u32 ipr = ioread32(td->membase + TIMBDMA_IPR); td_irq()
617 iowrite32(0, td->membase + TIMBDMA_IER); td_irq()
619 tasklet_schedule(&td->tasklet); td_irq()
630 struct timb_dma *td; td_probe() local
653 td = kzalloc(sizeof(struct timb_dma) + td_probe()
655 if (!td) { td_probe()
660 dev_dbg(&pdev->dev, "Allocated TD: %p\n", td); td_probe()
662 td->membase = ioremap(iomem->start, resource_size(iomem)); td_probe()
663 if (!td->membase) { td_probe()
670 iowrite32(TIMBDMA_32BIT_ADDR, td->membase + TIMBDMA_ACR); td_probe()
673 iowrite32(0x0, td->membase + TIMBDMA_IER); td_probe()
674 iowrite32(0xFFFFFFFF, td->membase + TIMBDMA_ISR); td_probe()
676 tasklet_init(&td->tasklet, td_tasklet, (unsigned long)td); td_probe()
678 err = request_irq(irq, td_irq, IRQF_SHARED, DRIVER_NAME, td); td_probe()
684 td->dma.device_alloc_chan_resources = td_alloc_chan_resources; td_probe()
685 td->dma.device_free_chan_resources = td_free_chan_resources; td_probe()
686 td->dma.device_tx_status = td_tx_status; td_probe()
687 td->dma.device_issue_pending = td_issue_pending; td_probe()
689 dma_cap_set(DMA_SLAVE, td->dma.cap_mask); td_probe()
690 dma_cap_set(DMA_PRIVATE, td->dma.cap_mask); td_probe()
691 td->dma.device_prep_slave_sg = td_prep_slave_sg; td_probe()
692 td->dma.device_terminate_all = td_terminate_all; td_probe()
694 td->dma.dev = &pdev->dev; td_probe()
696 INIT_LIST_HEAD(&td->dma.channels); td_probe()
699 struct timb_dma_chan *td_chan = &td->channels[i]; td_probe()
710 td_chan->chan.device = &td->dma; td_probe()
723 td_chan->membase = td->membase + td_probe()
730 list_add_tail(&td_chan->chan.device_node, &td->dma.channels); td_probe()
733 err = dma_async_device_register(&td->dma); td_probe()
739 platform_set_drvdata(pdev, td); td_probe()
745 free_irq(irq, td); td_probe()
747 tasklet_kill(&td->tasklet); td_probe()
748 iounmap(td->membase); td_probe()
750 kfree(td); td_probe()
760 struct timb_dma *td = platform_get_drvdata(pdev); td_remove() local
764 dma_async_device_unregister(&td->dma); td_remove()
765 free_irq(irq, td); td_remove()
766 tasklet_kill(&td->tasklet); td_remove()
767 iounmap(td->membase); td_remove()
768 kfree(td); td_remove()
H A Dcppi41.c536 struct cppi41_desc *td; cppi41_tear_down_chan() local
541 td = cdd->cd; cppi41_tear_down_chan()
542 td += cdd->first_td_desc; cppi41_tear_down_chan()
548 cppi41_compute_td_desc(td); cppi41_tear_down_chan()
581 pd0 = td->pd0; cppi41_tear_down_chan()
H A Dtegra20-apb-dma.c263 struct dma_async_tx_descriptor *td) txd_to_tegra_dma_desc()
265 return container_of(td, struct tegra_dma_desc, txd); txd_to_tegra_dma_desc()
262 txd_to_tegra_dma_desc( struct dma_async_tx_descriptor *td) txd_to_tegra_dma_desc() argument
/linux-4.4.14/sound/pci/asihpi/
H A Dhpi.h62 <td><p><b>Bitrate (kbs)</b></p>
63 <td><p><b>Mono</b></p>
64 <td><p><b>Stereo,<br>Joint Stereo or<br>Dual Channel</b></p>
66 <tr><td>32<td>X<td>_
67 <tr><td>40<td>_<td>_
68 <tr><td>48<td>X<td>_
69 <tr><td>56<td>X<td>_
70 <tr><td>64<td>X<td>X
71 <tr><td>80<td>X<td>_
72 <tr><td>96<td>X<td>X
73 <tr><td>112<td>X<td>X
74 <tr><td>128<td>X<td>X
75 <tr><td>160<td>X<td>X
76 <tr><td>192<td>X<td>X
77 <tr><td>224<td>_<td>X
78 <tr><td>256<td>-<td>X
79 <tr><td>320<td>-<td>X
80 <tr><td>384<td>_<td>X
91 <td><p><b>Bitrate (kbs)</b></p>
92 <td><p><b>Mono<br>Stereo @ 8,<br>11.025 and<br>12kHz*</b></p>
93 <td><p><b>Mono<br>Stereo @ 16,<br>22.050 and<br>24kHz*</b></p>
94 <td><p><b>Mono<br>Stereo @ 32,<br>44.1 and<br>48kHz</b></p>
96 <tr><td>16<td>X<td>X<td>_
97 <tr><td>24<td>X<td>X<td>_
98 <tr><td>32<td>X<td>X<td>X
99 <tr><td>40<td>X<td>X<td>X
100 <tr><td>48<td>X<td>X<td>X
101 <tr><td>56<td>X<td>X<td>X
102 <tr><td>64<td>X<td>X<td>X
103 <tr><td>80<td>_<td>X<td>X
104 <tr><td>96<td>_<td>X<td>X
105 <tr><td>112<td>_<td>X<td>X
106 <tr><td>128<td>_<td>X<td>X
107 <tr><td>144<td>_<td>X<td>_
108 <tr><td>160<td>_<td>X<td>X
109 <tr><td>192<td>_<td>_<td>X
110 <tr><td>224<td>_<td>_<td>X
111 <tr><td>256<td>-<td>_<td>X
112 <tr><td>320<td>-<td>_<td>X
/linux-4.4.14/kernel/time/
H A Dtick-common.c177 static void tick_setup_device(struct tick_device *td, tick_setup_device() argument
187 if (!td->evtdev) { tick_setup_device()
204 td->mode = TICKDEV_MODE_PERIODIC; tick_setup_device()
206 handler = td->evtdev->event_handler; tick_setup_device()
207 next_event = td->evtdev->next_event; tick_setup_device()
208 td->evtdev->event_handler = clockevents_handle_noop; tick_setup_device()
211 td->evtdev = newdev; tick_setup_device()
230 if (td->mode == TICKDEV_MODE_PERIODIC) tick_setup_device()
238 struct tick_device *td = this_cpu_ptr(&tick_cpu_device); tick_install_replacement() local
241 clockevents_exchange_device(td->evtdev, newdev); tick_install_replacement()
242 tick_setup_device(td, newdev, cpu, cpumask_of(cpu)); tick_install_replacement()
303 struct tick_device *td; tick_check_new_device() local
307 td = &per_cpu(tick_cpu_device, cpu); tick_check_new_device()
308 curdev = td->evtdev; tick_check_new_device()
331 tick_setup_device(td, newdev, cpu, cpumask_of(cpu)); tick_check_new_device()
356 struct tick_device *td = this_cpu_ptr(&tick_cpu_device); tick_broadcast_oneshot_control() local
358 if (!(td->evtdev->features & CLOCK_EVT_FEAT_C3STOP)) tick_broadcast_oneshot_control()
391 struct tick_device *td = &per_cpu(tick_cpu_device, cpu); tick_shutdown() local
392 struct clock_event_device *dev = td->evtdev; tick_shutdown()
394 td->mode = TICKDEV_MODE_PERIODIC; tick_shutdown()
403 td->evtdev = NULL; tick_shutdown()
417 struct tick_device *td = this_cpu_ptr(&tick_cpu_device); tick_suspend_local() local
419 clockevents_shutdown(td->evtdev); tick_suspend_local()
431 struct tick_device *td = this_cpu_ptr(&tick_cpu_device); tick_resume_local() local
434 clockevents_tick_resume(td->evtdev); tick_resume_local()
436 if (td->mode == TICKDEV_MODE_PERIODIC) tick_resume_local()
437 tick_setup_periodic(td->evtdev, 0); tick_resume_local()
H A Dtick-oneshot.c78 struct tick_device *td = this_cpu_ptr(&tick_cpu_device); tick_switch_to_oneshot() local
79 struct clock_event_device *dev = td->evtdev; tick_switch_to_oneshot()
98 td->mode = TICKDEV_MODE_ONESHOT; tick_switch_to_oneshot()
H A Dtick-broadcast.c242 struct tick_device *td = this_cpu_ptr(&tick_cpu_device); tick_receive_broadcast() local
243 struct clock_event_device *evt = td->evtdev; tick_receive_broadcast()
262 struct tick_device *td; tick_do_broadcast() local
294 td = &per_cpu(tick_cpu_device, cpumask_first(mask)); tick_do_broadcast()
295 td->evtdev->broadcast(mask); tick_do_broadcast()
315 struct tick_device *td = this_cpu_ptr(&tick_cpu_device); tick_handle_periodic_broadcast() local
341 td->evtdev->event_handler(td->evtdev); tick_handle_periodic_broadcast()
358 struct tick_device *td; tick_broadcast_control() local
361 td = this_cpu_ptr(&tick_cpu_device); tick_broadcast_control()
362 dev = td->evtdev; tick_broadcast_control()
582 struct tick_device *td = this_cpu_ptr(&tick_cpu_device); tick_check_oneshot_broadcast_this_cpu() local
589 if (td->mode == TICKDEV_MODE_ONESHOT) { tick_check_oneshot_broadcast_this_cpu()
590 clockevents_switch_state(td->evtdev, tick_check_oneshot_broadcast_this_cpu()
601 struct tick_device *td; tick_handle_oneshot_broadcast() local
613 td = &per_cpu(tick_cpu_device, cpu); for_each_cpu()
614 if (td->evtdev->next_event.tv64 <= now.tv64) { for_each_cpu()
622 } else if (td->evtdev->next_event.tv64 < next_event.tv64) { for_each_cpu()
623 next_event.tv64 = td->evtdev->next_event.tv64; for_each_cpu()
666 td = this_cpu_ptr(&tick_cpu_device);
667 td->evtdev->event_handler(td->evtdev);
857 struct tick_device *td; tick_broadcast_init_next_event() local
861 td = &per_cpu(tick_cpu_device, cpu); for_each_cpu()
862 if (td->evtdev) for_each_cpu()
863 td->evtdev->next_event = expires; for_each_cpu()
H A Dtimer_list.c206 print_tickdevice(struct seq_file *m, struct tick_device *td, int cpu) print_tickdevice() argument
208 struct clock_event_device *dev = td->evtdev; print_tickdevice()
210 SEQ_printf(m, "Tick Device: mode: %d\n", td->mode); print_tickdevice()
H A Dclockevents.c660 struct tick_device *td; sysfs_show_current_tick_dev() local
664 td = tick_get_tick_dev(dev); sysfs_show_current_tick_dev()
665 if (td && td->evtdev) sysfs_show_current_tick_dev()
666 count = snprintf(buf, PAGE_SIZE, "%s\n", td->evtdev->name); sysfs_show_current_tick_dev()
H A Dhrtimer.c1413 struct tick_device *td; __hrtimer_peek_ahead_timers() local
1418 td = this_cpu_ptr(&tick_cpu_device); __hrtimer_peek_ahead_timers()
1419 if (td && td->evtdev) __hrtimer_peek_ahead_timers()
1420 hrtimer_interrupt(td->evtdev); __hrtimer_peek_ahead_timers()
/linux-4.4.14/kernel/
H A Dsmpboot.c107 struct smpboot_thread_data *td = data; smpboot_thread_fn() local
108 struct smp_hotplug_thread *ht = td->ht; smpboot_thread_fn()
117 if (ht->cleanup && td->status != HP_THREAD_NONE) smpboot_thread_fn()
118 ht->cleanup(td->cpu, cpu_online(td->cpu)); smpboot_thread_fn()
119 kfree(td); smpboot_thread_fn()
126 if (ht->park && td->status == HP_THREAD_ACTIVE) { smpboot_thread_fn()
127 BUG_ON(td->cpu != smp_processor_id()); smpboot_thread_fn()
128 ht->park(td->cpu); smpboot_thread_fn()
129 td->status = HP_THREAD_PARKED; smpboot_thread_fn()
136 BUG_ON(td->cpu != smp_processor_id()); smpboot_thread_fn()
139 switch (td->status) { smpboot_thread_fn()
144 ht->setup(td->cpu); smpboot_thread_fn()
145 td->status = HP_THREAD_ACTIVE; smpboot_thread_fn()
152 ht->unpark(td->cpu); smpboot_thread_fn()
153 td->status = HP_THREAD_ACTIVE; smpboot_thread_fn()
157 if (!ht->thread_should_run(td->cpu)) { smpboot_thread_fn()
163 ht->thread_fn(td->cpu); smpboot_thread_fn()
172 struct smpboot_thread_data *td; __smpboot_create_thread() local
177 td = kzalloc_node(sizeof(*td), GFP_KERNEL, cpu_to_node(cpu)); __smpboot_create_thread()
178 if (!td) __smpboot_create_thread()
180 td->cpu = cpu; __smpboot_create_thread()
181 td->ht = ht; __smpboot_create_thread()
183 tsk = kthread_create_on_cpu(smpboot_thread_fn, td, cpu, __smpboot_create_thread()
186 kfree(td); __smpboot_create_thread()
/linux-4.4.14/drivers/net/ethernet/seeq/
H A Dsgiseeq.c427 struct sgiseeq_tx_desc *td; kick_tx() local
436 td = &sp->tx_desc[i]; kick_tx()
437 dma_sync_desc_cpu(dev, td); kick_tx()
438 while ((td->tdma.cntinfo & (HPCDMA_XIU | HPCDMA_ETXD)) == kick_tx()
441 td = &sp->tx_desc[i]; kick_tx()
442 dma_sync_desc_cpu(dev, td); kick_tx()
444 if (td->tdma.cntinfo & HPCDMA_XIU) { kick_tx()
445 hregs->tx_ndptr = VIRT_TO_DMA(sp, td); kick_tx()
454 struct sgiseeq_tx_desc *td; sgiseeq_tx() local
472 td = &sp->tx_desc[j]; sgiseeq_tx()
474 dma_sync_desc_cpu(dev, td); sgiseeq_tx()
475 if (!(td->tdma.cntinfo & (HPCDMA_XIU))) sgiseeq_tx()
477 if (!(td->tdma.cntinfo & (HPCDMA_ETXD))) { sgiseeq_tx()
479 hregs->tx_ndptr = VIRT_TO_DMA(sp, td); sgiseeq_tx()
486 td->tdma.cntinfo &= ~(HPCDMA_XIU | HPCDMA_XIE); sgiseeq_tx()
487 td->tdma.cntinfo |= HPCDMA_EOX; sgiseeq_tx()
488 if (td->skb) { sgiseeq_tx()
489 dev_kfree_skb_any(td->skb); sgiseeq_tx()
490 td->skb = NULL; sgiseeq_tx()
492 dma_sync_desc_dev(dev, td); sgiseeq_tx()
586 struct sgiseeq_tx_desc *td; sgiseeq_start_xmit() local
603 td = &sp->tx_desc[entry]; sgiseeq_start_xmit()
604 dma_sync_desc_cpu(dev, td); sgiseeq_start_xmit()
619 td->skb = skb; sgiseeq_start_xmit()
620 td->tdma.pbuf = dma_map_single(dev->dev.parent, skb->data, sgiseeq_start_xmit()
622 td->tdma.cntinfo = (len & HPCDMA_BCNT) | sgiseeq_start_xmit()
624 dma_sync_desc_dev(dev, td); sgiseeq_start_xmit()
/linux-4.4.14/drivers/net/wireless/mediatek/mt7601u/
H A Ddebugfs.c102 struct tssi_data *td = &dev->ee->tssi_data; mt7601u_eeprom_param_read() local
134 seq_printf(file, "\t slope:%02hhx\n", td->slope); mt7601u_eeprom_param_read()
136 td->offset[0], td->offset[1], td->offset[2]); mt7601u_eeprom_param_read()
137 seq_printf(file, "\t delta_off:%08x\n", td->tx0_delta_offset); mt7601u_eeprom_param_read()
/linux-4.4.14/drivers/char/agp/
H A Disoch.c79 struct pci_dev *td = bridge->dev, *dev; agp_3_5_isochronous_node_enable() local
118 pci_read_config_dword(td, bridge->capndx+AGPNISTAT, &tnistat); agp_3_5_isochronous_node_enable()
119 pci_read_config_dword(td, bridge->capndx+AGPSTAT, &tstatus); agp_3_5_isochronous_node_enable()
156 dev_err(&td->dev, "isochronous bandwidth required "
171 pci_read_config_word(td, bridge->capndx+AGPNICMD, &tnicmd);
174 pci_write_config_word(td, bridge->capndx+AGPNICMD, tnicmd);
177 pci_read_config_dword(td, bridge->capndx+AGPNISTAT, &tnistat);
191 dev_err(&td->dev, "number of isochronous "
232 dev_err(&td->dev, "number of request queue slots "
318 struct pci_dev *td = bridge->dev, *dev = NULL; agp_3_5_enable() local
330 pci_read_config_dword(td, bridge->capndx+AGPSTAT, &tstatus); agp_3_5_enable()
362 dev_info(&td->dev, "wacky, found unclassified AGP device %s [%04x/%04x]\n", for_each_pci_dev()
411 dev_err(&td->dev, "woah! Non-AGP device %s on " list_for_each()
420 dev_err(&td->dev, "woah! AGP 2.0 device %s on " list_for_each()
432 dev_err(&td->dev, "woah! AGP 3.x device %s not " list_for_each()
449 dev_info(&td->dev, "something bad happened setting "
/linux-4.4.14/block/
H A Dblk-throttle.c94 struct throtl_data *td; member in struct:throtl_grp
119 /* are there any throtl rules between this group and td? */
201 return tg->td; sq_to_td()
355 struct throtl_data *td = blkg->q->td; throtl_pd_init() local
371 sq->parent_sq = &td->service_queue; throtl_pd_init()
374 tg->td = td; throtl_pd_init()
923 * @td->service_queue, @bio is ready to be issued. Put it on its tg_dispatch_one_bio()
933 BUG_ON(tg->td->nr_queued[rw] <= 0); tg_dispatch_one_bio()
934 tg->td->nr_queued[rw]--; tg_dispatch_one_bio()
1023 struct throtl_data *td = sq_to_td(sq); throtl_pending_timer_fn() local
1024 struct request_queue *q = td->queue; throtl_pending_timer_fn()
1070 queue_work(kthrotld_workqueue, &td->dispatch_work); throtl_pending_timer_fn()
1086 struct throtl_data *td = container_of(work, struct throtl_data, blk_throtl_dispatch_work_fn() local
1088 struct throtl_service_queue *td_sq = &td->service_queue; blk_throtl_dispatch_work_fn()
1089 struct request_queue *q = td->queue; blk_throtl_dispatch_work_fn()
1381 struct throtl_data *td = q->td; throtl_shutdown_wq() local
1383 cancel_work_sync(&td->dispatch_work); throtl_shutdown_wq()
1463 tg->td->nr_queued[rw]++; blk_throtl_bio()
1522 struct throtl_data *td = q->td; variable in typeref:struct:throtl_data
1533 * that all bios are propagated to td->service_queue. It'd be
1537 blkg_for_each_descendant_post(blkg, pos_css, td->queue->root_blkg)
1540 /* finally, transfer bios from top-level tg's into the td */
1541 tg_drain_bios(&td->service_queue);
1546 /* all bios now should be in td->service_queue, issue them */
1548 while ((bio = throtl_pop_queued(&td->service_queue.queued[rw],
1557 struct throtl_data *td; blk_throtl_init() local
1560 td = kzalloc_node(sizeof(*td), GFP_KERNEL, q->node); blk_throtl_init()
1561 if (!td) blk_throtl_init()
1564 INIT_WORK(&td->dispatch_work, blk_throtl_dispatch_work_fn); blk_throtl_init()
1565 throtl_service_queue_init(&td->service_queue); blk_throtl_init()
1567 q->td = td; blk_throtl_init()
1568 td->queue = q; blk_throtl_init()
1573 kfree(td); blk_throtl_init()
1579 BUG_ON(!q->td); blk_throtl_exit()
1582 kfree(q->td); blk_throtl_exit()
/linux-4.4.14/drivers/net/ethernet/chelsio/cxgb3/
H A Dcxgb3_offload.c562 struct t3c_data *td = container_of(work, struct t3c_data, t3_process_tid_release_list() local
565 struct t3cdev *tdev = td->dev; t3_process_tid_release_list()
568 spin_lock_bh(&td->tid_release_lock); t3_process_tid_release_list()
569 while (td->tid_release_list) { t3_process_tid_release_list()
570 struct t3c_tid_entry *p = td->tid_release_list; t3_process_tid_release_list()
572 td->tid_release_list = p->ctx; t3_process_tid_release_list()
573 spin_unlock_bh(&td->tid_release_lock); t3_process_tid_release_list()
578 skb = td->nofail_skb; t3_process_tid_release_list()
580 spin_lock_bh(&td->tid_release_lock); t3_process_tid_release_list()
581 p->ctx = (void *)td->tid_release_list; t3_process_tid_release_list()
582 td->tid_release_list = p; t3_process_tid_release_list()
585 mk_tid_release(skb, p - td->tid_maps.tid_tab); t3_process_tid_release_list()
588 if (skb == td->nofail_skb) t3_process_tid_release_list()
589 td->nofail_skb = t3_process_tid_release_list()
592 spin_lock_bh(&td->tid_release_lock); t3_process_tid_release_list()
594 td->release_list_incomplete = (td->tid_release_list == NULL) ? 0 : 1; t3_process_tid_release_list()
595 spin_unlock_bh(&td->tid_release_lock); t3_process_tid_release_list()
597 if (!td->nofail_skb) t3_process_tid_release_list()
598 td->nofail_skb = t3_process_tid_release_list()
606 struct t3c_data *td = T3C_DATA(tdev); cxgb3_queue_tid_release() local
607 struct t3c_tid_entry *p = &td->tid_maps.tid_tab[tid]; cxgb3_queue_tid_release()
609 spin_lock_bh(&td->tid_release_lock); cxgb3_queue_tid_release()
610 p->ctx = (void *)td->tid_release_list; cxgb3_queue_tid_release()
612 td->tid_release_list = p; cxgb3_queue_tid_release()
613 if (!p->ctx || td->release_list_incomplete) cxgb3_queue_tid_release()
614 schedule_work(&td->tid_release_task); cxgb3_queue_tid_release()
615 spin_unlock_bh(&td->tid_release_lock); cxgb3_queue_tid_release()
H A Dcxgb3_main.c1391 struct t3c_data *td = T3C_DATA(tdev); offload_close() local
1402 flush_work(&td->tid_release_task); offload_close()
/linux-4.4.14/drivers/usb/chipidea/
H A Dudc.h57 struct ci_hw_td td; member in struct:ci_hw_qh
64 struct list_head td; member in struct:td_node
H A Dudc.c387 struct td_node, td); add_td_to_list()
391 INIT_LIST_HEAD(&node->td); add_td_to_list()
392 list_add_tail(&node->td, &hwreq->tds); add_td_to_list()
433 * In that case we have to span into one extra td. _hardware_enqueue()
452 firstnode = list_first_entry(&hwreq->tds, struct td_node, td); _hardware_enqueue()
455 struct td_node, td); _hardware_enqueue()
473 struct td_node, td); _hardware_enqueue()
489 hwep->qh.ptr->td.next = cpu_to_le32(firstnode->dma); _hardware_enqueue()
490 hwep->qh.ptr->td.token &= _hardware_enqueue()
526 hwep->qh.ptr->td.next = node->dma; reprime_dtd()
527 hwep->qh.ptr->td.token &= reprime_dtd()
557 list_for_each_entry_safe(node, tmpnode, &hwreq->tds, td) { _hardware_dequeue()
592 * As the hardware could still address the freed td _hardware_dequeue()
594 * td has to be delayed by one. _hardware_dequeue()
600 list_del_init(&node->td); _hardware_dequeue()
636 list_for_each_entry_safe(node, tmpnode, &hwreq->tds, td) {
638 list_del_init(&node->td);
1257 hwep->qh.ptr->td.next |= cpu_to_le32(TD_TERMINATE); /* needed? */ ep_enable()
1354 list_for_each_entry_safe(node, tmpnode, &hwreq->tds, td) { ep_free_request()
1356 list_del_init(&node->td); ep_free_request()
1408 list_for_each_entry_safe(node, tmpnode, &hwreq->tds, td) { ep_dequeue()
1410 list_del(&node->td); ep_dequeue()
H A Ddebug.c191 list_for_each_entry_safe(node, tmpnode, &req->tds, td) { ci_requests_show()
/linux-4.4.14/drivers/usb/gadget/udc/
H A Damd5536udc.c614 struct udc_data_dma *td; udc_free_dma_chain() local
622 td = phys_to_virt(td_last->next); udc_free_dma_chain()
625 pci_pool_free(dev->data_requests, td, udc_free_dma_chain()
627 td_last = td; udc_free_dma_chain()
628 td = phys_to_virt(td_last->next); udc_free_dma_chain()
818 struct udc_data_dma *td = NULL; udc_create_dma_chain() local
845 td = req->td_data; udc_create_dma_chain()
850 td = pci_pool_alloc(ep->dev->data_requests, udc_create_dma_chain()
852 if (!td) udc_create_dma_chain()
855 td->status = 0; udc_create_dma_chain()
857 /* first td */ udc_create_dma_chain()
858 td = (struct udc_data_dma *)phys_to_virt( udc_create_dma_chain()
860 td->status = 0; udc_create_dma_chain()
862 td = (struct udc_data_dma *)phys_to_virt(last->next); udc_create_dma_chain()
863 td->status = 0; udc_create_dma_chain()
866 if (td) udc_create_dma_chain()
867 td->bufptr = req->req.dma + i; /* assign buffer */ udc_create_dma_chain()
879 /* link td and assign tx bytes */ udc_create_dma_chain()
885 * req->td_data->next = virt_to_phys(td); udc_create_dma_chain()
895 td->status = AMD_ADDBITS(td->status, udc_create_dma_chain()
904 * last->next = virt_to_phys(td); udc_create_dma_chain()
908 td->status = AMD_ADDBITS(td->status, udc_create_dma_chain()
913 last = td; udc_create_dma_chain()
916 if (td) { udc_create_dma_chain()
917 td->status |= AMD_BIT(UDC_DMA_IN_STS_L); udc_create_dma_chain()
919 req->td_data_last = td; udc_create_dma_chain()
1052 struct udc_data_dma *td; udc_get_last_dma_desc() local
1054 td = req->td_data; udc_get_last_dma_desc()
1055 while (td && !(td->status & AMD_BIT(UDC_DMA_IN_STS_L))) udc_get_last_dma_desc()
1056 td = phys_to_virt(td->next); udc_get_last_dma_desc()
1058 return td; udc_get_last_dma_desc()
1065 struct udc_data_dma *td; udc_get_ppbdu_rxbytes() local
1068 td = req->td_data; udc_get_ppbdu_rxbytes()
1070 count = AMD_GETBITS(td->status, UDC_DMA_OUT_STS_RXBYTES); udc_get_ppbdu_rxbytes()
1072 while (td && !(td->status & AMD_BIT(UDC_DMA_IN_STS_L))) { udc_get_ppbdu_rxbytes()
1073 td = phys_to_virt(td->next); udc_get_ppbdu_rxbytes()
1075 if (td) { udc_get_ppbdu_rxbytes()
1076 count += AMD_GETBITS(td->status, udc_get_ppbdu_rxbytes()
1939 dev->ep[UDC_EP0OUT_IX].td->status |= activate_control_endpoints()
2128 struct udc_data_dma *td = NULL; udc_data_out_isr() local
2208 td = udc_get_last_dma_desc(req); udc_data_out_isr()
2209 dma_done = AMD_GETBITS(td->status, UDC_DMA_OUT_STS_BS); udc_data_out_isr()
2221 VDBG(dev, "last desc = %p\n", td); udc_data_out_isr()
2228 count = AMD_GETBITS(td->status, udc_data_out_isr()
2342 struct udc_data_dma *td; udc_data_in_isr() local
2387 td = udc_get_last_dma_desc(req); udc_data_in_isr()
2388 if (td) { udc_data_in_isr()
2390 AMD_GETBITS(td->status, udc_data_in_isr()
2661 dev->ep[UDC_EP0OUT_IX].td->status =
2663 dev->ep[UDC_EP0OUT_IX].td->status,
3121 dma_pool_free(dev->stp_requests, dev->ep[UDC_EP0OUT_IX].td, free_dma_pools()
3205 dev->ep[UDC_EP0OUT_IX].td = td_data; init_dma_pools()
H A Dpch_udc.c1526 struct pch_udc_data_dma_desc *td = req->td_data; pch_udc_free_dma_chain() local
1530 dma_addr_t addr = (dma_addr_t)td->next; pch_udc_free_dma_chain()
1531 td->next = 0x00; pch_udc_free_dma_chain()
1534 td = phys_to_virt(addr); pch_udc_free_dma_chain()
1535 addr2 = (dma_addr_t)td->next; pch_udc_free_dma_chain()
1536 pci_pool_free(dev->data_requests, td, addr); pch_udc_free_dma_chain()
1537 td->next = 0x00; pch_udc_free_dma_chain()
1560 struct pch_udc_data_dma_desc *td = req->td_data, *last; pch_udc_create_dma_chain() local
1569 td->dataptr = req->req.dma; pch_udc_create_dma_chain()
1571 td->dataptr = req->dma; pch_udc_create_dma_chain()
1573 td->status = PCH_UDC_BS_HST_BSY; pch_udc_create_dma_chain()
1575 td->status = PCH_UDC_BS_HST_BSY | min(buf_len, bytes); pch_udc_create_dma_chain()
1578 last = td; pch_udc_create_dma_chain()
1579 td = pci_pool_alloc(ep->dev->data_requests, gfp_flags, pch_udc_create_dma_chain()
1581 if (!td) pch_udc_create_dma_chain()
1584 td->dataptr = req->td_data->dataptr + i; pch_udc_create_dma_chain()
1588 req->td_data_last = td; pch_udc_create_dma_chain()
1589 td->status |= PCH_UDC_DMA_LAST; pch_udc_create_dma_chain()
1590 td->next = req->td_data_phys; pch_udc_create_dma_chain()
2194 struct pch_udc_data_dma_desc *td; pch_udc_complete_receiver() local
2205 td = req->td_data_last; pch_udc_complete_receiver()
2207 td = req->td_data; pch_udc_complete_receiver()
2210 if ((td->status & PCH_UDC_RXTX_STS) != PCH_UDC_RTS_SUCC) { pch_udc_complete_receiver()
2217 if ((td->status & PCH_UDC_BUFF_STS) == PCH_UDC_BS_DMA_DONE) pch_udc_complete_receiver()
2218 if (td->status & PCH_UDC_DMA_LAST) { pch_udc_complete_receiver()
2219 count = td->status & PCH_UDC_RXTX_BYTES; pch_udc_complete_receiver()
2222 if (td == req->td_data_last) { pch_udc_complete_receiver()
2226 addr = (dma_addr_t)td->next; pch_udc_complete_receiver()
2227 td = phys_to_virt(addr); pch_udc_complete_receiver()
2233 td->status |= PCH_UDC_BS_HST_BSY; pch_udc_complete_receiver()
H A Dnet2280.c570 struct net2280_dma *td; net2280_alloc_request() local
572 td = pci_pool_alloc(ep->dev->requests, gfp_flags, net2280_alloc_request()
574 if (!td) { net2280_alloc_request()
578 td->dmacount = 0; /* not VALID */ net2280_alloc_request()
579 td->dmadesc = td->dmaaddr; net2280_alloc_request()
580 req->td = td; net2280_alloc_request()
599 if (req->td) net2280_free_request()
600 pci_pool_free(ep->dev->requests, req->td, req->td_dma); net2280_free_request()
804 struct net2280_dma *td = req->td; fill_dma_desc() local
823 /* td->dmadesc = previously set by caller */ fill_dma_desc()
824 td->dmaaddr = cpu_to_le32 (req->req.dma); fill_dma_desc()
828 td->dmacount = cpu_to_le32(dmacount); fill_dma_desc()
904 req->td->dmacount = cpu_to_le32(req->req.length - tmp); start_dma()
907 req->td->dmadesc = 0; start_dma()
931 /* init req->td, pointing to the current dummy */ start_dma()
932 req->td->dmadesc = cpu_to_le32 (ep->td_dma); start_dma()
935 req->td->dmacount |= cpu_to_le32(BIT(END_OF_CHAIN)); start_dma()
948 ep->dummy = req->td; queue_dma()
949 req->td = end; queue_dma()
1154 tmp = le32_to_cpup(&req->td->dmacount); scan_dma_completions()
1162 if (unlikely(req->td->dmadesc == 0)) { scan_dma_completions()
1289 req->td->dmacount = 0; /* invalidate */ net2280_dequeue()
1836 struct net2280_dma *td; queues_show() local
1838 td = req->td; queues_show()
1839 t = scnprintf(next, size, "\t td %08x " queues_show()
1842 le32_to_cpu(td->dmacount), queues_show()
1843 le32_to_cpu(td->dmaaddr), queues_show()
1844 le32_to_cpu(td->dmadesc)); queues_show()
2591 req->td->dmacount = 0; handle_ep_small()
3664 struct net2280_dma *td; net2280_probe() local
3666 td = pci_pool_alloc(dev->requests, GFP_KERNEL, net2280_probe()
3668 if (!td) { net2280_probe()
3673 td->dmacount = 0; /* not VALID */ net2280_probe()
3674 td->dmadesc = td->dmaaddr; net2280_probe()
3675 dev->ep[i].dummy = td; net2280_probe()
H A Dfsl_usb2_udc.h404 /* Rem: all the variables of td are LittleEndian Mode */
417 dma_addr_t td_dma; /* dma address for this td */
418 /* virtual address of next td specified in next_td_ptr */
H A Dmv_udc.h309 dma_addr_t td_dma; /* dma address for this td */
H A Dnet2280.h144 struct net2280_dma *td; member in struct:net2280_request
H A Damd5536udc.h498 struct udc_data_dma *td; member in struct:udc_ep
H A Dfsl_udc_core.c571 * explicitly through req->req.zero. This is needed to enable multi-td fsl_ep_enable()
706 static void fsl_prime_ep(struct fsl_ep *ep, struct ep_td_struct *td) fsl_prime_ep() argument
711 qh->next_dtd_ptr = cpu_to_hc32(td->td_dma fsl_prime_ep()
740 /* Add td to the end */ fsl_queue_td()
/linux-4.4.14/security/keys/
H A Dtrusted.c466 struct tpm_digests *td; tpm_seal() local
478 td = kmalloc(sizeof *td, GFP_KERNEL); tpm_seal()
479 if (!td) tpm_seal()
489 memcpy(td->xorwork, sess.secret, SHA1_DIGEST_SIZE); tpm_seal()
490 memcpy(td->xorwork + SHA1_DIGEST_SIZE, sess.enonce, SHA1_DIGEST_SIZE); tpm_seal()
491 ret = TSS_sha1(td->xorwork, SHA1_DIGEST_SIZE * 2, td->xorhash); tpm_seal()
495 ret = tpm_get_random(TPM_ANY_NUM, td->nonceodd, TPM_NONCE_SIZE); tpm_seal()
505 td->encauth[i] = td->xorhash[i] ^ blobauth[i]; tpm_seal()
510 ret = TSS_authhmac(td->pubauth, sess.secret, SHA1_DIGEST_SIZE, tpm_seal()
511 sess.enonce, td->nonceodd, cont, tpm_seal()
513 td->encauth, sizeof(uint32_t), &pcrsize, tpm_seal()
518 ret = TSS_authhmac(td->pubauth, sess.secret, SHA1_DIGEST_SIZE, tpm_seal()
519 sess.enonce, td->nonceodd, cont, tpm_seal()
521 td->encauth, sizeof(uint32_t), &pcrsize, tpm_seal()
534 storebytes(tb, td->encauth, SHA1_DIGEST_SIZE); tpm_seal()
540 storebytes(tb, td->nonceodd, TPM_NONCE_SIZE); tpm_seal()
542 storebytes(tb, td->pubauth, SHA1_DIGEST_SIZE); tpm_seal()
556 ret = TSS_checkhmac1(tb->data, ordinal, td->nonceodd, sess.secret, tpm_seal()
566 kfree(td); tpm_seal()
/linux-4.4.14/net/sched/
H A Dact_ipt.c91 struct xt_entry_target *td, *t; tcf_ipt_init() local
109 td = (struct xt_entry_target *)nla_data(tb[TCA_IPT_TARG]); tcf_ipt_init()
110 if (nla_len(tb[TCA_IPT_TARG]) < td->u.target_size) tcf_ipt_init()
141 t = kmemdup(td, td->u.target_size, GFP_KERNEL); tcf_ipt_init()
/linux-4.4.14/arch/um/kernel/
H A Ddyn.lds.S39 .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
40 .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
114 .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
H A Duml.lds.S89 .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
/linux-4.4.14/drivers/atm/
H A Dfirestream.c709 struct FS_BPENTRY *td; process_txdone_queue() local
730 printk (KERN_WARNING "td not aligned: %ld\n", tmp); process_txdone_queue()
732 td = bus_to_virt (tmp); process_txdone_queue()
735 td->flags, td->next, td->bsa, td->aal_bufsize, td->skb ); process_txdone_queue()
737 skb = td->skb; process_txdone_queue()
742 td->dev->ntxpckts--; process_txdone_queue()
748 fs_dprintk (FS_DEBUG_QSIZE, "[%d]", td->dev->ntxpckts); process_txdone_queue()
758 fs_dprintk (FS_DEBUG_ALLOC, "Free trans-d: %p\n", td); process_txdone_queue()
759 memset (td, ATM_POISON_FREE, sizeof(struct FS_BPENTRY)); process_txdone_queue()
760 kfree (td); process_txdone_queue()
1169 struct FS_BPENTRY *td; fs_send() local
1183 td = kmalloc (sizeof (struct FS_BPENTRY), GFP_ATOMIC); fs_send()
1184 fs_dprintk (FS_DEBUG_ALLOC, "Alloc transd: %p(%Zd)\n", td, sizeof (struct FS_BPENTRY)); fs_send()
1185 if (!td) { fs_send()
1193 td->flags = TD_EPI | TD_DATA | skb->len; fs_send()
1194 td->next = 0; fs_send()
1195 td->bsa = virt_to_bus (skb->data); fs_send()
1196 td->skb = skb; fs_send()
1197 td->dev = dev; fs_send()
1201 da[qd] = td; fs_send()
1202 dq[qd].flags = td->flags; fs_send()
1203 dq[qd].next = td->next; fs_send()
1204 dq[qd].bsa = td->bsa; fs_send()
1205 dq[qd].skb = td->skb; fs_send()
1206 dq[qd].dev = td->dev; fs_send()
1213 virt_to_bus (td), 0, fs_send()
1214 virt_to_bus (td)); fs_send()
/linux-4.4.14/drivers/mtd/onenand/
H A Donenand_bbt.c25 * @param td search pattern descriptor
33 static int check_short_pattern(uint8_t *buf, int len, int paglen, struct nand_bbt_descr *td) check_short_pattern() argument
39 for (i = 0; i < td->len; i++) { check_short_pattern()
40 if (p[i] != td->pattern[i]) check_short_pattern()
/linux-4.4.14/drivers/net/ethernet/
H A Dkorina.c202 struct dma_desc *td; korina_send_packet() local
206 td = &lp->td_ring[lp->tx_chain_tail]; korina_send_packet()
231 dma_cache_inv((u32) td, sizeof(*td)); korina_send_packet()
232 td->ca = CPHYSADDR(skb->data); korina_send_packet()
239 td->control = DMA_COUNT(length) | korina_send_packet()
250 td->control = DMA_COUNT(length) | korina_send_packet()
256 lp->td_ring[chain_prev].link = CPHYSADDR(td); korina_send_packet()
269 td->control = DMA_COUNT(length) | korina_send_packet()
276 td->control = DMA_COUNT(length) | korina_send_packet()
280 lp->td_ring[chain_prev].link = CPHYSADDR(td); korina_send_packet()
284 dma_cache_wback((u32) td, sizeof(*td)); korina_send_packet()
522 struct dma_desc *td = &lp->td_ring[lp->tx_next_done]; korina_tx() local
529 while (IS_DMA_FINISHED(td->control)) { korina_tx()
587 td = &lp->td_ring[lp->tx_next_done]; korina_tx()
/linux-4.4.14/arch/xtensa/kernel/
H A DMakefile35 -e ':d; s/\*(\([^)]\+ \|\)\.text/*(\1.literal .{text}/; td; ' \
/linux-4.4.14/drivers/usb/host/whci/
H A Dasl.c103 struct whc_qtd *td; process_qset() local
107 td = &qset->qtd[qset->td_start]; process_qset()
108 status = le32_to_cpu(td->status); process_qset()
118 process_halted_qtd(whc, qset, td); process_qset()
127 process_inactive_qtd(whc, qset, td); process_qset()
H A Dpzl.c109 struct whc_qtd *td; pzl_process_qset() local
113 td = &qset->qtd[qset->td_start]; pzl_process_qset()
114 status = le32_to_cpu(td->status); pzl_process_qset()
124 process_halted_qtd(whc, qset, td); pzl_process_qset()
133 process_inactive_qtd(whc, qset, td); pzl_process_qset()
H A Ddebug.c75 seq_printf(s, " sTD[%td]: %zu bytes @ %08x\n", qset_print()
/linux-4.4.14/drivers/ide/
H A Dpalm_bk3710.c115 u8 td, tkw, t0; palm_bk3710_setdmamode() local
126 td = DIV_ROUND_UP(t->active, ideclk_period); palm_bk3710_setdmamode()
127 tkw = t0 - td - 1; palm_bk3710_setdmamode()
128 td -= 1; palm_bk3710_setdmamode()
131 val32 |= (td << (dev ? 8 : 0)); palm_bk3710_setdmamode()
/linux-4.4.14/drivers/net/ethernet/apple/
H A Dmace.c433 volatile struct dbdma_regs __iomem *td = mp->tx_dma; mace_open() local
482 out_le32(&td->control, (RUN|PAUSE|FLUSH|WAKE) << 16); mace_open()
483 out_le32(&td->cmdptr, virt_to_bus(mp->tx_cmds)); mace_open()
503 volatile struct dbdma_regs __iomem *td = mp->tx_dma; mace_close() local
511 td->control = cpu_to_le32((RUN|PAUSE|FLUSH|WAKE) << 16); /* clear run bit */ mace_close()
534 volatile struct dbdma_regs __iomem *td = mp->tx_dma; mace_xmit_start() local
573 out_le32(&td->control, ((RUN|WAKE) << 16) + (RUN|WAKE)); mace_xmit_start()
664 volatile struct dbdma_regs __iomem *td = mp->tx_dma; mace_interrupt() local
694 dstat = le32_to_cpu(td->status); mace_interrupt()
696 out_le32(&td->control, RUN << 16); mace_interrupt()
798 out_le32(&td->control, ((RUN|WAKE) << 16) + (RUN|WAKE)); mace_interrupt()
810 volatile struct dbdma_regs __iomem *td = mp->tx_dma; mace_tx_timeout() local
829 dbdma_reset(td); mace_tx_timeout()
857 out_le32(&td->cmdptr, virt_to_bus(cp)); mace_tx_timeout()
858 out_le32(&td->control, (RUN << 16) | RUN); mace_tx_timeout()
H A Dbmac.c230 volatile struct dbdma_regs __iomem *td = bp->tx_dma; bmac_enable_and_reset_chip() local
234 if (td) bmac_enable_and_reset_chip()
235 dbdma_reset(td); bmac_enable_and_reset_chip()
478 volatile struct dbdma_regs __iomem *td = bp->tx_dma; bmac_suspend() local
487 td->control = cpu_to_le32(DBDMA_CLEAR(RUN|PAUSE|FLUSH|WAKE)); /* clear run bit */ bmac_suspend()
591 volatile struct dbdma_regs __iomem *td = bp->tx_dma; bmac_init_tx_ring() local
604 dbdma_reset(td); bmac_init_tx_ring()
605 out_le32(&td->wait_sel, 0x00200020); bmac_init_tx_ring()
606 out_le32(&td->cmdptr, virt_to_bus(bp->tx_cmds)); bmac_init_tx_ring()
647 volatile struct dbdma_regs __iomem *td = bp->tx_dma; bmac_transmit_packet() local
672 dbdma_continue(td); bmac_transmit_packet()
1398 volatile struct dbdma_regs __iomem *td = bp->tx_dma; bmac_close() local
1415 td->control = cpu_to_le32(DBDMA_CLEAR(RUN|PAUSE|FLUSH|WAKE)); /* clear run bit */ bmac_close()
1480 volatile struct dbdma_regs __iomem *td = bp->tx_dma; bmac_tx_timeout() local
1496 /* le32_to_cpu(td->status), le16_to_cpu(cp->xfer_status), bp->tx_bad_runt, */ bmac_tx_timeout()
1504 out_le32(&td->control, DBDMA_CLEAR(RUN|PAUSE|FLUSH|WAKE|ACTIVE|DEAD)); bmac_tx_timeout()
1532 out_le32(&td->cmdptr, virt_to_bus(cp)); bmac_tx_timeout()
1533 out_le32(&td->control, DBDMA_SET(RUN)); bmac_tx_timeout()
/linux-4.4.14/drivers/net/ethernet/amd/
H A D7990.c355 volatile struct lance_tx_desc *td; lance_tx() local
368 td = &ib->btx_ring[i]; lance_tx()
371 if (td->tmd1_bits & LE_T1_OWN) lance_tx()
374 if (td->tmd1_bits & LE_T1_ERR) { lance_tx()
375 status = td->misc; lance_tx()
415 } else if ((td->tmd1_bits & LE_T1_POK) == LE_T1_POK) { lance_tx()
419 td->tmd1_bits &= ~(LE_T1_POK); lance_tx()
422 if (td->tmd1_bits & LE_T1_EONE) lance_tx()
426 if (td->tmd1_bits & LE_T1_EMORE) lance_tx()
H A Da2065.c328 volatile struct lance_tx_desc *td; lance_tx() local
338 td = &ib->btx_ring[i]; lance_tx()
341 if (td->tmd1_bits & LE_T1_OWN) lance_tx()
344 if (td->tmd1_bits & LE_T1_ERR) { lance_tx()
345 status = td->misc; lance_tx()
384 } else if ((td->tmd1_bits & LE_T1_POK) == LE_T1_POK) { lance_tx()
386 td->tmd1_bits &= ~(LE_T1_POK); lance_tx()
389 if (td->tmd1_bits & LE_T1_EONE) lance_tx()
393 if (td->tmd1_bits & LE_T1_EMORE) lance_tx()
H A Ddeclance.c246 #define tds_ptr(td, rt, type) \
247 ((volatile u16 *)((u8 *)(td) + tds_off(rt, type)))
646 volatile u16 *td; lance_tx() local
655 td = lib_ptr(ib, btx_ring[i], lp->type); lance_tx()
657 if (*tds_ptr(td, tmd1, lp->type) & LE_T1_OWN) lance_tx()
660 if (*tds_ptr(td, tmd1, lp->type) & LE_T1_ERR) { lance_tx()
661 status = *tds_ptr(td, misc, lp->type); lance_tx()
696 } else if ((*tds_ptr(td, tmd1, lp->type) & LE_T1_POK) == lance_tx()
701 *tds_ptr(td, tmd1, lp->type) &= ~(LE_T1_POK); lance_tx()
704 if (*tds_ptr(td, tmd1, lp->type) & LE_T1_EONE) lance_tx()
708 if (*tds_ptr(td, tmd1, lp->type) & LE_T1_EMORE) lance_tx()
H A Dsunlance.c576 struct lance_tx_desc *td = &ib->btx_ring [i]; lance_tx_dvma() local
577 u8 bits = td->tmd1_bits; lance_tx_dvma()
584 u16 status = td->misc; lance_tx_dvma()
622 td->tmd1_bits = bits & ~(LE_T1_POK); lance_tx_dvma()
744 struct lance_tx_desc __iomem *td = &ib->btx_ring [i]; lance_tx_pio() local
745 u8 bits = sbus_readb(&td->tmd1_bits); lance_tx_pio()
752 u16 status = sbus_readw(&td->misc); lance_tx_pio()
790 sbus_writeb(bits & ~(LE_T1_POK), &td->tmd1_bits); lance_tx_pio()
/linux-4.4.14/drivers/block/drbd/
H A Ddrbd_debugfs.c527 struct drbd_thread_timing_details td; seq_print_one_timing_detail() local
531 td = *tdp; seq_print_one_timing_detail()
532 } while (td.cb_nr != tdp->cb_nr); seq_print_one_timing_detail()
533 if (!td.cb_addr) seq_print_one_timing_detail()
536 td.cb_nr, seq_print_one_timing_detail()
537 jiffies_to_msecs(now - td.start_jif), seq_print_one_timing_detail()
538 td.caller_fn, td.line, seq_print_one_timing_detail()
539 td.cb_addr); seq_print_one_timing_detail()
H A Ddrbd_worker.c1900 struct drbd_thread_timing_details *td = tdp + i; __update_timing_details() local
1902 td->start_jif = jiffies; __update_timing_details()
1903 td->cb_addr = cb; __update_timing_details()
1904 td->caller_fn = fn; __update_timing_details()
1905 td->line = line; __update_timing_details()
1906 td->cb_nr = *cb_nr; __update_timing_details()
1909 td = tdp + i; __update_timing_details()
1910 memset(td, 0, sizeof(*td)); __update_timing_details()
/linux-4.4.14/net/rxrpc/
H A Dar-key.c178 static void rxrpc_free_krb5_tagged(struct krb5_tagged_data *td) rxrpc_free_krb5_tagged() argument
180 kfree(td->data); rxrpc_free_krb5_tagged()
288 static int rxrpc_krb5_decode_tagged_data(struct krb5_tagged_data *td, rxrpc_krb5_decode_tagged_data() argument
303 td->tag = ntohl(*xdr++); rxrpc_krb5_decode_tagged_data()
308 td->data_len = len; rxrpc_krb5_decode_tagged_data()
311 td->data = kmemdup(xdr, len, GFP_KERNEL); rxrpc_krb5_decode_tagged_data()
312 if (!td->data) rxrpc_krb5_decode_tagged_data()
319 _debug("tag %x len %x", td->tag, td->data_len); rxrpc_krb5_decode_tagged_data()
337 struct krb5_tagged_data *td; rxrpc_krb5_decode_tagged_array() local
360 td = kcalloc(n_elem, sizeof(struct krb5_tagged_data), rxrpc_krb5_decode_tagged_array()
362 if (!td) rxrpc_krb5_decode_tagged_array()
364 *_td = td; rxrpc_krb5_decode_tagged_array()
367 ret = rxrpc_krb5_decode_tagged_data(&td[loop], rxrpc_krb5_decode_tagged_array()
/linux-4.4.14/drivers/ata/
H A Dpata_mpc52xx.c82 u8 td; member in struct:mdmaspec
91 { .t0M = 32, .td = 15, .th = 2, .tj = 2, .tkw = 15, .tm = 4, .tn = 1 },
92 { .t0M = 10, .td = 6, .th = 1, .tj = 1, .tkw = 4, .tm = 2, .tn = 1 },
93 { .t0M = 8, .td = 5, .th = 1, .tj = 1, .tkw = 2, .tm = 2, .tn = 1 },
97 { .t0M = 64, .td = 29, .th = 3, .tj = 3, .tkw = 29, .tm = 7, .tn = 2 },
98 { .t0M = 20, .td = 11, .th = 2, .tj = 1, .tkw = 7, .tm = 4, .tn = 1 },
99 { .t0M = 16, .td = 10, .th = 2, .tj = 1, .tkw = 4, .tm = 4, .tn = 1 },
302 t->mdma1 = ((u32)s->t0M << 24) | ((u32)s->td << 16) | ((u32)s->tkw << 8) | s->tm; mpc52xx_ata_compute_mdma_timings()
H A Dpata_bf54x.c374 unsigned short tm, td, tkr, tkw, teoc, th; bfin_set_dmamode() local
443 td = num_clocks_min(mdma_tdmin[mode], fsclk); bfin_set_dmamode()
452 if (tkw + td < n0) bfin_set_dmamode()
453 tkw = n0 - td; bfin_set_dmamode()
464 ATAPI_SET_MULTI_TIM_0(base, (tm<<8 | td)); bfin_set_dmamode()
/linux-4.4.14/sound/soc/pxa/
H A Dttc-dkb.c96 /* ttc/td-dkb digital audio interface glue - connects codec <--> CPU */
111 /* ttc/td audio machine driver */
/linux-4.4.14/drivers/nfc/st21nfca/
H A Dse.c64 u8 td; st21nfca_se_get_bwi() local
69 td = ST21NFCA_ATR_GET_Y_FROM_TD(info->se_info.atr[i]); st21nfca_se_get_bwi()
70 if (ST21NFCA_ATR_TA_PRESENT(td)) st21nfca_se_get_bwi()
72 if (ST21NFCA_ATR_TB_PRESENT(td)) { st21nfca_se_get_bwi()
/linux-4.4.14/lib/
H A Dinflate.c590 struct huft *td, /* distance decoder tables */ inflate_codes()
592 int bd /* number of bits decoded by td[] */ inflate_codes()
649 if ((e = (t = td + ((unsigned)b & md))->e) > 16) inflate_codes()
771 struct huft *td; /* distance code table */ inflate_fixed() local
773 int bd; /* lookup bits for td */ inflate_fixed()
801 if ((i = huft_build(l, 30, 0, cpdist, cpdext, &td, &bd)) > 1) inflate_fixed()
812 if (inflate_codes(tl, td, bl, bd)) { inflate_fixed()
820 huft_free(td); inflate_fixed()
837 struct huft *td; /* distance code table */ inflate_dynamic() local
839 int bd; /* lookup bits for td */ inflate_dynamic()
917 j = (td = tl + ((unsigned)b & m))->b; inflate_dynamic()
919 j = td->v.n; inflate_dynamic()
989 if ((i = huft_build(ll + nl, nd, 0, cpdist, cpdext, &td, &bd)) != 0) inflate_dynamic()
998 huft_free(td); inflate_dynamic()
1009 if (inflate_codes(tl, td, bl, bd)) {
1018 huft_free(td); variable
588 inflate_codes( struct huft *tl, struct huft *td, int bl, int bd ) inflate_codes() argument
/linux-4.4.14/include/linux/
H A Dpm_domain.h98 struct gpd_timing_data td; member in struct:generic_pm_domain_data
116 struct gpd_timing_data *td);
141 struct gpd_timing_data *td) __pm_genpd_add_device()
139 __pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev, struct gpd_timing_data *td) __pm_genpd_add_device() argument
H A Dblkdev.h455 struct throtl_data *td; member in struct:request_queue
/linux-4.4.14/mm/
H A Dbootmem.c113 bdebug("nid=%td start=%lx map=%lx end=%lx mapsize=%lx\n", init_bootmem_core()
184 bdebug("nid=%td start=%lx end=%lx\n", free_all_bootmem_core()
241 bdebug("nid=%td released=%lx\n", bdata - bootmem_node_data, count); free_all_bootmem_core()
294 bdebug("nid=%td start=%lx end=%lx\n", bdata - bootmem_node_data, __free()
315 bdebug("nid=%td start=%lx end=%lx flags=%x\n", __reserve()
342 bdebug("nid=%td start=%lx end=%lx reserve=%d flags=%x\n", mark_bootmem_node()
507 bdebug("nid=%td size=%lx [%lu pages] align=%lx goal=%lx limit=%lx\n", alloc_bootmem_bdata()
/linux-4.4.14/scripts/
H A Danalyze_suspend.py2039 td {text-align: center;}\n\
2040 tr.alt td {background-color:#EAF2D3;}\n\
2041 tr.avg td {background-color:#BDE34C;}\n\
2063 td = '\t<td>{0}</td>\n'
2064 tdlink = '\t<td><a href="{0}">Click Here</a></td>\n'
2092 html += td.format("test %d" % num)
2099 html += td.format(val)
2104 html += td.format(val)
2109 html += td.format(val)
2114 html += td.format(val)
2118 html += td.format("%3.3f ms" % sTime)
2122 html += td.format("%3.3f ms" % rTime)
2133 html += td.format('Average') # name
2135 html += td.format('') # host
2136 html += td.format('') # kernel
2137 html += td.format('') # mode
2138 html += td.format('') # time
2139 html += td.format("%3.3f ms" % sTimeAvg) # suspend time
2140 html += td.format("%3.3f ms" % rTimeAvg) # resume time
2141 html += td.format('') # output link
2177 '<td class="green">{2} Suspend Time: <b>{0} ms</b></td>'\
2178 '<td class="yellow">{2} Resume Time: <b>{1} ms</b></td>'\
2181 '<td class="green">{3} Suspend Time: <b>{0} ms</b></td>'\
2182 '<td class="gray">'+sysvals.suspendmode+' time: <b>{1} ms</b></td>'\
2183 '<td class="yellow">{3} Resume Time: <b>{2} ms</b></td>'\
2186 '<td class="green">{4}Kernel Suspend: {0} ms</td>'\
2187 '<td class="purple">{4}Firmware Suspend: {1} ms</td>'\
2188 '<td class="purple">{4}Firmware Resume: {2} ms</td>'\
2189 '<td class="yellow">{4}Kernel Resume: {3} ms</td>'\
2366 td {text-align: center;}\n\
/linux-4.4.14/arch/cris/arch-v32/drivers/
H A Dcryptocop.c3183 dma_descr_data *td; print_dma_descriptors() local
3186 td = cdesc_out->dma_descr; print_dma_descriptors()
3191 td->buf, print_dma_descriptors()
3192 td->after, print_dma_descriptors()
3193 td->md, print_dma_descriptors()
3194 td->next); print_dma_descriptors()
3201 td->wait, print_dma_descriptors()
3202 td->eol, print_dma_descriptors()
3203 td->out_eop, print_dma_descriptors()
3204 td->in_eop, print_dma_descriptors()
3205 td->intr); print_dma_descriptors()
3211 dma_descr_data *td; print_dma_descriptors() local
3214 td = cdesc_in->dma_descr; print_dma_descriptors()
3219 td->buf, print_dma_descriptors()
3220 td->after, print_dma_descriptors()
3221 td->md, print_dma_descriptors()
3222 td->next); print_dma_descriptors()
3229 td->wait, print_dma_descriptors()
3230 td->eol, print_dma_descriptors()
3231 td->out_eop, print_dma_descriptors()
3232 td->in_eop, print_dma_descriptors()
3233 td->intr); print_dma_descriptors()
/linux-4.4.14/drivers/net/fddi/skfp/
H A Dfplustm.c397 static void copy_tx_mac(struct s_smc *smc, u_long td, struct fddi_mac *mac, copy_tx_mac() argument
399 /* u_long td; transmit descriptor */ copy_tx_mac()
421 write_mdr(smc,td) ; /* write over memory data reg to buffer */ copy_tx_mac()
477 u_int td ; build_claim_beacon() local
485 td = TX_DESCRIPTOR | ((((u_int)len-1)&3)<<27) ; build_claim_beacon()
493 copy_tx_mac(smc,td,(struct fddi_mac *)mac, build_claim_beacon()
502 td = TX_DESCRIPTOR | ((((u_int)len-1)&3)<<27) ; build_claim_beacon()
508 copy_tx_mac(smc,td,(struct fddi_mac *)mac, build_claim_beacon()
518 td = TX_DESCRIPTOR | ((((u_int)len-1)&3)<<27) ; build_claim_beacon()
526 copy_tx_mac(smc,td,(struct fddi_mac *)mac, build_claim_beacon()
/linux-4.4.14/drivers/net/wireless/ath/ath5k/
H A Ddebug.c1124 struct ath5k_hw_5212_tx_desc *td = &ds->ud.ds_tx5212; ath5k_debug_printtxbuf() local
1135 ds->ds_data, td->tx_ctl.tx_control_0, td->tx_ctl.tx_control_1, ath5k_debug_printtxbuf()
1136 td->tx_ctl.tx_control_2, td->tx_ctl.tx_control_3, ath5k_debug_printtxbuf()
1137 td->tx_stat.tx_status_0, td->tx_stat.tx_status_1, ath5k_debug_printtxbuf()
/linux-4.4.14/security/integrity/ima/
H A Dima_crypto.c459 struct ima_template_desc *td, ima_calc_field_array_hash_tfm()
481 if (strcmp(td->name, IMA_TEMPLATE_IMA_NAME) != 0) { ima_calc_field_array_hash_tfm()
487 } else if (strcmp(td->fields[i]->field_id, "n") == 0) { ima_calc_field_array_hash_tfm()
458 ima_calc_field_array_hash_tfm(struct ima_field_data *field_data, struct ima_template_desc *td, int num_fields, struct ima_digest_data *hash, struct crypto_shash *tfm) ima_calc_field_array_hash_tfm() argument
/linux-4.4.14/drivers/nfc/st-nci/
H A Dse.c129 u8 td; st_nci_se_get_bwi() local
134 td = ST_NCI_ATR_GET_Y_FROM_TD(info->se_info.atr[i]); st_nci_se_get_bwi()
135 if (ST_NCI_ATR_TA_PRESENT(td)) st_nci_se_get_bwi()
137 if (ST_NCI_ATR_TB_PRESENT(td)) { st_nci_se_get_bwi()
/linux-4.4.14/arch/arm/mm/
H A Dinit.c516 " .text : 0x%p" " - 0x%p" " (%4td kB)\n" mem_init()
517 " .init : 0x%p" " - 0x%p" " (%4td kB)\n" mem_init()
518 " .data : 0x%p" " - 0x%p" " (%4td kB)\n" mem_init()
519 " .bss : 0x%p" " - 0x%p" " (%4td kB)\n", mem_init()
/linux-4.4.14/drivers/mtd/
H A Dmtdoops.c234 printk(KERN_ERR "mtdoops: write failure at %ld (%td of %ld written), error %d\n", mtdoops_write()
266 printk(KERN_ERR "mtdoops: read failure at %ld (%td of %d read), err %d\n", find_next_position()
/linux-4.4.14/fs/ecryptfs/
H A Dfile.c250 static int ecryptfs_flush(struct file *file, fl_owner_t td) ecryptfs_flush() argument
256 return lower_file->f_op->flush(lower_file, td); ecryptfs_flush()
H A Dkeystore.c1297 printk(KERN_WARNING "Invalid body size ([%td])\n", body_size); parse_tag_1_packet()
1431 printk(KERN_WARNING "Invalid body size ([%td])\n", body_size); parse_tag_3_packet()
1589 printk(KERN_WARNING "Invalid body size ([%td])\n", body_size); parse_tag_11_packet()
2074 "need up to [%td] bytes, but there are only [%td] " write_tag_1_packet()
2134 "need up to [%td] bytes, but there are only [%td] " write_tag_11_packet()
2325 printk(KERN_ERR "Packet too large; need up to [%td] bytes, but " write_tag_3_packet()
2326 "there are only [%td] available\n", max_packet_size, write_tag_3_packet()
H A Dmain.c444 "cipher with name = [%s] and key size = [%td]; " ecryptfs_parse_options()
462 "cipher with name = [%s] and key size = [%td]; " ecryptfs_parse_options()
/linux-4.4.14/sound/sparc/
H A Ddbri.c1772 int td = dbri->pipes[pipe].desc; transmission_complete_intr() local
1775 while (td >= 0) { transmission_complete_intr()
1776 if (td >= DBRI_NO_DESCS) { transmission_complete_intr()
1777 printk(KERN_ERR "DBRI: invalid td on pipe %d\n", pipe); transmission_complete_intr()
1781 status = DBRI_TD_STATUS(dbri->dma->desc[td].word4); transmission_complete_intr()
1785 dprintk(D_INT, "TD %d, status 0x%02x\n", td, status); transmission_complete_intr()
1787 dbri->dma->desc[td].word4 = 0; /* Reset it for next time. */ transmission_complete_intr()
1788 info->offset += DBRI_RD_CNT(dbri->dma->desc[td].word1); transmission_complete_intr()
1790 td = dbri->next_desc[td]; transmission_complete_intr()
1791 dbri->pipes[pipe].desc = td; transmission_complete_intr()
1869 int td = dbri->pipes[pipe].desc; dbri_process_one_interrupt()
1871 dbri->dma->desc[td].word4 = 0; dbri_process_one_interrupt()
1876 *(cmd++) = dbri->dma_dvma + dbri_dma_off(desc, td); dbri_process_one_interrupt()
/linux-4.4.14/drivers/net/ethernet/via/
H A Dvia-velocity.c1724 struct velocity_td_info *tdinfo, struct tx_desc *td) velocity_free_tx_buf()
1740 td->td_buf[i].size & ~TD_QUEUE); velocity_free_tx_buf()
1776 * velocity_free_td_ring - free td ring
1903 struct tx_desc *td; velocity_tx_srv() local
1918 td = &(vptr->tx.rings[qnum][idx]); velocity_tx_srv()
1921 if (td->tdesc0.len & OWNED_BY_NIC) velocity_tx_srv()
1927 if (td->tdesc0.TSR & TSR0_TERR) { velocity_tx_srv()
1930 if (td->tdesc0.TSR & TSR0_CDH) velocity_tx_srv()
1932 if (td->tdesc0.TSR & TSR0_CRS) velocity_tx_srv()
1934 if (td->tdesc0.TSR & TSR0_ABT) velocity_tx_srv()
1936 if (td->tdesc0.TSR & TSR0_OWC) velocity_tx_srv()
1942 velocity_free_tx_buf(vptr, tdinfo, td); velocity_tx_srv()
1723 velocity_free_tx_buf(struct velocity_info *vptr, struct velocity_td_info *tdinfo, struct tx_desc *td) velocity_free_tx_buf() argument
/linux-4.4.14/net/netfilter/ipvs/
H A Dip_vs_ftp.c356 IP_VS_DBG(7, "got PASV at %td of %td\n", ip_vs_ftp_in()
/linux-4.4.14/drivers/net/ethernet/marvell/
H A Dskge.c2736 struct skge_tx_desc *td; skge_xmit_frame() local
2748 td = e->desc; skge_xmit_frame()
2749 BUG_ON(td->control & BMU_OWN); skge_xmit_frame()
2759 td->dma_lo = lower_32_bits(map); skge_xmit_frame()
2760 td->dma_hi = upper_32_bits(map); skge_xmit_frame()
2774 td->csum_offs = 0; skge_xmit_frame()
2775 td->csum_start = offset; skge_xmit_frame()
2776 td->csum_write = offset + skb->csum_offset; skge_xmit_frame()
2783 struct skge_tx_desc *tf = td; skge_xmit_frame()
2810 td->control = BMU_OWN | BMU_SW | BMU_STF | control | len; skge_xmit_frame()
2818 "tx queued, slot %td, len %d\n", skge_xmit_frame()
2875 struct skge_tx_desc *td = e->desc; skge_tx_clean() local
2877 skge_tx_unmap(skge->hw->pdev, e, td->control); skge_tx_clean()
2879 if (td->control & BMU_EOF) skge_tx_clean()
2881 td->control = 0; skge_tx_clean()
3058 "rx slot %td status 0x%x len %d\n", skge_rx_get()
3125 "rx err, slot %td control 0x%x status 0x%x\n", skge_rx_get()
3169 "tx done slot %td\n", skge_tx_done()
/linux-4.4.14/drivers/gpu/drm/radeon/
H A Dr600_dpm.c355 enum r600_td td) r600_select_td()
357 if (td == R600_TD_AUTO) r600_select_td()
361 if (td == R600_TD_UP) r600_select_td()
363 if (td == R600_TD_DOWN) r600_select_td()
354 r600_select_td(struct radeon_device *rdev, enum r600_td td) r600_select_td() argument
H A Dr600_dpm.h156 void r600_select_td(struct radeon_device *rdev, enum r600_td td);
H A Dsumo_dpm.c434 enum r600_td td = R600_TD_DFLT; sumo_program_tp() local
441 if (td == R600_TD_AUTO) sumo_program_tp()
446 if (td == R600_TD_UP) sumo_program_tp()
449 if (td == R600_TD_DOWN) sumo_program_tp()
H A Drv770_dpm.c848 enum r600_td td = R600_TD_DFLT; rv770_program_tp() local
853 if (td == R600_TD_AUTO) rv770_program_tp()
857 if (td == R600_TD_UP) rv770_program_tp()
859 if (td == R600_TD_DOWN) rv770_program_tp()
H A Dsi_dpm.c3784 enum r600_td td = R600_TD_DFLT; si_program_tp() local
3789 if (td == R600_TD_AUTO) si_program_tp()
3794 if (td == R600_TD_UP) si_program_tp()
3797 if (td == R600_TD_DOWN) si_program_tp()
/linux-4.4.14/drivers/net/ethernet/ti/
H A Ddavinci_cpdma.c125 int int_set, int_clear, td; member in struct:cpdma_chan
526 chan->td = CPDMA_RXTEARDOWN; cpdma_chan_create()
533 chan->td = CPDMA_TXTEARDOWN; cpdma_chan_create()
885 dma_reg_write(ctlr, chan->td, chan_linear(chan)); cpdma_chan_stop()
/linux-4.4.14/drivers/net/wireless/cw1200/
H A Ddebug.c256 seq_printf(seq, "WSM cmd: 0x%.4X (%td bytes)\n", cw1200_status_show()
H A Dwsm.c1316 pr_debug("[WSM] <<< 0x%.4X (%td)\n", id, wsm_handle_rx()
/linux-4.4.14/tools/perf/
H A Dbuiltin-probe.c104 pr_err("Filter parse error at %td.\n", err - str + 1); params_add_filter()
/linux-4.4.14/drivers/net/wireless/libertas/
H A Dif_cs.c618 lbs_deb_cs("helper size %td\n", fw->size); if_cs_prog_helper()
688 lbs_deb_cs("fw size %td\n", fw->size); if_cs_prog_real()
/linux-4.4.14/drivers/staging/rdma/ipath/
H A Dipath_verbs.c744 u64 ta, tb, tc, td, te; ipath_ib_timer() local
748 &tc, &td, &te); ipath_ib_timer()
753 dev->ipath_rpkts = td - dev->ipath_rpkts; ipath_ib_timer()
/linux-4.4.14/drivers/firmware/
H A Ddell_rbu.c253 pr_debug("%p:%td\n", temp, (end - temp)); packetize_data()
/linux-4.4.14/arch/ia64/kernel/
H A Dpalinfo.c798 "\td : %d\n", tr_info()
/linux-4.4.14/fs/ext4/
H A Dindirect.c421 * If we're splicing into a [td]indirect block (as opposed to the ext4_splice_branch()
422 * inode) then we need to get write access to the [td]indirect block ext4_splice_branch()
/linux-4.4.14/drivers/net/wireless/ath/wil6210/
H A Dcfg80211.c415 wil_err(wil, "IE too large (%td bytes)\n", sme->ie_len); wil_cfg80211_connect()
/linux-4.4.14/drivers/gpu/drm/i915/
H A Di915_cmd_parser.c1169 DRM_DEBUG_DRIVER("CMD: Command length exceeds batch length: 0x%08X length=%u batchlen=%td\n", i915_parse_cmds()
/linux-4.4.14/drivers/bluetooth/
H A Dhci_intel.c796 bt_dev_dbg(hdev, "Patching %td/%zu", (fw_ptr - fw->data), intel_setup()
/linux-4.4.14/drivers/net/ethernet/mellanox/mlx5/core/
H A Den_main.c2139 mlx5_core_err(mdev, "alloc td failed, %d\n", err); mlx5e_create_netdev()
/linux-4.4.14/arch/powerpc/lib/
H A Dsstep.c938 case 68: /* td */ analyse_instr()
/linux-4.4.14/drivers/infiniband/hw/qib/
H A Dqib_iba6120.c2967 u64 ta, tb, tc, td, te; pma_6120_timer() local
2970 qib_snapshot_counters(ppd, &ta, &tb, &tc, &td, &te); pma_6120_timer()
2975 cs->rpkts = td - cs->rpkts; pma_6120_timer()
/linux-4.4.14/drivers/media/usb/usbvision/
H A Dusbvision-core.c2373 /* Unschedule all of the iso td's */ usbvision_stop_isoc()
/linux-4.4.14/net/ipv6/
H A Dip6mr.c457 "%2td %-10s %8ld %7ld %8ld %7ld %05X\n", ip6mr_vif_seq_show()
/linux-4.4.14/drivers/infiniband/ulp/srp/
H A Dib_srp.c1804 "Null scmnd for RSP w/tag %#016llx received on ch %td / QP %#x\n", srp_process_rsp()
/linux-4.4.14/arch/powerpc/xmon/
H A Dppc-opc.c3476 { "td", X(31,68), X_MASK, PPC64, { TO, RA, RB } },

Completed in 4638 milliseconds