aboutsummaryrefslogtreecommitdiffstats
path: root/os/common/oslib/src
Commit message (Expand)AuthorAgeFilesLines
* Removed invalid assertion.Giovanni Di Sirio2017-11-271-2/+0
* git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11075 35acf78f-673a-041...Giovanni Di Sirio2017-11-241-2/+2
* Experimental preemptive round robin module. To be tested.Giovanni Di Sirio2017-11-241-0/+153
* Fixed assertion.Giovanni Di Sirio2017-11-081-1/+1
* git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10946 35acf78f-673a-041...Giovanni Di Sirio2017-11-041-2/+2
* Fixed bug #899.Giovanni Di Sirio2017-10-311-6/+10
* Added test case for dynamic buffers, fixed a problem.Giovanni Di Sirio2017-10-271-1/+1
* Fixed problems with the new factory, implemented part of its test sequence.Giovanni Di Sirio2017-10-241-34/+50
* EXPERIMENTAL: Introduced sysinterval_t in RT, now system time and intervals a...Giovanni Di Sirio2017-10-122-8/+8
* Fixed various typos and documentation-related issues.Giovanni Di Sirio2017-10-051-4/+8
* Alignment capability for memory pools.Giovanni Di Sirio2017-10-042-7/+21
* Objects FIFOs added to the factory.Giovanni Di Sirio2017-10-031-2/+92
* Mailboxes refactory for consistency.Giovanni Di Sirio2017-10-032-21/+21
* Adjustments to the new code.Giovanni Di Sirio2017-10-021-1/+0
* Added mailboxes to the factory.Giovanni Di Sirio2017-10-021-2/+85
* Changed my mind, modified types.Giovanni Di Sirio2017-10-012-3/+3
* git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10740 35acf78f-673a-041...Giovanni Di Sirio2017-10-011-2/+2
* Factory enhanced. Giovanni Di Sirio2017-10-011-140/+259
* Fixed bug #888.Giovanni Di Sirio2017-10-013-27/+42
* More renaming.Giovanni Di Sirio2017-09-261-3/+3
* Done some renaming for consistency.Giovanni Di Sirio2017-09-261-72/+67
* More factory code.Giovanni Di Sirio2017-09-261-4/+190
* Fixed two errors.Giovanni Di Sirio2017-09-251-2/+2
* OS objects factory, work in progress.Giovanni Di Sirio2017-09-251-0/+192
* Fixed problems in new mailboxes implementation.Giovanni Di Sirio2017-04-131-0/+3
* New mailboxes implementation.Giovanni Di Sirio2017-04-091-61/+145
* Fixes to the heap allocator.Giovanni Di Sirio2016-04-171-2/+2
* MISRA-related fixes.Giovanni Di Sirio2016-04-032-8/+14
* git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9225 35acf78f-673a-0410...Giovanni Di Sirio2016-04-021-6/+5
* Simulator updates, not complete.Giovanni Di Sirio2016-04-021-5/+4
* Mass license update.Giovanni Di Sirio2016-03-184-4/+4
* doc fixGiovanni Di Sirio2016-03-181-1/+1
* Added Guarded Memory Pools to RT and NIL.Giovanni Di Sirio2016-03-181-2/+137
* git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8940 35acf78f-673a-0410...Giovanni Di Sirio2016-02-241-194/+0
* git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8919 35acf78f-673a-0410...Giovanni Di Sirio2016-02-211-15/+24
* Shell reorganization.Giovanni Di Sirio2016-02-201-0/+35
* Tree reorganization.Giovanni Di Sirio2016-02-165-0/+1337
p) -{ - struct sk_buff *skb = __netdev_alloc_skb(dev, length + NET_IP_ALIGN, gfp); - - if (NET_IP_ALIGN && skb) - skb_reserve(skb, NET_IP_ALIGN); - return skb; -} - static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev, unsigned int length) { --- a/net/Kconfig +++ b/net/Kconfig @@ -25,6 +25,12 @@ menuconfig NET if NET +config ETHERNET_PACKET_MANGLE + bool + help + This option can be selected by phy drivers that need to mangle + packets going in or out of an ethernet device. + config WANT_COMPAT_NETLINK_MESSAGES bool help --- a/net/core/dev.c +++ b/net/core/dev.c @@ -2623,10 +2623,20 @@ static int xmit_one(struct sk_buff *skb, if (!list_empty(&ptype_all)) dev_queue_xmit_nit(skb, dev); - len = skb->len; - trace_net_dev_start_xmit(skb, dev); - rc = netdev_start_xmit(skb, dev, txq, more); - trace_net_dev_xmit(skb, rc, dev, len); +#ifdef CONFIG_ETHERNET_PACKET_MANGLE + if (!dev->eth_mangle_tx || + (skb = dev->eth_mangle_tx(dev, skb)) != NULL) +#else + if (1) +#endif + { + len = skb->len; + trace_net_dev_start_xmit(skb, dev); + rc = netdev_start_xmit(skb, dev, txq, more); + trace_net_dev_xmit(skb, rc, dev, len); + } else { + rc = NETDEV_TX_OK; + } return rc; } --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -63,6 +63,7 @@ #include <linux/errqueue.h> #include <linux/prefetch.h> #include <linux/if_vlan.h> +#include <linux/if.h> #include <net/protocol.h> #include <net/dst.h> @@ -451,6 +452,22 @@ struct sk_buff *__netdev_alloc_skb(struc } EXPORT_SYMBOL(__netdev_alloc_skb); +struct sk_buff *__netdev_alloc_skb_ip_align(struct net_device *dev, + unsigned int length, gfp_t gfp) +{ + struct sk_buff *skb = __netdev_alloc_skb(dev, length + NET_IP_ALIGN, gfp); + +#ifdef CONFIG_ETHERNET_PACKET_MANGLE + if (dev && (dev->priv_flags & IFF_NO_IP_ALIGN)) + return skb; +#endif + + if (NET_IP_ALIGN && skb) + skb_reserve(skb, NET_IP_ALIGN); + return skb; +} +EXPORT_SYMBOL(__netdev_alloc_skb_ip_align); + void skb_add_rx_frag(struct sk_buff *skb, int i, struct page *page, int off, int size, unsigned int truesize) { --- a/net/ethernet/eth.c +++ b/net/ethernet/eth.c @@ -188,6 +188,12 @@ __be16 eth_type_trans(struct sk_buff *sk const struct ethhdr *eth; skb->dev = dev; + +#ifdef CONFIG_ETHERNET_PACKET_MANGLE + if (dev->eth_mangle_rx) + dev->eth_mangle_rx(dev, skb); +#endif + skb_reset_mac_header(skb); skb_pull_inline(skb, ETH_HLEN); eth = eth_hdr(skb);