Lines Matching refs:proto
56 BUG_ON(!hdlc->proto->netif_rx); in hdlc_rcv()
57 return hdlc->proto->netif_rx(skb); in hdlc_rcv()
64 if (hdlc->proto->xmit) in hdlc_start_xmit()
65 return hdlc->proto->xmit(skb, dev); in hdlc_start_xmit()
73 if (hdlc->proto->start) in hdlc_proto_start()
74 hdlc->proto->start(dev); in hdlc_proto_start()
82 if (hdlc->proto->stop) in hdlc_proto_stop()
83 hdlc->proto->stop(dev); in hdlc_proto_stop()
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()
189 if (hdlc->proto->close) in hdlc_close()
190 hdlc->proto->close(dev); in hdlc_close()
197 struct hdlc_proto *proto = first_proto; in hdlc_ioctl() local
203 if (dev_to_hdlc(dev)->proto) { in hdlc_ioctl()
204 result = dev_to_hdlc(dev)->proto->ioctl(dev, ifr); in hdlc_ioctl()
211 while (proto) { in hdlc_ioctl()
212 if ((result = proto->ioctl(dev, ifr)) != -EINVAL) in hdlc_ioctl()
214 proto = proto->next; in hdlc_ioctl()
267 int attach_hdlc_protocol(struct net_device *dev, struct hdlc_proto *proto, in attach_hdlc_protocol() argument
276 if (!try_module_get(proto->module)) in attach_hdlc_protocol()
282 module_put(proto->module); in attach_hdlc_protocol()
286 dev_to_hdlc(dev)->proto = proto; in attach_hdlc_protocol()
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()
318 void register_hdlc_protocol(struct hdlc_proto *proto) in register_hdlc_protocol() argument
321 proto->next = first_proto; in register_hdlc_protocol()
322 first_proto = proto; in register_hdlc_protocol()
327 void unregister_hdlc_protocol(struct hdlc_proto *proto) in unregister_hdlc_protocol() argument
333 while (*p != proto) { in unregister_hdlc_protocol()
337 *p = proto->next; in unregister_hdlc_protocol()