Lines Matching refs:hdlc
49 struct hdlc_device *hdlc = dev_to_hdlc(dev); in hdlc_rcv() local
56 BUG_ON(!hdlc->proto->netif_rx); in hdlc_rcv()
57 return hdlc->proto->netif_rx(skb); in hdlc_rcv()
62 hdlc_device *hdlc = dev_to_hdlc(dev); in hdlc_start_xmit() local
64 if (hdlc->proto->xmit) in hdlc_start_xmit()
65 return hdlc->proto->xmit(skb, dev); in hdlc_start_xmit()
67 return hdlc->xmit(skb, dev); /* call hardware driver directly */ in hdlc_start_xmit()
72 hdlc_device *hdlc = dev_to_hdlc(dev); in hdlc_proto_start() local
73 if (hdlc->proto->start) in hdlc_proto_start()
74 hdlc->proto->start(dev); in hdlc_proto_start()
81 hdlc_device *hdlc = dev_to_hdlc(dev); in hdlc_proto_stop() local
82 if (hdlc->proto->stop) in hdlc_proto_stop()
83 hdlc->proto->stop(dev); in hdlc_proto_stop()
92 hdlc_device *hdlc; in hdlc_device_event() local
112 hdlc = dev_to_hdlc(dev); in hdlc_device_event()
113 spin_lock_irqsave(&hdlc->state_lock, flags); in hdlc_device_event()
115 if (hdlc->carrier == on) in hdlc_device_event()
118 hdlc->carrier = on; in hdlc_device_event()
120 if (!hdlc->open) in hdlc_device_event()
123 if (hdlc->carrier) { in hdlc_device_event()
132 spin_unlock_irqrestore(&hdlc->state_lock, flags); in hdlc_device_event()
141 hdlc_device *hdlc = dev_to_hdlc(dev); in hdlc_open() local
144 hdlc->carrier, hdlc->open); in hdlc_open()
147 if (hdlc->proto == NULL) in hdlc_open()
150 if (hdlc->proto->open) { in hdlc_open()
151 int result = hdlc->proto->open(dev); in hdlc_open()
156 spin_lock_irq(&hdlc->state_lock); in hdlc_open()
158 if (hdlc->carrier) { in hdlc_open()
164 hdlc->open = 1; in hdlc_open()
166 spin_unlock_irq(&hdlc->state_lock); in hdlc_open()
175 hdlc_device *hdlc = dev_to_hdlc(dev); in hdlc_close() local
178 hdlc->carrier, hdlc->open); in hdlc_close()
181 spin_lock_irq(&hdlc->state_lock); in hdlc_close()
183 hdlc->open = 0; in hdlc_close()
184 if (hdlc->carrier) in hdlc_close()
187 spin_unlock_irq(&hdlc->state_lock); in hdlc_close()
189 if (hdlc->proto->close) in hdlc_close()
190 hdlc->proto->close(dev); in hdlc_close()
239 hdlc_device *hdlc = dev_to_hdlc(dev); in hdlc_setup() local
242 hdlc->carrier = 1; in hdlc_setup()
243 hdlc->open = 0; in hdlc_setup()
244 spin_lock_init(&hdlc->state_lock); in hdlc_setup()
294 hdlc_device *hdlc = dev_to_hdlc(dev); in detach_hdlc_protocol() local
297 if (hdlc->proto) { in detach_hdlc_protocol()
305 if (hdlc->proto->detach) in detach_hdlc_protocol()
306 hdlc->proto->detach(dev); in detach_hdlc_protocol()
307 module_put(hdlc->proto->module); in detach_hdlc_protocol()
308 hdlc->proto = NULL; in detach_hdlc_protocol()
310 kfree(hdlc->state); in detach_hdlc_protocol()
311 hdlc->state = NULL; in detach_hdlc_protocol()