static void br_pass_frame_up(struct net_bridge *br, struct sk_buff *skb)
{
	struct net_device *indev, *brdev = br->dev;

#if defined(CONFIG_MIPS_BRCM) && defined(CONFIG_BLOG)
	blog_link(IF_DEVICE, blog_ptr(skb), (void*)br->dev, DIR_RX, skb->len);
#endif

#if defined(CONFIG_BR_IGMP_STATISTIC)
    if ( !is_multicast_ether_addr(eth_hdr(skb)->h_dest) )
    {
        if ( IS_LAN_DEV(skb->dev->name) )
        {
            /* 上行流转发设备数据报文统计 */
            br_igmp_statistic_inc(skb,IGMP_UP_REQUEST_PACKET);
        }
    }
#endif    
	brdev->stats.rx_packets++;
	brdev->stats.rx_bytes += skb->len;

	indev = skb->dev;
    /* add lan interface (eth0.5) in iptables 20090217 */
    skb->lanindev = indev;
	skb->dev = brdev;

	NF_HOOK(PF_BRIDGE, NF_BR_LOCAL_IN, skb, indev, NULL,
		netif_receive_skb);
}
Beispiel #2
0
static void br_pass_frame_up(struct net_bridge *br, struct sk_buff *skb)
{
	struct net_device *indev, *brdev = br->dev;

#if defined(CONFIG_MIPS_BRCM) && defined(CONFIG_BLOG)
	blog_link(IF_DEVICE, blog_ptr(skb), (void*)br->dev, DIR_RX, skb->len);
#endif

	brdev->stats.rx_packets++;
	brdev->stats.rx_bytes += skb->len;

	indev = skb->dev;
	skb->dev = brdev;

	NF_HOOK(PF_BRIDGE, NF_BR_LOCAL_IN, skb, indev, NULL,
		netif_receive_skb);
}
static int vlan_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
	struct net_device_stats *stats = &dev->stats;
	struct vlan_ethhdr *veth = (struct vlan_ethhdr *)(skb->data);

	/* Handle non-VLAN frames if they are sent to us, for example by DHCP.
	 *
	 * NOTE: THIS ASSUMES DIX ETHERNET, SPECIFICALLY NOT SUPPORTING
	 * OTHER THINGS LIKE FDDI/TokenRing/802.3 SNAPs...
	 */
	if (veth->h_vlan_proto != htons(ETH_P_8021Q) ||
	    vlan_dev_info(dev)->flags & VLAN_FLAG_REORDER_HDR) {
		unsigned int orig_headroom = skb_headroom(skb);
		u16 vlan_tci;

		vlan_dev_info(dev)->cnt_encap_on_xmit++;

		vlan_tci = vlan_dev_info(dev)->vlan_id;
		vlan_tci |= vlan_dev_get_egress_qos_mask(dev, skb);
        /* 802.1p remark */
        /*Start of modified by f00120964 for qos function 2012-1-6*/
#if defined(CONFIG_IMQ) && !defined(CONFIG_DT_QOS)
        /* mark -----|-----|-------|------|-------|-----|------|------  */
        /* START OF Add: t00163975 2011-05-21 FOR 移植BCM Eth上行的QoS */
        /* START Modify by l00184769 20110708 把原来的为hhb3写的else分支去掉,使得与通用代码一致 */
        /* BCM Eth qos     lan |dscp |default|  wmm |      |802.1p|policer|queue */
        /* IMQ QOS |802.1p|queue|policer */
        if (skb->mark & 0x10)        
        {            
            vlan_tci = ((vlan_tci & 0x1fff) | ((skb->mark & 0xe0) << 8));        
        }
        /* END Modify by l00184769 20110708 把原来的为hhb3写的else分支去掉,使得与通用代码一致 */
        /* END OF Add: t00163975 2011-05-21 */

    	if (__constant_htons(ETH_P_PPP_SES) == skb->protocol) 
    	{
            /* PPP_LCP = 0xc021 802.1p mark 7 */
    	    if ((0xc0 == skb->data[20]) && (0x21 == skb->data[21]))
            {
                vlan_tci = ((vlan_tci & 0x1fff) | (0xe000));
            }
    	}        
#endif

#ifdef CONFIG_DT_QOS
	vlan_tci |= (s_dtQosMarkto8021P[(skb->mark & 0x7)] << 13);
#endif

	 /*End of modified by f00120964 for qos function 2012-1-6*/
#ifdef CONFIG_BCM96362
        /* |lan |dscp |default|wmm |    |802.1p|policer|queue| */
        if (skb->mark & 0x100)        
        {            
            vlan_tci = ((vlan_tci & 0x1fff) | ((skb->mark & 0xe00) << 4));        
        }
#endif

		skb = __vlan_put_tag(skb, vlan_tci);
		if (!skb) {
			stats->tx_dropped++;
			return NETDEV_TX_OK;
		}

		if (orig_headroom < VLAN_HLEN)
			vlan_dev_info(dev)->cnt_inc_headroom_on_tx++;
	}
	
/* Start of add by z00202017 2011/12/28 for Internet LED */
#if defined(CONFIG_BCM963268) && defined(CONFIG_BLOG)
    blog_link(IF_DEVICE, blog_ptr(skb), (void*)dev, DIR_TX, skb->len );
#endif
/* End of add by z00202017 2011/12/28 for Internet LED */

	stats->tx_packets++;
	stats->tx_bytes += skb->len;

	skb->dev = vlan_dev_info(dev)->real_dev;
	dev_queue_xmit(skb);
	return NETDEV_TX_OK;
}