aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tulip/de4x5.c
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2008-05-06 10:57:55 -0400
committerJiri Kosina <jkosina@suse.cz>2008-05-06 10:57:55 -0400
commit7022b15e2a9f878fd5184586064c63352c3dd225 (patch)
tree5365c2f5bc82ae1946636ee8d5cd5d3b7e804f1b /drivers/net/tulip/de4x5.c
parentaaad2b0c757f3e6e02552cb0bdcd91a5ec0d6305 (diff)
parenta15306365a16380f3bafee9e181ba01231d4acd7 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'drivers/net/tulip/de4x5.c')
-rw-r--r--drivers/net/tulip/de4x5.c35
1 files changed, 17 insertions, 18 deletions
diff --git a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c
index 6c6fc325c8f9..bc30c6e8fea2 100644
--- a/drivers/net/tulip/de4x5.c
+++ b/drivers/net/tulip/de4x5.c
@@ -482,7 +482,6 @@
482static char version[] __devinitdata = "de4x5.c:V0.546 2001/02/22 davies@maniac.ultranet.com\n"; 482static char version[] __devinitdata = "de4x5.c:V0.546 2001/02/22 davies@maniac.ultranet.com\n";
483 483
484#define c_char const char 484#define c_char const char
485#define TWIDDLE(a) (u_short)le16_to_cpu(get_unaligned((__le16 *)(a)))
486 485
487/* 486/*
488** MII Information 487** MII Information
@@ -4405,7 +4404,7 @@ srom_infoleaf_info(struct net_device *dev)
4405 } 4404 }
4406 } 4405 }
4407 4406
4408 lp->infoleaf_offset = TWIDDLE(p+1); 4407 lp->infoleaf_offset = get_unaligned_le16(p + 1);
4409 4408
4410 return 0; 4409 return 0;
4411} 4410}
@@ -4476,7 +4475,7 @@ srom_exec(struct net_device *dev, u_char *p)
4476 4475
4477 while (count--) { 4476 while (count--) {
4478 gep_wr(((lp->chipset==DC21140) && (lp->ibn!=5) ? 4477 gep_wr(((lp->chipset==DC21140) && (lp->ibn!=5) ?
4479 *p++ : TWIDDLE(w++)), dev); 4478 *p++ : get_unaligned_le16(w++)), dev);
4480 mdelay(2); /* 2ms per action */ 4479 mdelay(2); /* 2ms per action */
4481 } 4480 }
4482 4481
@@ -4711,10 +4710,10 @@ type1_infoblock(struct net_device *dev, u_char count, u_char *p)
4711 lp->active = *p++; 4710 lp->active = *p++;
4712 lp->phy[lp->active].gep = (*p ? p : NULL); p += (*p + 1); 4711 lp->phy[lp->active].gep = (*p ? p : NULL); p += (*p + 1);
4713 lp->phy[lp->active].rst = (*p ? p : NULL); p += (*p + 1); 4712 lp->phy[lp->active].rst = (*p ? p : NULL); p += (*p + 1);
4714 lp->phy[lp->active].mc = TWIDDLE(p); p += 2; 4713 lp->phy[lp->active].mc = get_unaligned_le16(p); p += 2;
4715 lp->phy[lp->active].ana = TWIDDLE(p); p += 2; 4714 lp->phy[lp->active].ana = get_unaligned_le16(p); p += 2;
4716 lp->phy[lp->active].fdx = TWIDDLE(p); p += 2; 4715 lp->phy[lp->active].fdx = get_unaligned_le16(p); p += 2;
4717 lp->phy[lp->active].ttm = TWIDDLE(p); 4716 lp->phy[lp->active].ttm = get_unaligned_le16(p);
4718 return 0; 4717 return 0;
4719 } else if ((lp->media == INIT) && (lp->timeout < 0)) { 4718 } else if ((lp->media == INIT) && (lp->timeout < 0)) {
4720 lp->ibn = 1; 4719 lp->ibn = 1;
@@ -4751,16 +4750,16 @@ type2_infoblock(struct net_device *dev, u_char count, u_char *p)
4751 lp->infoblock_media = (*p) & MEDIA_CODE; 4750 lp->infoblock_media = (*p) & MEDIA_CODE;
4752 4751
4753 if ((*p++) & EXT_FIELD) { 4752 if ((*p++) & EXT_FIELD) {
4754 lp->cache.csr13 = TWIDDLE(p); p += 2; 4753 lp->cache.csr13 = get_unaligned_le16(p); p += 2;
4755 lp->cache.csr14 = TWIDDLE(p); p += 2; 4754 lp->cache.csr14 = get_unaligned_le16(p); p += 2;
4756 lp->cache.csr15 = TWIDDLE(p); p += 2; 4755 lp->cache.csr15 = get_unaligned_le16(p); p += 2;
4757 } else { 4756 } else {
4758 lp->cache.csr13 = CSR13; 4757 lp->cache.csr13 = CSR13;
4759 lp->cache.csr14 = CSR14; 4758 lp->cache.csr14 = CSR14;
4760 lp->cache.csr15 = CSR15; 4759 lp->cache.csr15 = CSR15;
4761 } 4760 }
4762 lp->cache.gepc = ((s32)(TWIDDLE(p)) << 16); p += 2; 4761 lp->cache.gepc = ((s32)(get_unaligned_le16(p)) << 16); p += 2;
4763 lp->cache.gep = ((s32)(TWIDDLE(p)) << 16); 4762 lp->cache.gep = ((s32)(get_unaligned_le16(p)) << 16);
4764 lp->infoblock_csr6 = OMR_SIA; 4763 lp->infoblock_csr6 = OMR_SIA;
4765 lp->useMII = false; 4764 lp->useMII = false;
4766 4765
@@ -4792,10 +4791,10 @@ type3_infoblock(struct net_device *dev, u_char count, u_char *p)
4792 if (MOTO_SROM_BUG) lp->active = 0; 4791 if (MOTO_SROM_BUG) lp->active = 0;
4793 lp->phy[lp->active].gep = (*p ? p : NULL); p += (2 * (*p) + 1); 4792 lp->phy[lp->active].gep = (*p ? p : NULL); p += (2 * (*p) + 1);
4794 lp->phy[lp->active].rst = (*p ? p : NULL); p += (2 * (*p) + 1); 4793 lp->phy[lp->active].rst = (*p ? p : NULL); p += (2 * (*p) + 1);
4795 lp->phy[lp->active].mc = TWIDDLE(p); p += 2; 4794 lp->phy[lp->active].mc = get_unaligned_le16(p); p += 2;
4796 lp->phy[lp->active].ana = TWIDDLE(p); p += 2; 4795 lp->phy[lp->active].ana = get_unaligned_le16(p); p += 2;
4797 lp->phy[lp->active].fdx = TWIDDLE(p); p += 2; 4796 lp->phy[lp->active].fdx = get_unaligned_le16(p); p += 2;
4798 lp->phy[lp->active].ttm = TWIDDLE(p); p += 2; 4797 lp->phy[lp->active].ttm = get_unaligned_le16(p); p += 2;
4799 lp->phy[lp->active].mci = *p; 4798 lp->phy[lp->active].mci = *p;
4800 return 0; 4799 return 0;
4801 } else if ((lp->media == INIT) && (lp->timeout < 0)) { 4800 } else if ((lp->media == INIT) && (lp->timeout < 0)) {
@@ -4835,8 +4834,8 @@ type4_infoblock(struct net_device *dev, u_char count, u_char *p)
4835 lp->cache.csr13 = CSR13; /* Hard coded defaults */ 4834 lp->cache.csr13 = CSR13; /* Hard coded defaults */
4836 lp->cache.csr14 = CSR14; 4835 lp->cache.csr14 = CSR14;
4837 lp->cache.csr15 = CSR15; 4836 lp->cache.csr15 = CSR15;
4838 lp->cache.gepc = ((s32)(TWIDDLE(p)) << 16); p += 2; 4837 lp->cache.gepc = ((s32)(get_unaligned_le16(p)) << 16); p += 2;
4839 lp->cache.gep = ((s32)(TWIDDLE(p)) << 16); p += 2; 4838 lp->cache.gep = ((s32)(get_unaligned_le16(p)) << 16); p += 2;
4840 csr6 = *p++; 4839 csr6 = *p++;
4841 flags = *p++; 4840 flags = *p++;
4842 4841