Browse Source

Place netdev_open()/netdev_close() calls in appropriate places.

tags/v0.9.3
Michael Brown 17 years ago
parent
commit
cbd956535e
1 changed files with 24 additions and 8 deletions
  1. 24
    8
      src/interface/pxe/pxe_undi.c

+ 24
- 8
src/interface/pxe/pxe_undi.c View File

49
  */
49
  */
50
 static int undi_tx_count = 0;
50
 static int undi_tx_count = 0;
51
 
51
 
52
+/**
53
+ * Open PXE network device
54
+ *
55
+ * @ret rc		Return status code
56
+ */
57
+static int pxe_netdev_open ( void ) {
58
+	return netdev_open ( pxe_netdev );
59
+}
60
+
61
+/**
62
+ * Close PXE network device
63
+ *
64
+ */
65
+static void pxe_netdev_close ( void ) {
66
+	netdev_close ( pxe_netdev );
67
+	undi_tx_count = 0;
68
+}
69
+
52
 /* PXENV_UNDI_STARTUP
70
 /* PXENV_UNDI_STARTUP
53
  *
71
  *
54
  * Status: working
72
  * Status: working
67
 PXENV_EXIT_t pxenv_undi_cleanup ( struct s_PXENV_UNDI_CLEANUP *undi_cleanup ) {
85
 PXENV_EXIT_t pxenv_undi_cleanup ( struct s_PXENV_UNDI_CLEANUP *undi_cleanup ) {
68
 	DBG ( "PXENV_UNDI_CLEANUP" );
86
 	DBG ( "PXENV_UNDI_CLEANUP" );
69
 
87
 
70
-	netdev_close ( pxe_netdev );
88
+	pxe_netdev_close();
71
 
89
 
72
 	undi_cleanup->Status = PXENV_STATUS_SUCCESS;
90
 	undi_cleanup->Status = PXENV_STATUS_SUCCESS;
73
 	return PXENV_EXIT_SUCCESS;
91
 	return PXENV_EXIT_SUCCESS;
95
 
113
 
96
 	DBG ( "PXENV_UNDI_RESET_ADAPTER" );
114
 	DBG ( "PXENV_UNDI_RESET_ADAPTER" );
97
 
115
 
98
-	netdev_close ( pxe_netdev );
99
-	undi_tx_count = 0;
100
-	if ( ( rc = netdev_open ( pxe_netdev ) ) != 0 ) {
116
+	pxe_netdev_close();
117
+	if ( ( rc = pxe_netdev_open() ) != 0 ) {
101
 		undi_reset_adapter->Status = PXENV_STATUS ( rc );
118
 		undi_reset_adapter->Status = PXENV_STATUS ( rc );
102
 		return PXENV_EXIT_FAILURE;
119
 		return PXENV_EXIT_FAILURE;
103
 	}
120
 	}
114
 				   *undi_shutdown ) {
131
 				   *undi_shutdown ) {
115
 	DBG ( "PXENV_UNDI_SHUTDOWN" );
132
 	DBG ( "PXENV_UNDI_SHUTDOWN" );
116
 
133
 
117
-	shutdown();
134
+	pxe_netdev_close();
118
 
135
 
119
 	undi_shutdown->Status = PXENV_STATUS_SUCCESS;
136
 	undi_shutdown->Status = PXENV_STATUS_SUCCESS;
120
 	return PXENV_EXIT_SUCCESS;
137
 	return PXENV_EXIT_SUCCESS;
129
 
146
 
130
 	DBG ( "PXENV_UNDI_OPEN" );
147
 	DBG ( "PXENV_UNDI_OPEN" );
131
 
148
 
132
-	if ( ( rc = netdev_open ( pxe_netdev ) ) != 0 ) {
149
+	if ( ( rc = pxe_netdev_open() ) != 0 ) {
133
 		undi_open->Status = PXENV_STATUS ( rc );
150
 		undi_open->Status = PXENV_STATUS ( rc );
134
 		return PXENV_EXIT_FAILURE;
151
 		return PXENV_EXIT_FAILURE;
135
 	}
152
 	}
145
 PXENV_EXIT_t pxenv_undi_close ( struct s_PXENV_UNDI_CLOSE *undi_close ) {
162
 PXENV_EXIT_t pxenv_undi_close ( struct s_PXENV_UNDI_CLOSE *undi_close ) {
146
 	DBG ( "PXENV_UNDI_CLOSE" );
163
 	DBG ( "PXENV_UNDI_CLOSE" );
147
 
164
 
148
-	netdev_close ( pxe_netdev );
149
-	undi_tx_count = 0;
165
+	pxe_netdev_close();
150
 
166
 
151
 	undi_close->Status = PXENV_STATUS_SUCCESS;
167
 	undi_close->Status = PXENV_STATUS_SUCCESS;
152
 	return PXENV_EXIT_SUCCESS;
168
 	return PXENV_EXIT_SUCCESS;

Loading…
Cancel
Save