|
@@ -123,6 +123,11 @@ struct interface {
|
123
|
123
|
struct refcnt *refcnt;
|
124
|
124
|
/** Interface descriptor */
|
125
|
125
|
struct interface_descriptor *desc;
|
|
126
|
+ /** Original interface descriptor
|
|
127
|
+ *
|
|
128
|
+ * Used by intf_reinit().
|
|
129
|
+ */
|
|
130
|
+ struct interface_descriptor *original;
|
126
|
131
|
};
|
127
|
132
|
|
128
|
133
|
extern void intf_plug ( struct interface *intf, struct interface *dest );
|
|
@@ -166,6 +171,7 @@ static inline void intf_init ( struct interface *intf,
|
166
|
171
|
intf->dest = &null_intf;
|
167
|
172
|
intf->refcnt = refcnt;
|
168
|
173
|
intf->desc = desc;
|
|
174
|
+ intf->original = desc;
|
169
|
175
|
}
|
170
|
176
|
|
171
|
177
|
/**
|
|
@@ -177,6 +183,7 @@ static inline void intf_init ( struct interface *intf,
|
177
|
183
|
.dest = &null_intf, \
|
178
|
184
|
.refcnt = NULL, \
|
179
|
185
|
.desc = &(descriptor), \
|
|
186
|
+ .original = &(descriptor), \
|
180
|
187
|
}
|
181
|
188
|
|
182
|
189
|
/**
|
|
@@ -236,4 +243,15 @@ static inline void intf_init ( struct interface *intf,
|
236
|
243
|
*/
|
237
|
244
|
#define INTF_INTF_DBG( intf, dest ) INTF_DBG ( intf ), INTF_DBG ( dest )
|
238
|
245
|
|
|
246
|
+/**
|
|
247
|
+ * Reinitialise an object interface
|
|
248
|
+ *
|
|
249
|
+ * @v intf Object interface
|
|
250
|
+ */
|
|
251
|
+static inline void intf_reinit ( struct interface *intf ) {
|
|
252
|
+
|
|
253
|
+ /* Restore original interface descriptor */
|
|
254
|
+ intf->desc = intf->original;
|
|
255
|
+}
|
|
256
|
+
|
239
|
257
|
#endif /* _IPXE_INTERFACE_H */
|