aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/lantiq/ltq-ptm
diff options
context:
space:
mode:
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>2020-05-13 14:00:57 +0200
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>2020-05-17 18:35:51 +0200
commitb510ab513e19a0ee4371aa23bb1a9f50aa2101e8 (patch)
treee12df8a820808a6ca2d1e95161935aad93cf7829 /package/kernel/lantiq/ltq-ptm
parentc00b2df6c8e421ea7aa96f53178dc85db99f2305 (diff)
downloadupstream-b510ab513e19a0ee4371aa23bb1a9f50aa2101e8.tar.gz
upstream-b510ab513e19a0ee4371aa23bb1a9f50aa2101e8.tar.bz2
upstream-b510ab513e19a0ee4371aa23bb1a9f50aa2101e8.zip
kernel: drop outdated kernel version switches for local code
This drops kernel version switches for versions not supported by OpenWrt master at the moment. This only adjusts local code, but doesn't touch patches to existing external packages. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Diffstat (limited to 'package/kernel/lantiq/ltq-ptm')
-rw-r--r--package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c40
-rw-r--r--package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c35
-rw-r--r--package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vr9.c2
3 files changed, 0 insertions, 77 deletions
diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c
index 186c848693..18c715a290 100644
--- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c
+++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c
@@ -61,12 +61,8 @@
* Kernel Version Adaption
* ####################################
*/
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11)
#define MODULE_PARM_ARRAY(a, b) module_param_array(a, int, NULL, 0)
#define MODULE_PARM(a, b) module_param(a, int, 0)
-#else
- #define MODULE_PARM_ARRAY(a, b) MODULE_PARM(a, b)
-#endif
@@ -130,9 +126,6 @@ static int ptm_stop(struct net_device *);
static unsigned int ptm_poll(int, unsigned int);
static int ptm_napi_poll(struct napi_struct *, int);
static int ptm_hard_start_xmit(struct sk_buff *, struct net_device *);
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0))
-static int ptm_change_mtu(struct net_device *, int);
-#endif
static int ptm_ioctl(struct net_device *, struct ifreq *, int);
static void ptm_tx_timeout(struct net_device *);
@@ -243,7 +236,6 @@ static INLINE void init_tables(void);
static struct ptm_priv_data g_ptm_priv_data;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)
static struct net_device_ops g_ptm_netdev_ops = {
.ndo_get_stats = ptm_get_stats,
.ndo_open = ptm_open,
@@ -251,13 +243,9 @@ static struct net_device_ops g_ptm_netdev_ops = {
.ndo_start_xmit = ptm_hard_start_xmit,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_mac_address = eth_mac_addr,
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0))
- .ndo_change_mtu = ptm_change_mtu,
-#endif
.ndo_do_ioctl = ptm_ioctl,
.ndo_tx_timeout = ptm_tx_timeout,
};
-#endif
static struct net_device *g_net_dev[2] = {0};
static char *g_net_dev_name[2] = {"dsl0", "dslfast0"};
@@ -291,10 +279,8 @@ static void ptm_setup(struct net_device *dev, int ndev)
/* hook network operations */
dev->netdev_ops = &g_ptm_netdev_ops;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
/* Allow up to 1508 bytes, for RFC4638 */
dev->max_mtu = ETH_DATA_LEN + 8;
-#endif
netif_napi_add(dev, &g_ptm_priv_data.itf[ndev].napi, ptm_napi_poll, 25);
dev->watchdog_timeo = ETH_WATCHDOG_TIMEOUT;
@@ -415,11 +401,7 @@ static int ptm_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
/* allocate descriptor */
desc_base = get_tx_desc(ndev, &f_full);
if ( f_full ) {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
netif_trans_update(dev);
-#else
- dev->trans_start = jiffies;
-#endif
netif_stop_queue(dev);
IFX_REG_W32_MASK(0, 1 << (ndev + 16), MBOX_IGU1_ISRC);
@@ -453,11 +435,7 @@ static int ptm_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
g_ptm_priv_data.itf[ndev].stats.tx_packets++;
g_ptm_priv_data.itf[ndev].stats.tx_bytes += reg_desc.datalen;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
netif_trans_update(dev);
-#else
- dev->trans_start = jiffies;
-#endif
mailbox_signal(ndev, 1);
adsl_led_flash();
@@ -469,16 +447,6 @@ PTM_HARD_START_XMIT_FAIL:
g_ptm_priv_data.itf[ndev].stats.tx_dropped++;
return NETDEV_TX_OK;
}
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0))
-static int ptm_change_mtu(struct net_device *dev, int mtu)
-{
- /* Allow up to 1508 bytes, for RFC4638 */
- if (mtu < 68 || mtu > ETH_DATA_LEN + 8)
- return -EINVAL;
- dev->mtu = mtu;
- return 0;
-}
-#endif
static int ptm_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
@@ -665,10 +633,6 @@ static INLINE int mailbox_rx_irq_handler(unsigned int ch) // return: < 0 - de
skb->dev = g_net_dev[ndev];
skb->protocol = eth_type_trans(skb, skb->dev);
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0))
- g_net_dev[ndev]->last_rx = jiffies;
-#endif
-
netif_rx_ret = netif_receive_skb(skb);
if ( netif_rx_ret != NET_RX_DROP ) {
@@ -1513,11 +1477,7 @@ static int ltq_ptm_probe(struct platform_device *pdev)
}
/* register interrupt handler */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0)
ret = request_irq(PPE_MAILBOX_IGU1_INT, mailbox_irq_handler, 0, "ptm_mailbox_isr", &g_ptm_priv_data);
-#else
- ret = request_irq(PPE_MAILBOX_IGU1_INT, mailbox_irq_handler, IRQF_DISABLED, "ptm_mailbox_isr", &g_ptm_priv_data);
-#endif
if ( ret ) {
if ( ret == -EBUSY ) {
err("IRQ may be occupied by other driver, please reconfig to disable it.");
diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c
index 46a52e29d8..f77f475656 100644
--- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c
+++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c
@@ -76,9 +76,6 @@ static int ptm_stop(struct net_device *);
static unsigned int ptm_poll(int, unsigned int);
static int ptm_napi_poll(struct napi_struct *, int);
static int ptm_hard_start_xmit(struct sk_buff *, struct net_device *);
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0))
-static int ptm_change_mtu(struct net_device *, int);
-#endif
static int ptm_ioctl(struct net_device *, struct ifreq *, int);
static void ptm_tx_timeout(struct net_device *);
@@ -119,9 +116,6 @@ static struct net_device_ops g_ptm_netdev_ops = {
.ndo_start_xmit = ptm_hard_start_xmit,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_mac_address = eth_mac_addr,
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0))
- .ndo_change_mtu = ptm_change_mtu,
-#endif
.ndo_do_ioctl = ptm_ioctl,
.ndo_tx_timeout = ptm_tx_timeout,
};
@@ -147,10 +141,8 @@ static void ptm_setup(struct net_device *dev, int ndev)
netif_carrier_off(dev);
dev->netdev_ops = &g_ptm_netdev_ops;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
/* Allow up to 1508 bytes, for RFC4638 */
dev->max_mtu = ETH_DATA_LEN + 8;
-#endif
netif_napi_add(dev, &g_ptm_priv_data.itf[ndev].napi, ptm_napi_poll, 16);
dev->watchdog_timeo = ETH_WATCHDOG_TIMEOUT;
@@ -228,10 +220,6 @@ static unsigned int ptm_poll(int ndev, unsigned int work_to_do)
skb->dev = g_net_dev[0];
skb->protocol = eth_type_trans(skb, skb->dev);
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0))
- g_net_dev[0]->last_rx = jiffies;
-#endif
-
netif_receive_skb(skb);
g_ptm_priv_data.itf[0].stats.rx_packets++;
@@ -301,11 +289,7 @@ static int ptm_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
/* allocate descriptor */
desc_base = get_tx_desc(0, &f_full);
if ( f_full ) {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
netif_trans_update(dev);
-#else
- dev->trans_start = jiffies;
-#endif
netif_stop_queue(dev);
IFX_REG_W32_MASK(0, 1 << 17, MBOX_IGU1_ISRC);
@@ -367,11 +351,7 @@ static int ptm_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
wmb();
*(volatile unsigned int *)desc = *(unsigned int *)&reg_desc;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
netif_trans_update(dev);
-#else
- dev->trans_start = jiffies;
-#endif
return 0;
@@ -382,17 +362,6 @@ PTM_HARD_START_XMIT_FAIL:
return 0;
}
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0))
-static int ptm_change_mtu(struct net_device *dev, int mtu)
-{
- /* Allow up to 1508 bytes, for RFC4638 */
- if (mtu < 68 || mtu > ETH_DATA_LEN + 8)
- return -EINVAL;
- dev->mtu = mtu;
- return 0;
-}
-#endif
-
static int ptm_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
ASSERT(dev == g_net_dev[0], "incorrect device");
@@ -1024,11 +993,7 @@ static int ltq_ptm_probe(struct platform_device *pdev)
}
/* register interrupt handler */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0)
ret = request_irq(PPE_MAILBOX_IGU1_INT, mailbox_irq_handler, 0, "ptm_mailbox_isr", &g_ptm_priv_data);
-#else
- ret = request_irq(PPE_MAILBOX_IGU1_INT, mailbox_irq_handler, IRQF_DISABLED, "ptm_mailbox_isr", &g_ptm_priv_data);
-#endif
if ( ret ) {
if ( ret == -EBUSY ) {
err("IRQ may be occupied by other driver, please reconfig to disable it.");
diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vr9.c b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vr9.c
index cf0897b563..bf93437fb0 100644
--- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vr9.c
+++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vr9.c
@@ -84,7 +84,6 @@ static inline void uninit_pmu(void)
static inline void reset_ppe(struct platform_device *pdev)
{
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)
struct device *dev = &pdev->dev;
struct reset_control *dsp;
struct reset_control *dfe;
@@ -121,7 +120,6 @@ static inline void reset_ppe(struct platform_device *pdev)
udelay(1000);
*PP32_SRST |= 0x000303CF;
udelay(1000);
-#endif
}
static inline void init_pdma(void)