Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
f3c1e4cf
Commit
f3c1e4cf
authored
Aug 22, 2004
by
Andy Fleming
Committed by
Jeff Garzik
Aug 22, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] update gianfar ethernet driver
parent
633980ae
Changes
7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
1049 additions
and
886 deletions
+1049
-886
drivers/net/Makefile
drivers/net/Makefile
+3
-1
drivers/net/gianfar.c
drivers/net/gianfar.c
+258
-315
drivers/net/gianfar.h
drivers/net/gianfar.h
+22
-24
drivers/net/gianfar_ethtool.c
drivers/net/gianfar_ethtool.c
+131
-90
drivers/net/gianfar_phy.c
drivers/net/gianfar_phy.c
+480
-323
drivers/net/gianfar_phy.h
drivers/net/gianfar_phy.h
+153
-132
include/linux/mii.h
include/linux/mii.h
+2
-1
No files found.
drivers/net/Makefile
View file @
f3c1e4cf
...
...
@@ -10,7 +10,9 @@ obj-$(CONFIG_E1000) += e1000/
obj-$(CONFIG_IBM_EMAC)
+=
ibm_emac/
obj-$(CONFIG_IXGB)
+=
ixgb/
obj-$(CONFIG_BONDING)
+=
bonding/
obj-$(CONFIG_GIANFAR)
+=
gianfar.o gianfar_ethtool.o gianfar_phy.o
obj-$(CONFIG_GIANFAR)
+=
gianfar_driver.o
gianfar_driver-objs
:=
gianfar.o gianfar_ethtool.o gianfar_phy.o
#
# link order important here
...
...
drivers/net/gianfar.c
View file @
f3c1e4cf
This diff is collapsed.
Click to expand it.
drivers/net/gianfar.h
View file @
f3c1e4cf
...
...
@@ -8,7 +8,7 @@
* Author: Andy Fleming
* Maintainer: Kumar Gala (kumar.gala@freescale.com)
*
* Copyright
2004 Freescale Semiconductor, Inc
* Copyright
(c) 2002-2004 Freescale Semiconductor, Inc.
*
* 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
...
...
@@ -17,6 +17,8 @@
*
* Still left to do:
* -Add support for module parameters
* -Add support for ethtool -s
* -Add patch for ethtool phys id
*/
#ifndef __GIANFAR_H
#define __GIANFAR_H
...
...
@@ -42,15 +44,7 @@
#include <linux/module.h>
#include <linux/version.h>
#include <linux/crc32.h>
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,41)
#include <linux/workqueue.h>
#else
#include <linux/tqueue.h>
#define work_struct tq_struct
#define schedule_work schedule_task
#endif
#include <linux/ethtool.h>
#include <linux/netdevice.h>
#include <asm/ocp.h>
...
...
@@ -70,8 +64,13 @@
#define MAC_ADDR_LEN 6
extern
char
gfar_driver_name
[];
extern
char
gfar_driver_version
[];
#define PHY_INIT_TIMEOUT 100000
#define GFAR_PHY_CHANGE_TIME 2
#define DEVICE_NAME "%s: Gianfar Ethernet Controller Version 1.1, "
#define DRV_NAME "gfar-enet"
extern
const
char
gfar_driver_name
[];
extern
const
char
gfar_driver_version
[];
/* These need to be powers of 2 for this driver */
#ifdef CONFIG_GFAR_NAPI
...
...
@@ -105,11 +104,13 @@ extern char gfar_driver_version[];
#define GFAR_100_TIME 2560
#define GFAR_10_TIME 25600
#define DEFAULT_TX_COALESCE 1
#define DEFAULT_TXCOUNT 16
#define DEFAULT_TXTIME
32768
#define DEFAULT_TXTIME
400
#define DEFAULT_RX_COALESCE 1
#define DEFAULT_RXCOUNT 16
#define DEFAULT_RXTIME
32768
#define DEFAULT_RXTIME
400
#define TBIPA_VALUE 0x1f
#define MIIMCFG_INIT_VALUE 0x00000007
...
...
@@ -467,8 +468,7 @@ struct gfar {
* empty and completely full conditions. The empty/ready indicator in
* the buffer descriptor determines the actual condition.
*/
struct
gfar_private
{
struct
gfar_private
{
/* pointers to arrays of skbuffs for tx and rx */
struct
sk_buff
**
tx_skbuff
;
struct
sk_buff
**
rx_skbuff
;
...
...
@@ -496,7 +496,6 @@ struct gfar_private
struct
txbd8
*
cur_tx
;
/* Next free ring entry */
struct
txbd8
*
dirty_tx
;
/* The Ring entry to be freed. */
struct
gfar
*
regs
;
/* Pointer to the GFAR memory mapped Registers */
struct
phy_info
*
phyinfo
;
struct
gfar
*
phyregs
;
struct
work_struct
tq
;
struct
timer_list
phy_info_timer
;
...
...
@@ -509,15 +508,14 @@ struct gfar_private
unsigned
int
rx_ring_size
;
wait_queue_head_t
rxcleanupq
;
unsigned
int
rxclean
;
int
link
;
/* current link state */
int
oldlink
;
int
duplexity
;
/* Indicates negotiated duplex state */
int
olddplx
;
int
speed
;
/* Indicates negotiated speed */
int
oldspeed
;
/* Info structure initialized by board setup code */
struct
ocp_gfar_data
*
einfo
;
struct
gfar_mii_info
*
mii_info
;
int
oldspeed
;
int
oldduplex
;
int
oldlink
;
};
extern
inline
u32
gfar_read
(
volatile
unsigned
*
addr
)
...
...
@@ -532,6 +530,6 @@ extern inline void gfar_write(volatile unsigned *addr, u32 val)
out_be32
(
addr
,
val
);
}
extern
struct
ethtool_ops
*
gfar_op_array
[];
#endif
/* __GIANFAR_H */
drivers/net/gianfar_ethtool.c
View file @
f3c1e4cf
This diff is collapsed.
Click to expand it.
drivers/net/gianfar_phy.c
View file @
f3c1e4cf
This diff is collapsed.
Click to expand it.
drivers/net/gianfar_phy.h
View file @
f3c1e4cf
This diff is collapsed.
Click to expand it.
include/linux/mii.h
View file @
f3c1e4cf
...
...
@@ -33,7 +33,8 @@
#define MII_NCONFIG 0x1c
/* Network interface config */
/* Basic mode control register. */
#define BMCR_RESV 0x007f
/* Unused... */
#define BMCR_RESV 0x003f
/* Unused... */
#define BMCR_SPEED1000 0x0040
/* MSB of Speed (1000) */
#define BMCR_CTST 0x0080
/* Collision test */
#define BMCR_FULLDPLX 0x0100
/* Full duplex */
#define BMCR_ANRESTART 0x0200
/* Auto negotiation restart */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment