aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tulip
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-01-22 02:20:58 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-23 06:11:39 -0500
commit4c93566e2a61b48ef071a8d8a8fa9904c83a668e (patch)
tree5da4dffee090f69d3194fab20e5124e0ce3cba42 /drivers/net/tulip
parentacea6852f32b8805e166d885ed7e9f0c7cd10d41 (diff)
[TULIP] DMFE: Fix SROM parsing regression.
Changeset 16b110c3fd760620b4a787db6ed512fe531ab1b5 (dmfe warning fix) bothed up the offsets read from the SROM so that it doesn't read the same datums it used to. The change made transformations like turning: "srom + 34" into "(__le32 *)srom + 34/4" which doesn't work because 4 does not divide evenly into 34 so we're using a different pointer offset than in the original code. I've changed theses cases in dmfe_parse_srom() to consistently use "(type *)(srom + offset)" preserving the offsets from the original code. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tulip')
-rw-r--r--drivers/net/tulip/dmfe.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/tulip/dmfe.c b/drivers/net/tulip/dmfe.c
index b4891caeae5a..656200472fa1 100644
--- a/drivers/net/tulip/dmfe.c
+++ b/drivers/net/tulip/dmfe.c
@@ -1909,7 +1909,7 @@ static void dmfe_parse_srom(struct dmfe_board_info * db)
1909 if ( ( (int) srom[18] & 0xff) == SROM_V41_CODE) { 1909 if ( ( (int) srom[18] & 0xff) == SROM_V41_CODE) {
1910 /* SROM V4.01 */ 1910 /* SROM V4.01 */
1911 /* Get NIC support media mode */ 1911 /* Get NIC support media mode */
1912 db->NIC_capability = le16_to_cpup((__le16 *)srom + 34/2); 1912 db->NIC_capability = le16_to_cpup((__le16 *) (srom + 34));
1913 db->PHY_reg4 = 0; 1913 db->PHY_reg4 = 0;
1914 for (tmp_reg = 1; tmp_reg < 0x10; tmp_reg <<= 1) { 1914 for (tmp_reg = 1; tmp_reg < 0x10; tmp_reg <<= 1) {
1915 switch( db->NIC_capability & tmp_reg ) { 1915 switch( db->NIC_capability & tmp_reg ) {
@@ -1921,8 +1921,8 @@ static void dmfe_parse_srom(struct dmfe_board_info * db)
1921 } 1921 }
1922 1922
1923 /* Media Mode Force or not check */ 1923 /* Media Mode Force or not check */
1924 dmfe_mode = le32_to_cpup((__le32 *)srom + 34/4) & 1924 dmfe_mode = (le32_to_cpup((__le32 *) (srom + 34)) &
1925 le32_to_cpup((__le32 *)srom + 36/4); 1925 le32_to_cpup((__le32 *) (srom + 36)));
1926 switch(dmfe_mode) { 1926 switch(dmfe_mode) {
1927 case 0x4: dmfe_media_mode = DMFE_100MHF; break; /* 100MHF */ 1927 case 0x4: dmfe_media_mode = DMFE_100MHF; break; /* 100MHF */
1928 case 0x2: dmfe_media_mode = DMFE_10MFD; break; /* 10MFD */ 1928 case 0x2: dmfe_media_mode = DMFE_10MFD; break; /* 10MFD */