Skip to content

Commit cc93d7d

Browse files
committed
Merge branch 'upstream-davem' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
2 parents 461e6c8 + f946dff commit cc93d7d

55 files changed

Lines changed: 1290 additions & 671 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Documentation/networking/phy.txt‎

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
-------
33
PHY Abstraction Layer
4-
(Updated 2006-11-30)
4+
(Updated 2008-04-08)
55

66
Purpose
77

@@ -291,3 +291,39 @@ Writing a PHY driver
291291
Feel free to look at the Marvell, Cicada, and Davicom drivers in
292292
drivers/net/phy/ for examples (the lxt and qsemi drivers have
293293
not been tested as of this writing)
294+
295+
Board Fixups
296+
297+
Sometimes the specific interaction between the platform and the PHY requires
298+
special handling. For instance, to change where the PHY's clock input is,
299+
or to add a delay to account for latency issues in the data path. In order
300+
to support such contingencies, the PHY Layer allows platform code to register
301+
fixups to be run when the PHY is brought up (or subsequently reset).
302+
303+
When the PHY Layer brings up a PHY it checks to see if there are any fixups
304+
registered for it, matching based on UID (contained in the PHY device's phy_id
305+
field) and the bus identifier (contained in phydev->dev.bus_id). Both must
306+
match, however two constants, PHY_ANY_ID and PHY_ANY_UID, are provided as
307+
wildcards for the bus ID and UID, respectively.
308+
309+
When a match is found, the PHY layer will invoke the run function associated
310+
with the fixup. This function is passed a pointer to the phy_device of
311+
interest. It should therefore only operate on that PHY.
312+
313+
The platform code can either register the fixup using phy_register_fixup():
314+
315+
int phy_register_fixup(const char *phy_id,
316+
u32 phy_uid, u32 phy_uid_mask,
317+
int (*run)(struct phy_device *));
318+
319+
Or using one of the two stubs, phy_register_fixup_for_uid() and
320+
phy_register_fixup_for_id():
321+
322+
int phy_register_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask,
323+
int (*run)(struct phy_device *));
324+
int phy_register_fixup_for_id(const char *phy_id,
325+
int (*run)(struct phy_device *));
326+
327+
The stubs set one of the two matching criteria, and set the other one to
328+
match anything.
329+

‎drivers/net/arm/at91_ether.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1246,3 +1246,4 @@ module_exit(at91ether_exit)
12461246
MODULE_LICENSE("GPL");
12471247
MODULE_DESCRIPTION("AT91RM9200 EMAC Ethernet driver");
12481248
MODULE_AUTHOR("Andrew Victor");
1249+
MODULE_ALIAS("platform:" DRV_NAME);

‎drivers/net/arm/ep93xx_eth.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -897,6 +897,7 @@ static struct platform_driver ep93xx_eth_driver = {
897897
.remove = ep93xx_eth_remove,
898898
.driver = {
899899
.name = "ep93xx-eth",
900+
.owner = THIS_MODULE,
900901
},
901902
};
902903

@@ -914,3 +915,4 @@ static void __exit ep93xx_eth_cleanup_module(void)
914915
module_init(ep93xx_eth_init_module);
915916
module_exit(ep93xx_eth_cleanup_module);
916917
MODULE_LICENSE("GPL");
918+
MODULE_ALIAS("platform:ep93xx-eth");

‎drivers/net/atlx/atl1.c‎

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,144 @@
9090
/* Temporary hack for merging atl1 and atl2 */
9191
#include "atlx.c"
9292

93+
/*
94+
* This is the only thing that needs to be changed to adjust the
95+
* maximum number of ports that the driver can manage.
96+
*/
97+
#define ATL1_MAX_NIC 4
98+
99+
#define OPTION_UNSET -1
100+
#define OPTION_DISABLED 0
101+
#define OPTION_ENABLED 1
102+
103+
#define ATL1_PARAM_INIT { [0 ... ATL1_MAX_NIC] = OPTION_UNSET }
104+
105+
/*
106+
* Interrupt Moderate Timer in units of 2 us
107+
*
108+
* Valid Range: 10-65535
109+
*
110+
* Default Value: 100 (200us)
111+
*/
112+
static int __devinitdata int_mod_timer[ATL1_MAX_NIC+1] = ATL1_PARAM_INIT;
113+
static int num_int_mod_timer;
114+
module_param_array_named(int_mod_timer, int_mod_timer, int,
115+
&num_int_mod_timer, 0);
116+
MODULE_PARM_DESC(int_mod_timer, "Interrupt moderator timer");
117+
118+
#define DEFAULT_INT_MOD_CNT 100 /* 200us */
119+
#define MAX_INT_MOD_CNT 65000
120+
#define MIN_INT_MOD_CNT 50
121+
122+
struct atl1_option {
123+
enum { enable_option, range_option, list_option } type;
124+
char *name;
125+
char *err;
126+
int def;
127+
union {
128+
struct { /* range_option info */
129+
int min;
130+
int max;
131+
} r;
132+
struct { /* list_option info */
133+
int nr;
134+
struct atl1_opt_list {
135+
int i;
136+
char *str;
137+
} *p;
138+
} l;
139+
} arg;
140+
};
141+
142+
static int __devinit atl1_validate_option(int *value, struct atl1_option *opt,
143+
struct pci_dev *pdev)
144+
{
145+
if (*value == OPTION_UNSET) {
146+
*value = opt->def;
147+
return 0;
148+
}
149+
150+
switch (opt->type) {
151+
case enable_option:
152+
switch (*value) {
153+
case OPTION_ENABLED:
154+
dev_info(&pdev->dev, "%s enabled\n", opt->name);
155+
return 0;
156+
case OPTION_DISABLED:
157+
dev_info(&pdev->dev, "%s disabled\n", opt->name);
158+
return 0;
159+
}
160+
break;
161+
case range_option:
162+
if (*value >= opt->arg.r.min && *value <= opt->arg.r.max) {
163+
dev_info(&pdev->dev, "%s set to %i\n", opt->name,
164+
*value);
165+
return 0;
166+
}
167+
break;
168+
case list_option:{
169+
int i;
170+
struct atl1_opt_list *ent;
171+
172+
for (i = 0; i < opt->arg.l.nr; i++) {
173+
ent = &opt->arg.l.p[i];
174+
if (*value == ent->i) {
175+
if (ent->str[0] != '\0')
176+
dev_info(&pdev->dev, "%s\n",
177+
ent->str);
178+
return 0;
179+
}
180+
}
181+
}
182+
break;
183+
184+
default:
185+
break;
186+
}
187+
188+
dev_info(&pdev->dev, "invalid %s specified (%i) %s\n",
189+
opt->name, *value, opt->err);
190+
*value = opt->def;
191+
return -1;
192+
}
193+
194+
/*
195+
* atl1_check_options - Range Checking for Command Line Parameters
196+
* @adapter: board private structure
197+
*
198+
* This routine checks all command line parameters for valid user
199+
* input. If an invalid value is given, or if no user specified
200+
* value exists, a default value is used. The final value is stored
201+
* in a variable in the adapter structure.
202+
*/
203+
void __devinit atl1_check_options(struct atl1_adapter *adapter)
204+
{
205+
struct pci_dev *pdev = adapter->pdev;
206+
int bd = adapter->bd_number;
207+
if (bd >= ATL1_MAX_NIC) {
208+
dev_notice(&pdev->dev, "no configuration for board#%i\n", bd);
209+
dev_notice(&pdev->dev, "using defaults for all values\n");
210+
}
211+
{ /* Interrupt Moderate Timer */
212+
struct atl1_option opt = {
213+
.type = range_option,
214+
.name = "Interrupt Moderator Timer",
215+
.err = "using default of "
216+
__MODULE_STRING(DEFAULT_INT_MOD_CNT),
217+
.def = DEFAULT_INT_MOD_CNT,
218+
.arg = {.r = {.min = MIN_INT_MOD_CNT,
219+
.max = MAX_INT_MOD_CNT} }
220+
};
221+
int val;
222+
if (num_int_mod_timer > bd) {
223+
val = int_mod_timer[bd];
224+
atl1_validate_option(&val, &opt, pdev);
225+
adapter->imt = (u16) val;
226+
} else
227+
adapter->imt = (u16) (opt.def);
228+
}
229+
}
230+
93231
/*
94232
* atl1_pci_tbl - PCI Device ID Table
95233
*/

‎drivers/net/atlx/atlx.c‎

Lines changed: 0 additions & 177 deletions
Original file line numberDiff line numberDiff line change
@@ -253,181 +253,4 @@ static void atlx_restore_vlan(struct atlx_adapter *adapter)
253253
atlx_vlan_rx_register(adapter->netdev, adapter->vlgrp);
254254
}
255255

256-
/*
257-
* This is the only thing that needs to be changed to adjust the
258-
* maximum number of ports that the driver can manage.
259-
*/
260-
#define ATL1_MAX_NIC 4
261-
262-
#define OPTION_UNSET -1
263-
#define OPTION_DISABLED 0
264-
#define OPTION_ENABLED 1
265-
266-
#define ATL1_PARAM_INIT { [0 ... ATL1_MAX_NIC] = OPTION_UNSET }
267-
268-
/*
269-
* Interrupt Moderate Timer in units of 2 us
270-
*
271-
* Valid Range: 10-65535
272-
*
273-
* Default Value: 100 (200us)
274-
*/
275-
static int __devinitdata int_mod_timer[ATL1_MAX_NIC+1] = ATL1_PARAM_INIT;
276-
static int num_int_mod_timer;
277-
module_param_array_named(int_mod_timer, int_mod_timer, int,
278-
&num_int_mod_timer, 0);
279-
MODULE_PARM_DESC(int_mod_timer, "Interrupt moderator timer");
280-
281-
/*
282-
* flash_vendor
283-
*
284-
* Valid Range: 0-2
285-
*
286-
* 0 - Atmel
287-
* 1 - SST
288-
* 2 - ST
289-
*
290-
* Default Value: 0
291-
*/
292-
static int __devinitdata flash_vendor[ATL1_MAX_NIC+1] = ATL1_PARAM_INIT;
293-
static int num_flash_vendor;
294-
module_param_array_named(flash_vendor, flash_vendor, int, &num_flash_vendor, 0);
295-
MODULE_PARM_DESC(flash_vendor, "SPI flash vendor");
296-
297-
#define DEFAULT_INT_MOD_CNT 100 /* 200us */
298-
#define MAX_INT_MOD_CNT 65000
299-
#define MIN_INT_MOD_CNT 50
300-
301-
#define FLASH_VENDOR_DEFAULT 0
302-
#define FLASH_VENDOR_MIN 0
303-
#define FLASH_VENDOR_MAX 2
304-
305-
struct atl1_option {
306-
enum { enable_option, range_option, list_option } type;
307-
char *name;
308-
char *err;
309-
int def;
310-
union {
311-
struct { /* range_option info */
312-
int min;
313-
int max;
314-
} r;
315-
struct { /* list_option info */
316-
int nr;
317-
struct atl1_opt_list {
318-
int i;
319-
char *str;
320-
} *p;
321-
} l;
322-
} arg;
323-
};
324-
325-
static int __devinit atl1_validate_option(int *value, struct atl1_option *opt,
326-
struct pci_dev *pdev)
327-
{
328-
if (*value == OPTION_UNSET) {
329-
*value = opt->def;
330-
return 0;
331-
}
332-
333-
switch (opt->type) {
334-
case enable_option:
335-
switch (*value) {
336-
case OPTION_ENABLED:
337-
dev_info(&pdev->dev, "%s enabled\n", opt->name);
338-
return 0;
339-
case OPTION_DISABLED:
340-
dev_info(&pdev->dev, "%s disabled\n", opt->name);
341-
return 0;
342-
}
343-
break;
344-
case range_option:
345-
if (*value >= opt->arg.r.min && *value <= opt->arg.r.max) {
346-
dev_info(&pdev->dev, "%s set to %i\n", opt->name,
347-
*value);
348-
return 0;
349-
}
350-
break;
351-
case list_option:{
352-
int i;
353-
struct atl1_opt_list *ent;
354-
355-
for (i = 0; i < opt->arg.l.nr; i++) {
356-
ent = &opt->arg.l.p[i];
357-
if (*value == ent->i) {
358-
if (ent->str[0] != '\0')
359-
dev_info(&pdev->dev, "%s\n",
360-
ent->str);
361-
return 0;
362-
}
363-
}
364-
}
365-
break;
366-
367-
default:
368-
break;
369-
}
370-
371-
dev_info(&pdev->dev, "invalid %s specified (%i) %s\n",
372-
opt->name, *value, opt->err);
373-
*value = opt->def;
374-
return -1;
375-
}
376-
377-
/*
378-
* atl1_check_options - Range Checking for Command Line Parameters
379-
* @adapter: board private structure
380-
*
381-
* This routine checks all command line parameters for valid user
382-
* input. If an invalid value is given, or if no user specified
383-
* value exists, a default value is used. The final value is stored
384-
* in a variable in the adapter structure.
385-
*/
386-
void __devinit atl1_check_options(struct atl1_adapter *adapter)
387-
{
388-
struct pci_dev *pdev = adapter->pdev;
389-
int bd = adapter->bd_number;
390-
if (bd >= ATL1_MAX_NIC) {
391-
dev_notice(&pdev->dev, "no configuration for board#%i\n", bd);
392-
dev_notice(&pdev->dev, "using defaults for all values\n");
393-
}
394-
{ /* Interrupt Moderate Timer */
395-
struct atl1_option opt = {
396-
.type = range_option,
397-
.name = "Interrupt Moderator Timer",
398-
.err = "using default of "
399-
__MODULE_STRING(DEFAULT_INT_MOD_CNT),
400-
.def = DEFAULT_INT_MOD_CNT,
401-
.arg = {.r = {.min = MIN_INT_MOD_CNT,
402-
.max = MAX_INT_MOD_CNT} }
403-
};
404-
int val;
405-
if (num_int_mod_timer > bd) {
406-
val = int_mod_timer[bd];
407-
atl1_validate_option(&val, &opt, pdev);
408-
adapter->imt = (u16) val;
409-
} else
410-
adapter->imt = (u16) (opt.def);
411-
}
412-
413-
{ /* Flash Vendor */
414-
struct atl1_option opt = {
415-
.type = range_option,
416-
.name = "SPI Flash Vendor",
417-
.err = "using default of "
418-
__MODULE_STRING(FLASH_VENDOR_DEFAULT),
419-
.def = DEFAULT_INT_MOD_CNT,
420-
.arg = {.r = {.min = FLASH_VENDOR_MIN,
421-
.max = FLASH_VENDOR_MAX} }
422-
};
423-
int val;
424-
if (num_flash_vendor > bd) {
425-
val = flash_vendor[bd];
426-
atl1_validate_option(&val, &opt, pdev);
427-
adapter->hw.flash_vendor = (u8) val;
428-
} else
429-
adapter->hw.flash_vendor = (u8) (opt.def);
430-
}
431-
}
432-
433256
#endif /* ATLX_C */

‎drivers/net/ax88796.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,3 +1005,4 @@ module_exit(axdrv_exit);
10051005
MODULE_DESCRIPTION("AX88796 10/100 Ethernet platform driver");
10061006
MODULE_AUTHOR("Ben Dooks, <ben@simtec.co.uk>");
10071007
MODULE_LICENSE("GPL v2");
1008+
MODULE_ALIAS("platform:ax88796");

0 commit comments

Comments
 (0)