Browse Source

[skel] Remove MII interface

Most drivers do not utilise an MII interface, since the link state is
typically available directly from a memory-mapped register.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 6 years ago
parent
commit
329202691f
2 changed files with 0 additions and 60 deletions
  1. 0
    58
      src/drivers/net/skeleton.c
  2. 0
    2
      src/drivers/net/skeleton.h

+ 0
- 58
src/drivers/net/skeleton.c View File

34
 #include <ipxe/iobuf.h>
34
 #include <ipxe/iobuf.h>
35
 #include <ipxe/malloc.h>
35
 #include <ipxe/malloc.h>
36
 #include <ipxe/pci.h>
36
 #include <ipxe/pci.h>
37
-#include <ipxe/mii.h>
38
 #include "skeleton.h"
37
 #include "skeleton.h"
39
 
38
 
40
 /** @file
39
 /** @file
43
  *
42
  *
44
  */
43
  */
45
 
44
 
46
-/******************************************************************************
47
- *
48
- * MII interface
49
- *
50
- ******************************************************************************
51
- */
52
-
53
-/**
54
- * Read from MII register
55
- *
56
- * @v mii		MII interface
57
- * @v reg		Register address
58
- * @ret value		Data read, or negative error
59
- */
60
-static int skeleton_mii_read ( struct mii_interface *mii, unsigned int reg ) {
61
-	struct skeleton_nic *skel =
62
-		container_of ( mii, struct skeleton_nic, mii );
63
-
64
-	DBGC ( skel, "SKELETON %p does not yet support MII read\n", skel );
65
-	( void ) reg;
66
-	return -ENOTSUP;
67
-}
68
-
69
-/**
70
- * Write to MII register
71
- *
72
- * @v mii		MII interface
73
- * @v reg		Register address
74
- * @v data		Data to write
75
- * @ret rc		Return status code
76
- */
77
-static int skeleton_mii_write ( struct mii_interface *mii, unsigned int reg,
78
-				unsigned int data) {
79
-	struct skeleton_nic *skel =
80
-		container_of ( mii, struct skeleton_nic, mii );
81
-
82
-	DBGC ( skel, "SKELETON %p does not yet support MII write\n", skel );
83
-	( void ) reg;
84
-	( void ) data;
85
-	return -ENOTSUP;
86
-}
87
-
88
-/** Skeleton MII operations */
89
-static struct mii_operations skeleton_mii_operations = {
90
-	.read = skeleton_mii_read,
91
-	.write = skeleton_mii_write,
92
-};
93
-
94
 /******************************************************************************
45
 /******************************************************************************
95
  *
46
  *
96
  * Device reset
47
  * Device reset
254
 	if ( ( rc = skeleton_reset ( skel ) ) != 0 )
205
 	if ( ( rc = skeleton_reset ( skel ) ) != 0 )
255
 		goto err_reset;
206
 		goto err_reset;
256
 
207
 
257
-	/* Initialise and reset MII interface */
258
-	mii_init ( &skel->mii, &skeleton_mii_operations );
259
-	if ( ( rc = mii_reset ( &skel->mii ) ) != 0 ) {
260
-		DBGC ( skel, "SKELETON %p could not reset MII: %s\n",
261
-		       skel, strerror ( rc ) );
262
-		goto err_mii_reset;
263
-	}
264
-
265
 	/* Register network device */
208
 	/* Register network device */
266
 	if ( ( rc = register_netdev ( netdev ) ) != 0 )
209
 	if ( ( rc = register_netdev ( netdev ) ) != 0 )
267
 		goto err_register_netdev;
210
 		goto err_register_netdev;
273
 
216
 
274
 	unregister_netdev ( netdev );
217
 	unregister_netdev ( netdev );
275
  err_register_netdev:
218
  err_register_netdev:
276
- err_mii_reset:
277
 	skeleton_reset ( skel );
219
 	skeleton_reset ( skel );
278
  err_reset:
220
  err_reset:
279
 	iounmap ( skel->regs );
221
 	iounmap ( skel->regs );

+ 0
- 2
src/drivers/net/skeleton.h View File

16
 struct skeleton_nic {
16
 struct skeleton_nic {
17
 	/** Registers */
17
 	/** Registers */
18
 	void *regs;
18
 	void *regs;
19
-	/** MII interface */
20
-	struct mii_interface mii;
21
 };
19
 };
22
 
20
 
23
 #endif /* _SKELETON_H */
21
 #endif /* _SKELETON_H */

Loading…
Cancel
Save