aboutsummaryrefslogtreecommitdiff
path: root/include/linux/parport.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/parport.h')
0 files changed, 0 insertions, 0 deletions
net_list_mutex); static struct vnet_port *__tx_port_find(struct vnet *vp, struct sk_buff *skb) { unsigned int hash = vnet_hashfn(skb->data); struct hlist_head *hp = &vp->port_hash[hash]; struct vnet_port *port; hlist_for_each_entry_rcu(port, hp, hash) { if (!sunvnet_port_is_up_common(port)) continue; if (ether_addr_equal(port->raddr, skb->data)) return port; } list_for_each_entry_rcu(port, &vp->port_list, list) { if (!port->switch_port) continue; if (!sunvnet_port_is_up_common(port)) continue; return port; } return NULL; } /* func arg to vnet_start_xmit_common() to get the proper tx port */ static struct vnet_port *vnet_tx_port_find(struct sk_buff *skb, struct net_device *dev) { struct vnet *vp = netdev_priv(dev); return __tx_port_find(vp, skb); } static u16 vnet_select_queue(struct net_device *dev, struct sk_buff *skb, struct net_device *sb_dev) { struct vnet *vp = netdev_priv(dev); struct vnet_port *port = __tx_port_find(vp, skb); if (!port) return 0; return port->q_index; } /* Wrappers to common functions */ static netdev_tx_t vnet_start_xmit(struct sk_buff *skb, struct net_device *dev) { return sunvnet_start_xmit_common(skb, dev, vnet_tx_port_find); } static void vnet_set_rx_mode(struct net_device *dev) { struct vnet *vp = netdev_priv(dev); return sunvnet_set_rx_mode_common(dev, vp); } #ifdef CONFIG_NET_POLL_CONTROLLER static void vnet_poll_controller(struct net_device *dev) { struct vnet *vp = netdev_priv(dev); return sunvnet_poll_controller_common(dev, vp); } #endif static const struct net_device_ops vnet_ops = { .ndo_open = sunvnet_open_common, .ndo_stop = sunvnet_close_common, .ndo_set_rx_mode = vnet_set_rx_mode, .ndo_set_mac_address = sunvnet_set_mac_addr_common, .ndo_validate_addr = eth_validate_addr, .ndo_tx_timeout = sunvnet_tx_timeout_common, .ndo_start_xmit = vnet_start_xmit, .ndo_select_queue = vnet_select_queue, #ifdef CONFIG_NET_POLL_CONTROLLER .ndo_poll_controller = vnet_poll_controller, #endif }; static struct vnet *vnet_new(const u64 *local_mac, struct vio_dev *vdev) { struct net_device *dev; u8 addr[ETH_ALEN]; struct vnet *vp; int err, i; dev = alloc_etherdev_mqs(sizeof(*vp), VNET_MAX_TXQS, 1); if (!dev) return ERR_PTR(-ENOMEM); dev->needed_headroom = VNET_PACKET_SKIP + 8; dev->needed_tailroom = 8; for (i = 0; i < ETH_ALEN; i++) addr[i] = (*local_mac >> (5 - i) * 8) & 0xff; eth_hw_addr_set(dev, addr); vp = netdev_priv(dev); spin_lock