Blackfin ethernet driver: on chip ethernet MAC controller driver
Subsystems (2)
PATCH 1/1 Blackfin ethernet driver: on chip ethernet MAC controller driver
This patch implements the driver necessary use the Analog Devices Blackfin processor's on-chip ethernet MAC controller.
[try#2]
- add timeout control
- kill dma_config_reg bitfields
- some trivial cleanup
[try#3]
- add endianess check
- add DRV_NAME, DRV_VERSION... driver information string
- add some comments for silicon anomaly and dma API confusion
- some code trivial cleanup
[try#4]
- add Blackfin latest GPIO pin mux opertion with Michael Hennerich's help and Dan's review
- rewrite the DMA descriptor list operation in a more readable way by Joe's review
[try#5]
- cleanup some coding style by Joe's review.
I think this version driver patch should be OK for this merge window.
--- MAINTAINERS | 7 + drivers/net/Kconfig | 44 +++ drivers/net/Makefile | 1 + drivers/net/bfin_mac.c | 1008 ++++++++++++++++++++++++++++++++++++++++++++++++ drivers/net/bfin_mac.h | 132 +++++++ 5 files changed, 1192 insertions(+), 0 deletions(-) create mode 100644 drivers/net/bfin_mac.c create mode 100644 drivers/net/bfin_mac.h
MAINTAINERS +7 -0
@@ -754,6 +754,13 @@ L: [email protected] (subscribers-only) W: http://blackfin.uclinux.org S: Supported +BLACKFIN EMAC DRIVER +P: Bryan Wu +M: [email protected] +L: [email protected] (subscribers-only) +W: http://blackfin.uclinux.org +S: Supported + BLACKFIN RTC DRIVER P: Mike Frysinger M: [email protected]
drivers/net/Kconfig +44 -0
50 lines not on this page · raw message
drivers/net/Makefile +1 -0
@@ -199,6 +199,7 @@ obj-$(CONFIG_S2IO) += s2io.o obj-$(CONFIG_MYRI10GE) += myri10ge/ obj-$(CONFIG_SMC91X) += smc91x.o obj-$(CONFIG_SMC911X) += smc911x.o +obj-$(CONFIG_BFIN_MAC) += bfin_mac.o obj-$(CONFIG_DM9000) += dm9000.o obj-$(CONFIG_FEC_8XX) += fec_8xx/ obj-$(CONFIG_PASEMI_MAC) += pasemi_mac.o
drivers/net/bfin_mac.c new file +1008 -0
1,008 lines not on this page · raw message
drivers/net/bfin_mac.h new file +132 -0
132 lines not on this page · raw message
Signature · 1 line
1.5.2
Hello.
In article <1184604542.6107.44.camel@roc-laptop> (at Tue, 17 Jul 2007 00:49:02 +0800), Bryan Wu <[email protected]> says:
Quoted 14 lines
drivers/net/bfin_mac.c new file +14
-0+static void bf537mac_set_multicast_list (struct net_device *dev) +{ +u32 sysctl; + +if (dev->flags &IFF_PROMISC ) { +printk (KERN_INFO "%s: set to promisc mode\n" , dev->name); + sysctl =bfin_read_EMAC_OPMODE (); + sysctl |=RAF ; +bfin_write_EMAC_OPMODE (sysctl); + }else if (dev->flags &IFF_ALLMULTI || dev->mc_count >16 ) { +/* accept all multicast */ + sysctl =bfin_read_EMAC_OPMODE (); + sysctl |=PAM ; +bfin_write_EMAC_OPMODE (sysctl);
drivers/net/bfin_mac.c line 780
Quoted 10 lines
drivers/net/bfin_mac.c new file +10
-0+ }else if (dev->mc_count) { +/* set multicast */ + }else { +/* clear promisc or multicast mode */ + sysctl =bfin_read_EMAC_OPMODE (); + sysctl &= ~(RAF |PAM ); +bfin_write_EMAC_OPMODE (sysctl); + } +} +
Is this function really correct?
Please make sure to set up multicast list on device, or set "all multi" on device if you do not know what to do; e.g.
static void bf537mac_set_multicast_list(struct net_device *dev)
{
u32 sysctl;
if (dev->flags & IFF_PROMISC) {
printk(KERN_INFO "%s: set to promisc mode\n", dev->name);
sysctl = bfin_read_EMAC_OPMODE();
sysctl |= RAF;
bfin_write_EMAC_OPMODE(sysctl);
} else if (dev->flags & IFF_ALLMULTI || dev->mc_count) {
/* accept all multicast */
sysctl = bfin_read_EMAC_OPMODE();
sysctl |= PAM;
bfin_write_EMAC_OPMODE(sysctl);
} else {
/* clear promisc or multicast mode */
sysctl = bfin_read_EMAC_OPMODE();
sysctl &= ~(RAF | PAM);
bfin_write_EMAC_OPMODE(sysctl);
}
}--yoshfuji