summaryrefslogtreecommitdiff
path: root/target/linux/ifxmips/files/drivers
diff options
context:
space:
mode:
authorblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>2008-06-23 20:31:34 +0000
committerblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>2008-06-23 20:31:34 +0000
commit43ba67e0d51fc116099a5556191bf09669cd8601 (patch)
tree25c05a6bee226287770bec7f7b289677693fdc61 /target/linux/ifxmips/files/drivers
parent9f4462d8018a0fb81250ca682a78480d3e0edf3d (diff)
lots of code cleanup for ifxmips
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@11570 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ifxmips/files/drivers')
-rw-r--r--target/linux/ifxmips/files/drivers/char/ifxmips_ssc.c14
-rw-r--r--target/linux/ifxmips/files/drivers/mtd/maps/ifxmips.c80
-rw-r--r--target/linux/ifxmips/files/drivers/net/ifxmips_mii0.c154
-rw-r--r--target/linux/ifxmips/files/drivers/serial/ifxmips_asc.c4
4 files changed, 110 insertions, 142 deletions
diff --git a/target/linux/ifxmips/files/drivers/char/ifxmips_ssc.c b/target/linux/ifxmips/files/drivers/char/ifxmips_ssc.c
index 7b55a4d1d1..35b32e8529 100644
--- a/target/linux/ifxmips/files/drivers/char/ifxmips_ssc.c
+++ b/target/linux/ifxmips/files/drivers/char/ifxmips_ssc.c
@@ -73,7 +73,7 @@ static unsigned int ifx_ssc_get_kernel_clk (struct ifx_ssc_port *info);
static void tx_int (struct ifx_ssc_port *);
extern unsigned int ifxmips_get_fpi_hz (void);
-extern void mask_and_ack_ifxmips_irq (unsigned int irq_nr);
+extern void ifxmips_mask_and_ack_irq (unsigned int irq_nr);
static inline unsigned int
ifx_ssc_get_kernel_clk (struct ifx_ssc_port *info)
@@ -297,9 +297,9 @@ ifx_ssc_abort (struct ifx_ssc_port *info)
wake_up_interruptible (&info->rwait);
// clear pending int's
- mask_and_ack_ifxmips_irq(IFXMIPS_SSC_RIR);
- mask_and_ack_ifxmips_irq(IFXMIPS_SSC_TIR);
- mask_and_ack_ifxmips_irq(IFXMIPS_SSC_EIR);
+ ifxmips_mask_and_ack_irq(IFXMIPS_SSC_RIR);
+ ifxmips_mask_and_ack_irq(IFXMIPS_SSC_TIR);
+ ifxmips_mask_and_ack_irq(IFXMIPS_SSC_EIR);
// clear error flags
ifxmips_w32(IFX_SSC_WHBSTATE_CLR_ALL_ERROR, IFXMIPS_SSC_WHBSTATE);
@@ -354,9 +354,9 @@ ifx_ssc_open (struct inode *inode, struct file *filp)
ifxmips_w32(IFX_SSC_WHBSTATE_CLR_ALL_ERROR, IFXMIPS_SSC_WHBSTATE);
// clear pending interrupts
- mask_and_ack_ifxmips_irq(IFXMIPS_SSC_RIR);
- mask_and_ack_ifxmips_irq(IFXMIPS_SSC_TIR);
- mask_and_ack_ifxmips_irq(IFXMIPS_SSC_EIR);
+ ifxmips_mask_and_ack_irq(IFXMIPS_SSC_RIR);
+ ifxmips_mask_and_ack_irq(IFXMIPS_SSC_TIR);
+ ifxmips_mask_and_ack_irq(IFXMIPS_SSC_EIR);
ifxmips_w32(IFX_SSC_WHBSTATE_SET_ENABLE, IFXMIPS_SSC_WHBSTATE);
diff --git a/target/linux/ifxmips/files/drivers/mtd/maps/ifxmips.c b/target/linux/ifxmips/files/drivers/mtd/maps/ifxmips.c
index cbfbc3e593..b38c6269bd 100644
--- a/target/linux/ifxmips/files/drivers/mtd/maps/ifxmips.c
+++ b/target/linux/ifxmips/files/drivers/mtd/maps/ifxmips.c
@@ -1,6 +1,4 @@
/*
- * Driver for IFXMIPS flashmap
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -16,7 +14,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Copyright (C) 2004 Liu Peng Infineon IFAP DC COM CPE
- * Copyright (C) 2007 John Crispin <blogic@openwrt.org>
+ * Copyright (C) 2008 John Crispin <blogic@openwrt.org>
*/
#include <linux/module.h>
@@ -32,17 +30,16 @@
#include <linux/magic.h>
#include <linux/platform_device.h>
-#define DRVNAME "ifxmips_mtd"
static struct map_info
ifxmips_map = {
- .name = DRVNAME,
+ .name = "ifxmips_mtd",
.bankwidth = 2,
.size = 0x400000,
};
static map_word
-ifxmips_read16 (struct map_info * map, unsigned long adr)
+ifxmips_read16(struct map_info * map, unsigned long adr)
{
map_word temp;
@@ -53,34 +50,33 @@ ifxmips_read16 (struct map_info * map, unsigned long adr)
}
static void
-ifxmips_write16 (struct map_info *map, map_word d, unsigned long adr)
+ifxmips_write16(struct map_info *map, map_word d, unsigned long adr)
{
adr ^= 2;
*((__u16 *) (map->virt + adr)) = d.x[0];
}
void
-ifxmips_copy_from (struct map_info *map, void *to, unsigned long from, ssize_t len)
+ifxmips_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
{
- u8 *p;
- u8 *to_8;
+ unsigned char *p;
+ unsigned char *to_8;
- from = (unsigned long) (from + map->virt);
- p = (u8 *) from;
- to_8 = (u8 *) to;
- while(len--){
+ from = (unsigned long)(from + map->virt);
+ p = (unsigned char*) from;
+ to_8 = (unsigned char*) to;
+ while(len--)
*to_8++ = *p++;
- }
}
void
-ifxmips_copy_to (struct map_info *map, unsigned long to, const void *from, ssize_t len)
+ifxmips_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len)
{
- u8 *p = (u8*) from;
- u8 *to_8;
+ unsigned char *p = (unsigned char*)from;
+ unsigned char *to_8;
to += (unsigned long) map->virt;
- to_8 = (u8*)to;
+ to_8 = (unsigned char*)to;
while(len--){
*p++ = *to_8++;
}
@@ -111,16 +107,16 @@ ifxmips_partitions[4] = {
};
int
-find_uImage_size (unsigned long start_offset){
+find_uImage_size(unsigned long start_offset){
unsigned long temp;
ifxmips_copy_from(&ifxmips_map, &temp, start_offset + 12, 4);
- printk(KERN_INFO DRVNAME ": kernel size is %ld \n", temp + 0x40);
+ printk(KERN_INFO "ifxmips_mtd: kernel size is %ld \n", temp + 0x40);
return temp + 0x40;
}
int
-detect_squashfs_partition (unsigned long start_offset){
+detect_squashfs_partition(unsigned long start_offset){
unsigned long temp;
ifxmips_copy_from(&ifxmips_map, &temp, start_offset, 4);
@@ -129,7 +125,7 @@ detect_squashfs_partition (unsigned long start_offset){
}
static int
-ifxmips_mtd_probe (struct platform_device *dev)
+ifxmips_mtd_probe(struct platform_device *dev)
{
struct mtd_info *ifxmips_mtd = NULL;
struct mtd_partition *parts = NULL;
@@ -145,15 +141,17 @@ ifxmips_mtd_probe (struct platform_device *dev)
ifxmips_map.phys = IFXMIPS_FLASH_START;
ifxmips_map.virt = ioremap_nocache(IFXMIPS_FLASH_START, IFXMIPS_FLASH_MAX);
ifxmips_map.size = IFXMIPS_FLASH_MAX;
- if (!ifxmips_map.virt) {
- printk(KERN_WARNING DRVNAME ": failed to ioremap!\n");
+ if(!ifxmips_map.virt)
+ {
+ printk(KERN_WARNING "ifxmips_mtd: failed to ioremap!\n");
return -EIO;
}
ifxmips_mtd = (struct mtd_info *) do_map_probe("cfi_probe", &ifxmips_map);
- if (!ifxmips_mtd) {
+ if(!ifxmips_mtd)
+ {
iounmap(ifxmips_map.virt);
- printk(KERN_WARNING DRVNAME ": probing failed\n");
+ printk(KERN_WARNING "ifxmips_mtd: probing failed\n");
return -ENXIO;
}
@@ -161,8 +159,9 @@ ifxmips_mtd_probe (struct platform_device *dev)
uimage_size = find_uImage_size(ifxmips_partitions[2].offset);
- if(detect_squashfs_partition(ifxmips_partitions[2].offset + uimage_size)){
- printk(KERN_INFO DRVNAME ": found a squashfs following the uImage\n");
+ if(detect_squashfs_partition(ifxmips_partitions[2].offset + uimage_size))
+ {
+ printk(KERN_INFO "ifxmips_mtd: found a squashfs following the uImage\n");
} else {
uimage_size &= ~0xffff;
uimage_size += 0x10000;
@@ -175,7 +174,7 @@ ifxmips_mtd_probe (struct platform_device *dev)
parts = &ifxmips_partitions[0];
add_mtd_partitions(ifxmips_mtd, parts, 4);
- printk(KERN_INFO DRVNAME ": added ifxmips flash with %dMB\n", ifxmips_mtd->size >> 20);
+ printk(KERN_INFO "ifxmips_mtd: added ifxmips flash with %dMB\n", ifxmips_mtd->size >> 20);
return 0;
}
@@ -183,31 +182,30 @@ static struct
platform_driver ifxmips_mtd_driver = {
.probe = ifxmips_mtd_probe,
.driver = {
- .name = DRVNAME,
+ .name = "ifxmips_mtd",
.owner = THIS_MODULE,
},
};
int __init
-init_ifxmips_mtd (void)
+init_ifxmips_mtd(void)
{
int ret = platform_driver_register(&ifxmips_mtd_driver);
- if (ret)
- printk(KERN_INFO DRVNAME ": error registering platfom driver!");
-
+ if(ret)
+ printk(KERN_INFO "ifxmips_mtd: error registering platfom driver!");
return ret;
}
static void
__exit
-cleanup_ifxmips_mtd (void)
+cleanup_ifxmips_mtd(void)
{
platform_driver_unregister(&ifxmips_mtd_driver);
}
-module_init (init_ifxmips_mtd);
-module_exit (cleanup_ifxmips_mtd);
+module_init(init_ifxmips_mtd);
+module_exit(cleanup_ifxmips_mtd);
-MODULE_LICENSE ("GPL");
-MODULE_AUTHOR ("John Crispin <blogic@openwrt.org>");
-MODULE_DESCRIPTION ("MTD map driver for IFXMIPS boards");
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("John Crispin <blogic@openwrt.org>");
+MODULE_DESCRIPTION("MTD map driver for IFXMIPS boards");
diff --git a/target/linux/ifxmips/files/drivers/net/ifxmips_mii0.c b/target/linux/ifxmips/files/drivers/net/ifxmips_mii0.c
index c62936046d..7f53d64d4f 100644
--- a/target/linux/ifxmips/files/drivers/net/ifxmips_mii0.c
+++ b/target/linux/ifxmips/files/drivers/net/ifxmips_mii0.c
@@ -1,6 +1,4 @@
/*
- * drivers/net/ifxmips_mii0.c
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -15,13 +13,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
- * Copyright (C) 2005 Infineon
- *
- * Rewrite of Infineon IFXMips code, thanks to infineon for the support,
- * software and hardware
- *
- * Copyright (C) 2007 John Crispin <blogic@openwrt.org>
- *
+ * Copyright (C) 2005 Wu Qi Ming <Qi-Ming.Wu@infineon.com>
+ * Copyright (C) 2008 John Crispin <blogic@openwrt.org>
*/
#include <linux/kernel.h>
@@ -53,91 +46,87 @@ static struct net_device *ifxmips_mii0_dev;
static unsigned char u_boot_ethaddr[MAX_ADDR_LEN];
void
-ifxmips_write_mdio (u32 phy_addr, u32 phy_reg, u16 phy_data)
+ifxmips_write_mdio(u32 phy_addr, u32 phy_reg, u16 phy_data)
{
u32 val = MDIO_ACC_REQUEST |
((phy_addr & MDIO_ACC_ADDR_MASK) << MDIO_ACC_ADDR_OFFSET) |
((phy_reg & MDIO_ACC_REG_MASK) << MDIO_ACC_REG_OFFSET) |
phy_data;
- while (ifxmips_r32(IFXMIPS_PPE32_MDIO_ACC) & MDIO_ACC_REQUEST);
+ while(ifxmips_r32(IFXMIPS_PPE32_MDIO_ACC) & MDIO_ACC_REQUEST);
ifxmips_w32(val, IFXMIPS_PPE32_MDIO_ACC);
}
unsigned short
-ifxmips_read_mdio (u32 phy_addr, u32 phy_reg)
+ifxmips_read_mdio(u32 phy_addr, u32 phy_reg)
{
u32 val = MDIO_ACC_REQUEST | MDIO_ACC_READ |
((phy_addr & MDIO_ACC_ADDR_MASK) << MDIO_ACC_ADDR_OFFSET) |
((phy_reg & MDIO_ACC_REG_MASK) << MDIO_ACC_REG_OFFSET);
ifxmips_w32(val, IFXMIPS_PPE32_MDIO_ACC);
- while (ifxmips_r32(IFXMIPS_PPE32_MDIO_ACC) & MDIO_ACC_REQUEST){};
+ while(ifxmips_r32(IFXMIPS_PPE32_MDIO_ACC) & MDIO_ACC_REQUEST){};
val = ifxmips_r32(IFXMIPS_PPE32_MDIO_ACC) & MDIO_ACC_VAL_MASK;
-
return val;
}
int
-ifxmips_switch_open (struct net_device *dev)
+ifxmips_ifxmips_mii_open(struct net_device *dev)
{
- struct switch_priv* priv = (struct switch_priv*)dev->priv;
+ struct ifxmips_mii_priv* priv = (struct ifxmips_mii_priv*)dev->priv;
struct dma_device_info* dma_dev = priv->dma_device;
int i;
- for (i = 0; i < dma_dev->max_rx_chan_num; i++)
+ for(i = 0; i < dma_dev->max_rx_chan_num; i++)
{
- if ((dma_dev->rx_chan[i])->control == IFXMIPS_DMA_CH_ON)
+ if((dma_dev->rx_chan[i])->control == IFXMIPS_DMA_CH_ON)
(dma_dev->rx_chan[i])->open(dma_dev->rx_chan[i]);
}
-
netif_start_queue(dev);
-
return 0;
}
int
-switch_release (struct net_device *dev){
- struct switch_priv* priv = (struct switch_priv*)dev->priv;
+ifxmips_mii_release(struct net_device *dev){
+ struct ifxmips_mii_priv* priv = (struct ifxmips_mii_priv*)dev->priv;
struct dma_device_info* dma_dev = priv->dma_device;
int i;
- for (i = 0; i < dma_dev->max_rx_chan_num; i++)
+ for(i = 0; i < dma_dev->max_rx_chan_num; i++)
dma_dev->rx_chan[i]->close(dma_dev->rx_chan[i]);
-
netif_stop_queue(dev);
-
return 0;
}
int
-switch_hw_receive (struct net_device* dev,struct dma_device_info* dma_dev)
+ifxmips_mii_hw_receive(struct net_device* dev,struct dma_device_info* dma_dev)
{
- struct switch_priv *priv = (struct switch_priv*)dev->priv;
+ struct ifxmips_mii_priv *priv = (struct ifxmips_mii_priv*)dev->priv;
unsigned char* buf = NULL;
struct sk_buff *skb = NULL;
int len = 0;
len = dma_device_read(dma_dev, &buf, (void**)&skb);
- if (len >= ETHERNET_PACKET_DMA_BUFFER_SIZE)
+ if(len >= ETHERNET_PACKET_DMA_BUFFER_SIZE)
{
printk(KERN_INFO DRVNAME ": packet too large %d\n",len);
- goto switch_hw_receive_err_exit;
+ goto ifxmips_mii_hw_receive_err_exit;
}
/* remove CRC */
len -= 4;
- if (skb == NULL )
+ if(skb == NULL)
{
printk(KERN_INFO DRVNAME ": cannot restore pointer\n");
- goto switch_hw_receive_err_exit;
+ goto ifxmips_mii_hw_receive_err_exit;
}
- if (len > (skb->end - skb->tail))
+ if(len > (skb->end - skb->tail))
{
- printk(KERN_INFO DRVNAME ": BUG, len:%d end:%p tail:%p\n", (len+4), skb->end, skb->tail);
- goto switch_hw_receive_err_exit;
+ printk(KERN_INFO DRVNAME ": BUG, len:%d end:%p tail:%p\n",
+ (len+4), skb->end, skb->tail);
+ goto ifxmips_mii_hw_receive_err_exit;
}
skb_put(skb, len);
@@ -147,17 +136,15 @@ switch_hw_receive (struct net_device* dev,struct dma_device_info* dma_dev)
priv->stats.rx_packets++;
priv->stats.rx_bytes += len;
-
return 0;
-switch_hw_receive_err_exit:
- if (len == 0)
+ifxmips_mii_hw_receive_err_exit:
+ if(len == 0)
{
if(skb)
dev_kfree_skb_any(skb);
priv->stats.rx_errors++;
priv->stats.rx_dropped++;
-
return -EIO;
} else {
return len;
@@ -165,10 +152,10 @@ switch_hw_receive_err_exit:
}
int
-switch_hw_tx (char *buf, int len, struct net_device *dev)
+ifxmips_mii_hw_tx(char *buf, int len, struct net_device *dev)
{
int ret = 0;
- struct switch_priv *priv = dev->priv;
+ struct ifxmips_mii_priv *priv = dev->priv;
struct dma_device_info* dma_dev = priv->dma_device;
ret = dma_device_write(dma_dev, buf, len, priv->skb);
@@ -177,11 +164,11 @@ switch_hw_tx (char *buf, int len, struct net_device *dev)
}
int
-switch_tx (struct sk_buff *skb, struct net_device *dev)
+ifxmips_mii_tx(struct sk_buff *skb, struct net_device *dev)
{
int len;
char *data;
- struct switch_priv *priv = dev->priv;
+ struct ifxmips_mii_priv *priv = dev->priv;
struct dma_device_info* dma_dev = priv->dma_device;
len = skb->len < ETH_ZLEN ? ETH_ZLEN : skb->len;
@@ -194,7 +181,7 @@ switch_tx (struct sk_buff *skb, struct net_device *dev)
wmb();
- if (switch_hw_tx(data, len, dev) != len)
+ if(ifxmips_mii_hw_tx(data, len, dev) != len)
{
dev_kfree_skb_any(skb);
priv->stats.tx_errors++;
@@ -208,32 +195,27 @@ switch_tx (struct sk_buff *skb, struct net_device *dev)
}
void
-switch_tx_timeout (struct net_device *dev)
+ifxmips_mii_tx_timeout(struct net_device *dev)
{
int i;
- struct switch_priv* priv = (struct switch_priv*)dev->priv;
+ struct ifxmips_mii_priv* priv = (struct ifxmips_mii_priv*)dev->priv;
priv->stats.tx_errors++;
-
- for (i = 0; i < priv->dma_device->max_tx_chan_num; i++)
- {
+ for(i = 0; i < priv->dma_device->max_tx_chan_num; i++)
priv->dma_device->tx_chan[i]->disable_irq(priv->dma_device->tx_chan[i]);
- }
-
netif_wake_queue(dev);
-
return;
}
int
-dma_intr_handler (struct dma_device_info* dma_dev, int status)
+dma_intr_handler(struct dma_device_info* dma_dev, int status)
{
int i;
- switch (status)
+ switch(status)
{
case RCV_INT:
- switch_hw_receive(ifxmips_mii0_dev, dma_dev);
+ ifxmips_mii_hw_receive(ifxmips_mii0_dev, dma_dev);
break;
case TX_BUF_FULL_INT:
@@ -247,7 +229,7 @@ dma_intr_handler (struct dma_device_info* dma_dev, int status)
break;
case TRANSMIT_CPT_INT:
- for (i = 0; i < dma_dev->max_tx_chan_num; i++)
+ for(i = 0; i < dma_dev->max_tx_chan_num; i++)
dma_dev->tx_chan[i]->disable_irq(dma_dev->tx_chan[i]);
netif_wake_queue(ifxmips_mii0_dev);
@@ -258,13 +240,13 @@ dma_intr_handler (struct dma_device_info* dma_dev, int status)
}
unsigned char*
-ifxmips_etop_dma_buffer_alloc (int len, int *byte_offset, void **opt)
+ifxmips_etop_dma_buffer_alloc(int len, int *byte_offset, void **opt)
{
unsigned char *buffer = NULL;
struct sk_buff *skb = NULL;
skb = dev_alloc_skb(ETHERNET_PACKET_DMA_BUFFER_SIZE);
- if (skb == NULL)
+ if(skb == NULL)
return NULL;
buffer = (unsigned char*)(skb->data);
@@ -276,7 +258,7 @@ ifxmips_etop_dma_buffer_alloc (int len, int *byte_offset, void **opt)
}
void
-ifxmips_etop_dma_buffer_free (unsigned char *dataptr, void *opt)
+ifxmips_etop_dma_buffer_free(unsigned char *dataptr, void *opt)
{
struct sk_buff *skb = NULL;
@@ -290,57 +272,49 @@ ifxmips_etop_dma_buffer_free (unsigned char *dataptr, void *opt)
}
static struct net_device_stats*
-ifxmips_get_stats (struct net_device *dev)
+ifxmips_get_stats(struct net_device *dev)
{
return (struct net_device_stats *)dev->priv;
}
static int
-switch_init (struct net_device *dev)
+ifxmips_mii_dev_init(struct net_device *dev)
{
u64 retval = 0;
int i;
- struct switch_priv *priv;
+ struct ifxmips_mii_priv *priv;
ether_setup(dev);
-
printk(KERN_INFO DRVNAME ": %s is up\n", dev->name);
-
- dev->open = ifxmips_switch_open;
- dev->stop = switch_release;
- dev->hard_start_xmit = switch_tx;
+ dev->open = ifxmips_ifxmips_mii_open;
+ dev->stop = ifxmips_mii_release;
+ dev->hard_start_xmit = ifxmips_mii_tx;
dev->get_stats = ifxmips_get_stats;
- dev->tx_timeout = switch_tx_timeout;
+ dev->tx_timeout = ifxmips_mii_tx_timeout;
dev->watchdog_timeo = 10 * HZ;
-
- memset(dev->priv, 0, sizeof(struct switch_priv));
+ memset(dev->priv, 0, sizeof(struct ifxmips_mii_priv));
priv = dev->priv;
-
priv->dma_device = dma_device_reserve("PPE");
-
- if (!priv->dma_device){
+ if(!priv->dma_device){
BUG();
return -ENODEV;
}
-
priv->dma_device->buffer_alloc = &ifxmips_etop_dma_buffer_alloc;
priv->dma_device->buffer_free = &ifxmips_etop_dma_buffer_free;
priv->dma_device->intr_handler = &dma_intr_handler;
priv->dma_device->max_rx_chan_num = 4;
- for (i = 0; i < priv->dma_device->max_rx_chan_num; i++)
+ for(i = 0; i < priv->dma_device->max_rx_chan_num; i++)
{
priv->dma_device->rx_chan[i]->packet_size = ETHERNET_PACKET_DMA_BUFFER_SIZE;
priv->dma_device->rx_chan[i]->control = IFXMIPS_DMA_CH_ON;
}
- for (i = 0; i < priv->dma_device->max_tx_chan_num; i++)
- {
+ for(i = 0; i < priv->dma_device->max_tx_chan_num; i++)
if(i == 0)
priv->dma_device->tx_chan[i]->control = IFXMIPS_DMA_CH_ON;
else
priv->dma_device->tx_chan[i]->control = IFXMIPS_DMA_CH_OFF;
- }
dma_device_register(priv->dma_device);
@@ -350,7 +324,7 @@ switch_init (struct net_device *dev)
//TODO
/* ethaddr not set in u-boot ? */
- if (retval == 0)
+ if(retval == 0)
{
printk(KERN_INFO DRVNAME ": using default MAC address\n");
dev->dev_addr[0] = 0x00;
@@ -360,7 +334,7 @@ switch_init (struct net_device *dev)
dev->dev_addr[4] = 0x44;
dev->dev_addr[5] = 0x55;
} else {
- for (i = 0; i < 6; i++)
+ for(i = 0; i < 6; i++)
dev->dev_addr[i] = u_boot_ethaddr[i];
}
@@ -368,7 +342,7 @@ switch_init (struct net_device *dev)
}
static void
-ifxmips_sw_chip_init (int mode)
+ifxmips_mii_chip_init(int mode)
{
ifxmips_pmu_enable(IFXMIPS_PMU_PWDCR_DMA);
ifxmips_pmu_enable(IFXMIPS_PMU_PWDCR_PPE);
@@ -377,11 +351,8 @@ ifxmips_sw_chip_init (int mode)
ifxmips_w32((ifxmips_r32(IFXMIPS_PPE32_CFG) & PPE32_MII_MASK) | PPE32_MII_REVERSE, IFXMIPS_PPE32_CFG);
else if(mode == MII_MODE)
ifxmips_w32((ifxmips_r32(IFXMIPS_PPE32_CFG) & PPE32_MII_MASK) | PPE32_MII_NORMAL, IFXMIPS_PPE32_CFG);
-
ifxmips_w32(PPE32_PLEN_UNDER | PPE32_PLEN_OVER, IFXMIPS_PPE32_IG_PLEN_CTRL);
-
ifxmips_w32(PPE32_CGEN, IFXMIPS_PPE32_ENET_MAC_CFG);
-
wmb();
}
@@ -390,12 +361,9 @@ ifxmips_mii_probe(struct platform_device *dev)
{
int result = 0;
- ifxmips_mii0_dev = alloc_etherdev(sizeof(struct switch_priv));
-
- ifxmips_mii0_dev->init = switch_init;
-
+ ifxmips_mii0_dev = alloc_etherdev(sizeof(struct ifxmips_mii_priv));
+ ifxmips_mii0_dev->init = ifxmips_mii_dev_init;
strcpy(ifxmips_mii0_dev->name, "eth%d");
-
result = register_netdev(ifxmips_mii0_dev);
if (result)
{
@@ -404,7 +372,7 @@ ifxmips_mii_probe(struct platform_device *dev)
}
/* ifxmips eval kit connects the phy/switch in REV mode */
- ifxmips_sw_chip_init(REV_MII_MODE);
+ ifxmips_mii_chip_init(REV_MII_MODE);
printk(KERN_INFO DRVNAME ": driver loaded!\n");
out:
@@ -414,7 +382,7 @@ out:
static int
ifxmips_mii_remove(struct platform_device *dev)
{
- struct switch_priv *priv = (struct switch_priv*)ifxmips_mii0_dev->priv;
+ struct ifxmips_mii_priv *priv = (struct ifxmips_mii_priv*)ifxmips_mii0_dev->priv;
printk(KERN_INFO DRVNAME ": ifxmips_mii0 cleanup\n");
@@ -423,7 +391,6 @@ ifxmips_mii_remove(struct platform_device *dev)
kfree(priv->dma_device);
kfree(ifxmips_mii0_dev->priv);
unregister_netdev(ifxmips_mii0_dev);
-
return 0;
}
@@ -443,7 +410,6 @@ ifxmips_mii_init(void)
int ret = platform_driver_register(&ifxmips_mii_driver);
if (ret)
printk(KERN_INFO DRVNAME ": Error registering platfom driver!");
-
return ret;
}
@@ -455,3 +421,7 @@ ifxmips_mii_cleanup(void)
module_init(ifxmips_mii_init);
module_exit(ifxmips_mii_cleanup);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("John Crispin <blogic@openwrt.org>");
+MODULE_DESCRIPTION("ethernet map driver for IFXMIPS boards");
diff --git a/target/linux/ifxmips/files/drivers/serial/ifxmips_asc.c b/target/linux/ifxmips/files/drivers/serial/ifxmips_asc.c
index dec64e425f..d4219925fa 100644
--- a/target/linux/ifxmips/files/drivers/serial/ifxmips_asc.c
+++ b/target/linux/ifxmips/files/drivers/serial/ifxmips_asc.c
@@ -193,7 +193,7 @@ ifxmipsasc_tx_int (int irq, void *port)
{
ifxmips_w32(ASC_IRNCR_TIR, IFXMIPS_ASC1_IRNCR);
ifxmipsasc_start_tx(port);
- mask_and_ack_ifxmips_irq(irq);
+ ifxmips_mask_and_ack_irq(irq);
return IRQ_HANDLED;
}
@@ -213,7 +213,7 @@ ifxmipsasc_rx_int (int irq, void *port)
{
ifxmips_w32(ASC_IRNCR_RIR, IFXMIPS_ASC1_IRNCR);
ifxmipsasc_rx_chars((struct uart_port *) port);
- mask_and_ack_ifxmips_irq(irq);
+ ifxmips_mask_and_ack_irq(irq);
return IRQ_HANDLED;
}