📄 bcm5700-7.4.11-2.4.27.patch
字号:
+ struct+ {+ unsigned int reserved_4:5;+ unsigned int lp_full_duplex:1;+ unsigned int lp_half_duplex:1;+ unsigned int lp_sym_pause:1;+ unsigned int lp_asym_pause:1;+ unsigned int reserved_11:3;+ unsigned int lp_remote_fault1:1;+ unsigned int lp_remote_fault2:1;+ unsigned int lp_ack:1;+ unsigned int lp_next_page:1;+ } bits;++ unsigned short AsUSHORT;++ #define mr_lp_adv_full_duplex Mr5.bits.lp_full_duplex+ #define mr_lp_adv_half_duplex Mr5.bits.lp_half_duplex+ #define mr_lp_adv_sym_pause Mr5.bits.lp_sym_pause+ #define mr_lp_adv_asym_pause Mr5.bits.lp_asym_pause+ #define mr_lp_adv_remote_fault1 Mr5.bits.lp_remote_fault1+ #define mr_lp_adv_remote_fault2 Mr5.bits.lp_remote_fault2+ #define mr_lp_adv_next_page Mr5.bits.lp_next_page+ } Mr5;++ /* Auto-negotiation expansion register. */+ union+ {+ struct+ {+ unsigned int reserved_0:1;+ unsigned int page_received:1;+ unsigned int next_pageable:1;+ unsigned int reserved_15:13;+ } bits;++ unsigned short AsUSHORT;+ } Mr6;++ /* Auto-negotiation next page transmit register. */+ union+ {+ struct+ {+ unsigned int code_field:11;+ unsigned int toggle:1;+ unsigned int ack2:1;+ unsigned int message_page:1;+ unsigned int reserved_14:1;+ unsigned int next_page:1;+ } bits;++ unsigned short AsUSHORT;++ #define mr_np_tx Mr7.AsUSHORT+ } Mr7;++ /* Auto-negotiation link partner ability register. */+ union+ {+ struct+ {+ unsigned int code_field:11;+ unsigned int toggle:1;+ unsigned int ack2:1;+ unsigned int message_page:1;+ unsigned int ack:1;+ unsigned int next_page:1;+ } bits;++ unsigned short AsUSHORT;+ + #define mr_lp_np_rx Mr8.AsUSHORT+ } Mr8;++ /* Extended status register. */+ union+ {+ struct+ {+ unsigned int reserved_11:12;+ unsigned int base1000_t_hd:1;+ unsigned int base1000_t_fd:1;+ unsigned int base1000_x_hd:1;+ unsigned int base1000_x_fd:1;+ } bits; ++ unsigned short AsUSHORT;+ } Mr15;++ /* Miscellaneous state variables. */+ union+ {+ struct+ {+ unsigned int toggle_tx:1;+ unsigned int toggle_rx:1;+ unsigned int np_rx:1;+ unsigned int page_rx:1;+ unsigned int np_loaded:1;+ } bits;++ unsigned short AsUSHORT;++ #define mr_toggle_tx MrMisc.bits.toggle_tx+ #define mr_toggle_rx MrMisc.bits.toggle_rx+ #define mr_np_rx MrMisc.bits.np_rx+ #define mr_page_rx MrMisc.bits.page_rx+ #define mr_np_loaded MrMisc.bits.np_loaded+ } MrMisc;++} AN_STATE_INFO, *PAN_STATE_INFO;++++/******************************************************************************/+/* Return code of Autoneg8023z. */+/******************************************************************************/++typedef enum+{+ AUTONEG_STATUS_OK = 0,+ AUTONEG_STATUS_DONE = 1,+ AUTONEG_STATUS_TIMER_ENABLED = 2,+// AUTONEG_STATUS_FAILED = 0xffffffff,+ AUTONEG_STATUS_FAILED = 0xfffffff+} AUTONEG_STATUS, *PAUTONEG_STATUS;++++/******************************************************************************/+/* Function prototypes. */+/******************************************************************************/++AUTONEG_STATUS Autoneg8023z(PAN_STATE_INFO pAnInfo);+void AutonegInit(PAN_STATE_INFO pAnInfo);++++/******************************************************************************/+/* The following functions are defined in the os-dependent module. */+/******************************************************************************/++void MM_AnTxConfig(PAN_STATE_INFO pAnInfo);+void MM_AnTxIdle(PAN_STATE_INFO pAnInfo);+char MM_AnRxConfig(PAN_STATE_INFO pAnInfo, unsigned short *pRxConfig);++++#endif /* AUTONEG_H */+diff -u --recursive --new-file linux-2.4.27/drivers/net/bcm/b57diag.c linux-2.4.27.patch/drivers/net/bcm/b57diag.c--- linux-2.4.27/drivers/net/bcm/b57diag.c 1969-12-31 16:00:00.000000000 -0800+++ linux-2.4.27.patch/drivers/net/bcm/b57diag.c 2004-12-15 19:14:11.831242616 -0800@@ -0,0 +1,730 @@+/******************************************************************************/+/* */+/* Broadcom BCM5700 Linux Network Driver, Copyright (c) 2000 - 2004 Broadcom */+/* Corporation. */+/* All rights reserved. */+/* */+/* 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 Free Software Foundation, located in the file LICENSE. */+/* */+/* ethtool -t selftest code. */+/* */+/******************************************************************************/++#include "mm.h"+#ifdef ETHTOOL_TEST++typedef struct reg_entry+{+ LM_UINT16 offset;+ LM_UINT16 flags;+#define BCM5705_ONLY 1+#define NOT_FOR_BCM5705 2+#define NOT_FOR_BCM5788 4+ LM_UINT32 read_mask;+ LM_UINT32 write_mask;+} reg_entry_t;++typedef struct mem_entry+{+ LM_UINT32 offset;+ LM_UINT32 len;+} mem_entry_t;++/* Returns 1 on success, 0 on failure */+int+b57_test_registers(UM_DEVICE_BLOCK *pUmDevice)+{+ LM_DEVICE_BLOCK *pDevice = &pUmDevice->lm_dev;+ int ret;+ int i, bcm5705;+ LM_UINT32 offset, read_mask, write_mask, val, save_val, read_val;+ static reg_entry_t reg_tbl[] = {+ /* MAC block */+ { 0x0400, 0x0002, 0x00000000, 0x00ef6f8c },+ { 0x0400, 0x0001, 0x00000000, 0x01ef6b8c }, /* 5705 */+ { 0x0404, 0x0002, 0x03800107, 0x00000000 },+ { 0x0404, 0x0001, 0x03800100, 0x00000000 }, /* 5705 */+ { 0x0408, 0x0002, 0x00000000, 0x07c01400 },+ { 0x0408, 0x0001, 0x00000000, 0x07c01000 }, /* 5705 */+ { 0x040c, 0x0000, 0x00000000, 0xfff8007f },+ { 0x0410, 0x0000, 0x00000000, 0x0000ffff },+ { 0x0414, 0x0000, 0x00000000, 0xffffffff },+ { 0x0418, 0x0000, 0x00000000, 0x0000ffff },+ { 0x041c, 0x0000, 0x00000000, 0xffffffff },+ { 0x0420, 0x0000, 0x00000000, 0x0000ffff },+ { 0x0424, 0x0000, 0x00000000, 0xffffffff },+ { 0x0428, 0x0000, 0x00000000, 0x0000ffff },+ { 0x042c, 0x0000, 0x00000000, 0xffffffff },+ { 0x0430, 0x0002, 0x00000000, 0xffffffff },+ { 0x0430, 0x0001, 0x00000000, 0x0fff03ff }, /* 5705 */+ { 0x0434, 0x0002, 0x00000000, 0x0fffffff },+ { 0x0434, 0x0001, 0x00000000, 0x000001ff }, /* 5705 */+ { 0x043c, 0x0000, 0x00000000, 0x0000ffff },+ { 0x0454, 0x0000, 0x00000000, 0x00000010 },+ { 0x045c, 0x0000, 0x00000000, 0x00000070 },+ { 0x0464, 0x0000, 0x00000000, 0x00003fff },+ { 0x0468, 0x0002, 0x00000000, 0x000007fc },+ { 0x0468, 0x0001, 0x00000000, 0x000007dc }, /* 5705 */+ { 0x0470, 0x0000, 0x00000000, 0xffffffff },+ { 0x0474, 0x0000, 0x00000000, 0xffffffff },+ { 0x0478, 0x0000, 0x00000000, 0xffffffff },+ { 0x047c, 0x0000, 0x00000000, 0xffffffff },+ { 0x0480, 0x0002, 0x00000000, 0xffffffff },+ { 0x0480, 0x0001, 0x00000000, 0xe7ffffff }, /* 5705 */+ { 0x0484, 0x0000, 0x00000000, 0xffffffff },+ { 0x0488, 0x0002, 0x00000000, 0xffffffff },+ { 0x0488, 0x0001, 0x00000000, 0xe7ffffff }, /* 5705 */+ { 0x048c, 0x0000, 0x00000000, 0xffffffff },+ { 0x0490, 0x0002, 0x00000000, 0xffffffff },+ { 0x0490, 0x0001, 0x00000000, 0xe7ffffff }, /* 5705 */+ { 0x0494, 0x0000, 0x00000000, 0xffffffff },+ { 0x0498, 0x0002, 0x00000000, 0xffffffff },+ { 0x0498, 0x0001, 0x00000000, 0xe7ffffff }, /* 5705 */+ { 0x049c, 0x0000, 0x00000000, 0xffffffff },+ { 0x04a0, 0x0002, 0x00000000, 0xffffffff },+ { 0x04a0, 0x0001, 0x00000000, 0xe7ffffff }, /* 5705 */+ { 0x04a4, 0x0000, 0x00000000, 0xffffffff },+ { 0x04a8, 0x0002, 0x00000000, 0xffffffff },+ { 0x04a8, 0x0001, 0x00000000, 0xe7ffffff }, /* 5705 */+ { 0x04ac, 0x0000, 0x00000000, 0xffffffff },+ { 0x04b0, 0x0002, 0x00000000, 0xffffffff },+ { 0x04b0, 0x0001, 0x00000000, 0xe7ffffff }, /* 5705 */+ { 0x04b4, 0x0000, 0x00000000, 0xffffffff },+ { 0x04b8, 0x0002, 0x00000000, 0xffffffff },+ { 0x04b8, 0x0001, 0x00000000, 0xe7ffffff }, /* 5705 */+ { 0x04bc, 0x0000, 0x00000000, 0xffffffff },+ { 0x04c0, 0x0002, 0x00000000, 0xffffffff },+ { 0x04c4, 0x0002, 0x00000000, 0xffffffff },+ { 0x04c8, 0x0002, 0x00000000, 0xffffffff },+ { 0x04cc, 0x0002, 0x00000000, 0xffffffff },+ { 0x04d0, 0x0002, 0x00000000, 0xffffffff },+ { 0x04d4, 0x0002, 0x00000000, 0xffffffff },+ { 0x04d8, 0x0002, 0x00000000, 0xffffffff },+ { 0x04dc, 0x0002, 0x00000000, 0xffffffff },+ { 0x04e0, 0x0002, 0x00000000, 0xffffffff },+ { 0x04e4, 0x0002, 0x00000000, 0xffffffff },+ { 0x04e8, 0x0002, 0x00000000, 0xffffffff },+ { 0x04ec, 0x0002, 0x00000000, 0xffffffff },+ { 0x04f0, 0x0002, 0x00000000, 0xffffffff },+ { 0x04f4, 0x0002, 0x00000000, 0xffffffff },+ { 0x04f8, 0x0002, 0x00000000, 0xffffffff },+ { 0x04fc, 0x0002, 0x00000000, 0xffffffff },+ { 0x0500, 0x0002, 0x00000000, 0x000000f8 },+ { 0x0500, 0x0001, 0x00000000, 0x00000008 }, /* 5705 */++ /* Send Data Initiator Control Registers */+ { 0x0c00, 0x0000, 0x00000000, 0x00000006 },+ { 0x0c04, 0x0000, 0x00000004, 0x00000000 },+ { 0x0c08, 0x0000, 0x00000000, 0x0000001b },+ { 0x0c0c, 0x0002, 0x00000000, 0x00ffffff },+ { 0x0c0c, 0x0001, 0x00000000, 0x00000001 },+ { 0x0c80, 0x0000, 0x000003ff, 0x00000000 },+ { 0x0c84, 0x0002, 0x000003ff, 0x00000000 },+ { 0x0c88, 0x0002, 0x000003ff, 0x00000000 },+ { 0x0c8c, 0x0002, 0x000003ff, 0x00000000 },+ { 0x0c90, 0x0002, 0x000003ff, 0x00000000 },+ { 0x0c94, 0x0002, 0x000003ff, 0x00000000 },+ { 0x0c98, 0x0002, 0x000003ff, 0x00000000 },+ { 0x0c9c, 0x0002, 0x000003ff, 0x00000000 },+ { 0x0ca0, 0x0002, 0x000003ff, 0x00000000 },+ { 0x0ca4, 0x0002, 0x000003ff, 0x00000000 },+ { 0x0ca8, 0x0002, 0x000003ff, 0x00000000 },+ { 0x0cac, 0x0002, 0x000003ff, 0x00000000 },+ { 0x0cb0, 0x0002, 0x000003ff, 0x00000000 },+ { 0x0cb4, 0x0002, 0x000003ff, 0x00000000 },+ { 0x0cb8, 0x0002, 0x000003ff, 0x00000000 },+ { 0x0cbc, 0x0002, 0x000003ff, 0x00000000 },+ { 0x0cc0, 0x0002, 0x000003ff, 0x00000000 },+ { 0x0cc4, 0x0002, 0x000003ff, 0x00000000 },+ { 0x0cc8, 0x0002, 0x000003ff, 0x00000000 },+ { 0x0ccc, 0x0002, 0x000003ff, 0x00000000 },+ { 0x0cd0, 0x0002, 0x000003ff, 0x00000000 },+ { 0x0cd4, 0x0002, 0x000003ff, 0x00000000 },+ { 0x0cd8, 0x0002, 0x000003ff, 0x00000000 },+ { 0x0cdc, 0x0002, 0x000003ff, 0x00000000 },+ { 0x0ce0, 0x0001, 0x00000000, 0xffffffff }, /* 5705 */+ { 0x0ce4, 0x0001, 0x00000000, 0xffffffff }, /* 5705 */+ { 0x0ce8, 0x0001, 0x00000000, 0x00ffffff }, /* 5705 */+ { 0x0cec, 0x0001, 0x00000000, 0x000efcf7 }, /* 5705 */+ { 0x0cf0, 0x0001, 0x00000000, 0x0000ffff }, /* 5705 */+ { 0x0cf4, 0x0001, 0x00000000, 0x20000000 }, /* 5705 */++ /* SDC Control Registers */+ { 0x1000, 0x0000, 0x00000000, 0x00000002 },+ { 0x1008, 0x0001, 0x00000000, 0x40000000 }, /* 5705 */++ /* Send BD Ring Selector Control Registers. */+ { 0x1400, 0x0000, 0x00000000, 0x00000006 },+ { 0x1404, 0x0000, 0x00000004, 0x00000000 },+ { 0x1408, 0x0000, 0x0000ffff, 0x00000000 },+ { 0x1440, 0x0000, 0x0000000f, 0x00000000 },+ { 0x1444, 0x0002, 0x0000000f, 0x00000000 },+ { 0x1448, 0x0002, 0x0000000f, 0x00000000 },+ { 0x144c, 0x0002, 0x0000000f, 0x00000000 },+ { 0x1450, 0x0002, 0x0000000f, 0x00000000 },+ { 0x1454, 0x0002, 0x0000000f, 0x00000000 },+ { 0x1458, 0x0002, 0x0000000f, 0x00000000 },+ { 0x145c, 0x0002, 0x0000000f, 0x00000000 },+ { 0x1460, 0x0002, 0x0000000f, 0x00000000 },+ { 0x1464, 0x0002, 0x0000000f, 0x00000000 },+ { 0x1468, 0x0002, 0x0000000f, 0x00000000 },+ { 0x146c, 0x0002, 0x0000000f, 0x00000000 },+ { 0x1470, 0x0002, 0x0000000f, 0x00000000 },+ { 0x1474, 0x0002, 0x0000000f, 0x00000000 },+ { 0x1478, 0x0002, 0x0000000f, 0x00000000 },+ { 0x147c, 0x0002, 0x0000000f, 0x00000000 },++ /* Send BD Inititor Control Registers.*/+ { 0x1800, 0x0000, 0x00000000, 0x00000006 },+ { 0x1804, 0x0000, 0x00000004, 0x00000000 },+ { 0x1808, 0x0000, 0xffffffff, 0x00000000 },+ { 0x180c, 0x0002, 0xffffffff, 0x00000000 },+ { 0x1810, 0x0002, 0xffffffff, 0x00000000 },+ { 0x1814, 0x0002, 0xffffffff, 0x00000000 },+ { 0x1818, 0x0002, 0xffffffff, 0x00000000 },+ { 0x181c, 0x0002, 0xffffffff, 0x00000000 },+ { 0x1820, 0x0002, 0xffffffff, 0x00000000 },+ { 0x1824, 0x0002, 0xffffffff, 0x00000000 },+ { 0x1828, 0x0002, 0xffffffff, 0x00000000 },
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -