Searched refs:ndlc (Results 1 - 8 of 8) sorted by relevance

/linux-4.1.27/drivers/nfc/st21nfcb/
H A Dndlc.c22 #include "ndlc.h"
54 print_hex_dump(KERN_DEBUG, "ndlc: ", DUMP_PREFIX_OFFSET, \
58 int ndlc_open(struct llt_ndlc *ndlc) ndlc_open() argument
61 ndlc->ops->enable(ndlc->phy_id); ndlc_open()
66 void ndlc_close(struct llt_ndlc *ndlc) ndlc_close() argument
69 ndlc->ops->disable(ndlc->phy_id); ndlc_close()
73 int ndlc_send(struct llt_ndlc *ndlc, struct sk_buff *skb) ndlc_send() argument
75 /* add ndlc header */ ndlc_send()
80 skb_queue_tail(&ndlc->send_q, skb); ndlc_send()
82 schedule_work(&ndlc->sm_work); ndlc_send()
88 static void llt_ndlc_send_queue(struct llt_ndlc *ndlc) llt_ndlc_send_queue() argument
94 if (ndlc->send_q.qlen) llt_ndlc_send_queue()
96 ndlc->send_q.qlen, ndlc->ack_pending_q.qlen); llt_ndlc_send_queue()
98 while (ndlc->send_q.qlen) { llt_ndlc_send_queue()
99 skb = skb_dequeue(&ndlc->send_q); llt_ndlc_send_queue()
100 NDLC_DUMP_SKB("ndlc frame written", skb); llt_ndlc_send_queue()
101 r = ndlc->ops->write(ndlc->phy_id, skb); llt_ndlc_send_queue()
103 ndlc->hard_fault = r; llt_ndlc_send_queue()
109 skb_queue_tail(&ndlc->ack_pending_q, skb); llt_ndlc_send_queue()
111 /* start timer t1 for ndlc aknowledge */ llt_ndlc_send_queue()
112 ndlc->t1_active = true; llt_ndlc_send_queue()
113 mod_timer(&ndlc->t1_timer, time_sent + llt_ndlc_send_queue()
116 ndlc->t2_active = true; llt_ndlc_send_queue()
117 mod_timer(&ndlc->t2_timer, time_sent + llt_ndlc_send_queue()
122 static void llt_ndlc_requeue_data_pending(struct llt_ndlc *ndlc) llt_ndlc_requeue_data_pending() argument
127 while ((skb = skb_dequeue_tail(&ndlc->ack_pending_q))) { llt_ndlc_requeue_data_pending()
143 skb_queue_head(&ndlc->send_q, skb); llt_ndlc_requeue_data_pending()
147 static void llt_ndlc_rcv_queue(struct llt_ndlc *ndlc) llt_ndlc_rcv_queue() argument
153 if (ndlc->rcv_q.qlen) llt_ndlc_rcv_queue()
154 pr_debug("rcvQlen=%d\n", ndlc->rcv_q.qlen); llt_ndlc_rcv_queue()
156 while ((skb = skb_dequeue(&ndlc->rcv_q)) != NULL) { llt_ndlc_rcv_queue()
162 del_timer_sync(&ndlc->t1_timer); llt_ndlc_rcv_queue()
163 del_timer_sync(&ndlc->t2_timer); llt_ndlc_rcv_queue()
164 ndlc->t2_active = false; llt_ndlc_rcv_queue()
165 ndlc->t1_active = false; llt_ndlc_rcv_queue()
168 llt_ndlc_requeue_data_pending(ndlc); llt_ndlc_rcv_queue()
169 llt_ndlc_send_queue(ndlc); llt_ndlc_rcv_queue()
170 /* start timer t1 for ndlc aknowledge */ llt_ndlc_rcv_queue()
172 ndlc->t1_active = true; llt_ndlc_rcv_queue()
173 mod_timer(&ndlc->t1_timer, time_sent + llt_ndlc_rcv_queue()
178 ndlc->t1_active = true; llt_ndlc_rcv_queue()
179 mod_timer(&ndlc->t1_timer, time_sent + llt_ndlc_rcv_queue()
188 nci_recv_frame(ndlc->ndev, skb); llt_ndlc_rcv_queue()
195 struct llt_ndlc *ndlc = container_of(work, struct llt_ndlc, sm_work); llt_ndlc_sm_work() local
197 llt_ndlc_send_queue(ndlc); llt_ndlc_sm_work()
198 llt_ndlc_rcv_queue(ndlc); llt_ndlc_sm_work()
200 if (ndlc->t1_active && timer_pending(&ndlc->t1_timer) == 0) { llt_ndlc_sm_work()
203 ndlc->t1_active = false; llt_ndlc_sm_work()
205 llt_ndlc_requeue_data_pending(ndlc); llt_ndlc_sm_work()
206 llt_ndlc_send_queue(ndlc); llt_ndlc_sm_work()
209 if (ndlc->t2_active && timer_pending(&ndlc->t2_timer) == 0) { llt_ndlc_sm_work()
211 ndlc->t2_active = false; llt_ndlc_sm_work()
212 ndlc->t1_active = false; llt_ndlc_sm_work()
213 del_timer_sync(&ndlc->t1_timer); llt_ndlc_sm_work()
214 del_timer_sync(&ndlc->t2_timer); llt_ndlc_sm_work()
215 ndlc_close(ndlc); llt_ndlc_sm_work()
216 ndlc->hard_fault = -EREMOTEIO; llt_ndlc_sm_work()
220 void ndlc_recv(struct llt_ndlc *ndlc, struct sk_buff *skb) ndlc_recv() argument
224 ndlc->hard_fault = -EREMOTEIO; ndlc_recv()
225 ndlc_close(ndlc); ndlc_recv()
228 skb_queue_tail(&ndlc->rcv_q, skb); ndlc_recv()
231 schedule_work(&ndlc->sm_work); ndlc_recv()
237 struct llt_ndlc *ndlc = (struct llt_ndlc *)data; ndlc_t1_timeout() local
241 schedule_work(&ndlc->sm_work); ndlc_t1_timeout()
246 struct llt_ndlc *ndlc = (struct llt_ndlc *)data; ndlc_t2_timeout() local
250 schedule_work(&ndlc->sm_work); ndlc_t2_timeout()
256 struct llt_ndlc *ndlc; ndlc_probe() local
258 ndlc = devm_kzalloc(dev, sizeof(struct llt_ndlc), GFP_KERNEL); ndlc_probe()
259 if (!ndlc) ndlc_probe()
262 ndlc->ops = phy_ops; ndlc_probe()
263 ndlc->phy_id = phy_id; ndlc_probe()
264 ndlc->dev = dev; ndlc_probe()
266 *ndlc_id = ndlc; ndlc_probe()
269 init_timer(&ndlc->t1_timer); ndlc_probe()
270 ndlc->t1_timer.data = (unsigned long)ndlc; ndlc_probe()
271 ndlc->t1_timer.function = ndlc_t1_timeout; ndlc_probe()
273 init_timer(&ndlc->t2_timer); ndlc_probe()
274 ndlc->t2_timer.data = (unsigned long)ndlc; ndlc_probe()
275 ndlc->t2_timer.function = ndlc_t2_timeout; ndlc_probe()
277 skb_queue_head_init(&ndlc->rcv_q); ndlc_probe()
278 skb_queue_head_init(&ndlc->send_q); ndlc_probe()
279 skb_queue_head_init(&ndlc->ack_pending_q); ndlc_probe()
281 INIT_WORK(&ndlc->sm_work, llt_ndlc_sm_work); ndlc_probe()
283 return st21nfcb_nci_probe(ndlc, phy_headroom, phy_tailroom); ndlc_probe()
287 void ndlc_remove(struct llt_ndlc *ndlc) ndlc_remove() argument
290 del_timer_sync(&ndlc->t1_timer); ndlc_remove()
291 del_timer_sync(&ndlc->t2_timer); ndlc_remove()
292 ndlc->t2_active = false; ndlc_remove()
293 ndlc->t1_active = false; ndlc_remove()
295 skb_queue_purge(&ndlc->rcv_q); ndlc_remove()
296 skb_queue_purge(&ndlc->send_q); ndlc_remove()
298 st21nfcb_nci_remove(ndlc->ndev); ndlc_remove()
H A DMakefile5 st21nfcb_nci-objs = ndlc.o st21nfcb.o st21nfcb_se.o
H A Dst21nfcb.c39 r = ndlc_open(info->ndlc); st21nfcb_nci_open()
53 ndlc_close(info->ndlc); st21nfcb_nci_close()
67 return ndlc_send(info->ndlc, skb); st21nfcb_nci_send()
91 int st21nfcb_nci_probe(struct llt_ndlc *ndlc, int phy_headroom, st21nfcb_nci_probe() argument
98 info = devm_kzalloc(ndlc->dev, st21nfcb_nci_probe()
111 ndlc->ndev = nci_allocate_device(&st21nfcb_nci_ops, protocols, st21nfcb_nci_probe()
113 if (!ndlc->ndev) { st21nfcb_nci_probe()
117 info->ndlc = ndlc; st21nfcb_nci_probe()
119 nci_set_drvdata(ndlc->ndev, info); st21nfcb_nci_probe()
121 r = nci_register_device(ndlc->ndev); st21nfcb_nci_probe()
124 nci_free_device(ndlc->ndev); st21nfcb_nci_probe()
128 return st21nfcb_se_init(ndlc->ndev); st21nfcb_nci_probe()
H A Dndlc.h52 int ndlc_open(struct llt_ndlc *ndlc);
53 void ndlc_close(struct llt_ndlc *ndlc);
54 int ndlc_send(struct llt_ndlc *ndlc, struct sk_buff *skb);
55 void ndlc_recv(struct llt_ndlc *ndlc, struct sk_buff *skb);
58 void ndlc_remove(struct llt_ndlc *ndlc);
H A Dst21nfcb.h23 #include "ndlc.h"
29 struct llt_ndlc *ndlc; member in struct:st21nfcb_nci_info
35 int st21nfcb_nci_probe(struct llt_ndlc *ndlc, int phy_headroom,
H A Di2c.c30 #include "ndlc.h"
34 /* ndlc header */
51 struct llt_ndlc *ndlc; member in struct:st21nfcb_i2c_phy
103 if (phy->ndlc->hard_fault != 0) st21nfcb_nci_i2c_write()
104 return phy->ndlc->hard_fault; st21nfcb_nci_i2c_write()
123 * Reads an ndlc frame and returns it in a newly allocated sk_buff.
184 * Reads an ndlc frame from the chip.
195 if (!phy || !phy->ndlc || irq != phy->i2c_dev->irq) { st21nfcb_nci_irq_thread_fn()
203 if (phy->ndlc->hard_fault) st21nfcb_nci_irq_thread_fn()
215 ndlc_recv(phy->ndlc, skb); st21nfcb_nci_irq_thread_fn()
338 &phy->ndlc); st21nfcb_nci_i2c_probe()
340 nfc_err(&client->dev, "Unable to register ndlc layer\n"); st21nfcb_nci_i2c_probe()
360 ndlc_remove(phy->ndlc); st21nfcb_nci_i2c_remove()
H A Dst21nfcb_se.c653 nci_hci_send_event(info->ndlc->ndev, ST21NFCB_APDU_READER_GATE, st21nfcb_se_wt_timeout()
657 nci_hci_send_event(info->ndlc->ndev, ST21NFCB_DEVICE_MGNT_GATE, st21nfcb_se_wt_timeout()
/linux-4.1.27/arch/mips/pci/
H A Dfixup-malta.c147 u8 odlc, ndlc; quirk_dlcsetup() local
151 ndlc = odlc | PIIX4_FUNC0_DLC_USBPR_EN | quirk_dlcsetup()
154 (void) pci_write_config_byte(dev, PIIX4_FUNC0_DLC, ndlc); quirk_dlcsetup()

Completed in 112 milliseconds