Переглянути джерело

Import ethtool from packages, add myself as maintainer, update to 3.14

Matthias Schiffer 10 роки тому
джерело
коміт
42b53ad327
2 змінених файлів з 208 додано та 0 видалено
  1. 42
    0
      net/ethtool/Makefile
  2. 166
    0
      net/ethtool/patches/100-ixp4xx.patch

+ 42
- 0
net/ethtool/Makefile Переглянути файл

@@ -0,0 +1,42 @@
1
+#
2
+# Copyright (C) 2006-2014 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=ethtool
11
+PKG_VERSION:=3.14
12
+PKG_RELEASE:=1
13
+
14
+PKG_MAINTAINER:=Matthias Schiffer <mschiffer@universe-factory.net>
15
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
16
+PKG_SOURCE_URL:=@KERNEL/software/network/ethtool
17
+PKG_MD5SUM:=d46b809ddd672b51d7e23787ae9122e0
18
+
19
+PKG_FIXUP:=autoreconf
20
+PKG_INSTALL:=1
21
+PKG_BUILD_PARALLEL:=1
22
+
23
+include $(INCLUDE_DIR)/package.mk
24
+
25
+define Package/ethtool
26
+  SECTION:=net
27
+  CATEGORY:=Network
28
+  TITLE:=Display or change ethernet card settings
29
+  URL:=http://www.kernel.org/pub/software/network/ethtool/
30
+endef
31
+
32
+define Package/ethtool/description
33
+ ethtool is a small utility for examining and tuning your ethernet-based
34
+ network interface
35
+endef
36
+
37
+define Package/ethtool/install
38
+	$(INSTALL_DIR) $(1)/usr/sbin
39
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/ethtool $(1)/usr/sbin
40
+endef
41
+
42
+$(eval $(call BuildPackage,ethtool))

+ 166
- 0
net/ethtool/patches/100-ixp4xx.patch Переглянути файл

@@ -0,0 +1,166 @@
1
+--- a/Makefile.am
2
++++ b/Makefile.am
3
+@@ -13,7 +13,7 @@ ethtool_SOURCES += \
4
+ 		  fec_8xx.c ibm_emac.c ixgb.c ixgbe.c natsemi.c	\
5
+ 		  pcnet32.c realtek.c tg3.c marvell.c vioc.c	\
6
+ 		  smsc911x.c at76c50x-usb.c sfc.c stmmac.c	\
7
+-		  sfpid.c sfpdiag.c ixgbevf.c
8
++		  sfpid.c sfpdiag.c ixgbevf.c ixp4xx.c
9
+ endif
10
+ 
11
+ TESTS = test-cmdline test-features
12
+--- a/ethtool.c
13
++++ b/ethtool.c
14
+@@ -894,6 +894,7 @@ static const struct {
15
+ 	{ "ixgb", ixgb_dump_regs },
16
+ 	{ "ixgbe", ixgbe_dump_regs },
17
+ 	{ "ixgbevf", ixgbevf_dump_regs },
18
++	{ "ixp4xx", ixp4xx_dump_regs },
19
+ 	{ "natsemi", natsemi_dump_regs },
20
+ 	{ "e100", e100_dump_regs },
21
+ 	{ "amd8111e", amd8111e_dump_regs },
22
+--- a/internal.h
23
++++ b/internal.h
24
+@@ -243,6 +243,9 @@ int st_gmac_dump_regs(struct ethtool_drv
25
+ /* Et131x ethernet controller */
26
+ int et131x_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs);
27
+ 
28
++/* Intel IXP4xx internal MAC */
29
++int ixp4xx_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs);
30
++
31
+ /* Rx flow classification */
32
+ int rxclass_parse_ruleopts(struct cmd_context *ctx,
33
+ 			   struct ethtool_rx_flow_spec *fsp);
34
+--- /dev/null
35
++++ b/ixp4xx.c
36
+@@ -0,0 +1,130 @@
37
++/*
38
++ * Copyright (c) 2006 Christian Hohnstaed <chohnstaedt@innominate.com>
39
++ * This file is released under the GPLv2
40
++ */
41
++
42
++#include <stdio.h>
43
++#include "internal.h"
44
++
45
++#ifndef BIT
46
++#define BIT(x) (1<<x)
47
++#endif
48
++
49
++#define TX_CNTRL1_TX_EN         BIT(0)
50
++#define TX_CNTRL1_DUPLEX        BIT(1)
51
++#define TX_CNTRL1_RETRY         BIT(2)
52
++#define TX_CNTRL1_PAD_EN        BIT(3)
53
++#define TX_CNTRL1_FCS_EN        BIT(4)
54
++#define TX_CNTRL1_2DEFER        BIT(5)
55
++#define TX_CNTRL1_RMII          BIT(6)
56
++
57
++/* TX Control Register 2 */
58
++#define TX_CNTRL2_RETRIES_MASK  0xf
59
++
60
++/* RX Control Register 1 */
61
++#define RX_CNTRL1_RX_EN         BIT(0)
62
++#define RX_CNTRL1_PADSTRIP_EN   BIT(1)
63
++#define RX_CNTRL1_CRC_EN        BIT(2)
64
++#define RX_CNTRL1_PAUSE_EN      BIT(3)
65
++#define RX_CNTRL1_LOOP_EN       BIT(4)
66
++#define RX_CNTRL1_ADDR_FLTR_EN  BIT(5)
67
++#define RX_CNTRL1_RX_RUNT_EN    BIT(6)
68
++#define RX_CNTRL1_BCAST_DIS     BIT(7)
69
++
70
++/* Core Control Register */
71
++#define CORE_RESET              BIT(0)
72
++#define CORE_RX_FIFO_FLUSH      BIT(1)
73
++#define CORE_TX_FIFO_FLUSH      BIT(2)
74
++#define CORE_SEND_JAM           BIT(3)
75
++#define CORE_MDC_EN             BIT(4)
76
++
77
++#define MAC "%02x:%02x:%02x:%02x:%02x:%02x"
78
++#define MAC_DATA(d) (d)[0], (d)[1], (d)[2], (d)[3], (d)[4], (d)[5]
79
++
80
++int ixp4xx_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
81
++{
82
++	u8 *data = regs->data;
83
++
84
++	fprintf(stdout,
85
++		"TXctrl:          0x%02x:0x%02x\n"
86
++		"    Enable:      %s\n"
87
++		"    Duplex:      %s\n"
88
++		"    Retry:       %s (%d)\n"
89
++		"    Padding:     %s\n"
90
++		"    Frame check: %s\n"
91
++		"    TX deferral: %s\n"
92
++		"    Connection:  %s\n"
93
++		"\n",
94
++		data[0], data[1],
95
++		data[0] & TX_CNTRL1_TX_EN   ? "yes"      : "no",
96
++		data[0] & TX_CNTRL1_DUPLEX  ? "half"     : "full",
97
++		data[0] & TX_CNTRL1_RETRY   ? "enabled"  : "disabled",
98
++		data[1] & TX_CNTRL2_RETRIES_MASK,
99
++		data[0] & TX_CNTRL1_PAD_EN  ? "enabled"  : "disabled",
100
++		data[0] & TX_CNTRL1_FCS_EN  ? "enabled"  : "disabled",
101
++		data[0] & TX_CNTRL1_2DEFER  ? "two-part" : "one-part",
102
++		data[0] & TX_CNTRL1_RMII    ? "RMII"     : "Full MII"
103
++	);
104
++
105
++	fprintf(stdout,
106
++		"RXctrl:          0x%02x\n"
107
++		"    Enable:      %s\n"
108
++		"    Pad strip:   %s\n"
109
++		"    CRC check:   %s\n"
110
++		"    Pause:       %s\n"
111
++		"    Loop:        %s\n"
112
++		"    Promiscous:  %s\n"
113
++		"    Runt frames: %s\n"
114
++		"    Broadcast:   %s\n"
115
++		"\n",
116
++		data[2],
117
++		data[2] & RX_CNTRL1_RX_EN        ? "yes"      : "no",
118
++		data[2] & RX_CNTRL1_PADSTRIP_EN  ? "enabled"  : "disabled",
119
++		data[2] & RX_CNTRL1_CRC_EN       ? "enabled"  : "disabled",
120
++		data[2] & RX_CNTRL1_PAUSE_EN     ? "enabled"  : "disabled",
121
++		data[2] & RX_CNTRL1_LOOP_EN      ? "enabled"  : "disabled",
122
++		data[2] & RX_CNTRL1_ADDR_FLTR_EN ? "disabled" : "enabled",
123
++		data[2] & RX_CNTRL1_RX_RUNT_EN   ? "forward"  : "discard",
124
++		data[2] & RX_CNTRL1_BCAST_DIS    ? "disabled" : "enabled"
125
++	);
126
++	fprintf(stdout,
127
++		"Core control:    0x%02x\n"
128
++		"    Core state:  %s\n"
129
++		"    RX fifo:     %s\n"
130
++		"    TX fifo:     %s\n"
131
++		"    Send jam:    %s\n"
132
++		"    MDC clock    %s\n"
133
++		"\n",
134
++		data[32],
135
++		data[32] & CORE_RESET          ? "reset"  : "normal operation",
136
++		data[32] & CORE_RX_FIFO_FLUSH  ? "flush"  : "ok",
137
++		data[32] & CORE_TX_FIFO_FLUSH  ? "flush"  : "ok",
138
++		data[32] & CORE_SEND_JAM       ? "yes"    : "no",
139
++		data[32] & CORE_MDC_EN         ? "output" : "input"
140
++	);
141
++	fprintf(stdout,
142
++		"MAC addresses: \n"
143
++		"  Multicast mask:     " MAC "\n"
144
++		"  Multicast address:  " MAC "\n"
145
++		"  Unicast address:    " MAC "\n"
146
++		"\n",
147
++		MAC_DATA(data+13), MAC_DATA(data+19), MAC_DATA(data+26)
148
++	);
149
++	fprintf(stdout,
150
++		"Random seed:      0x%02x\n"
151
++		"Threshold empty:   %3d\n"
152
++		"Threshold full:    %3d\n"
153
++		"TX buffer size:    %3d\n"
154
++		"TX deferral:       %3d\n"
155
++		"RX deferral:       %3d\n"
156
++		"TX two deferral 1: %3d\n"
157
++		"TX two deferral 2: %3d\n"
158
++		"Slot time:         %3d\n"
159
++		"Internal clock:    %3d\n"
160
++		"\n",
161
++		data[4], data[5], data[6], data[7], data[8], data[9],
162
++		data[10], data[11], data[12], data[25]
163
++	);
164
++
165
++	return 0;
166
++}