]> git.ipfire.org Git - people/ms/mstpd.git/blob - driver_deps.c
driver hooks for creating/deleting new MSTI
[people/ms/mstpd.git] / driver_deps.c
1 /*
2 * driver_deps.c Driver-specific code.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 *
9 * Authors: Vitalii Demianets <vitas@nppfactor.kiev.ua>
10 */
11
12 #include <string.h>
13 #include <unistd.h>
14 #include <fcntl.h>
15 #include <asm/byteorder.h>
16
17 #include "log.h"
18 #include "mstp.h"
19
20 /*
21 * Set new state (BR_STATE_xxx) for the given port and MSTI.
22 * Return new actual state (BR_STATE_xxx) from driver.
23 */
24 int driver_set_new_state(per_tree_port_t *ptp, int new_state)
25 {
26 /* TODO: insert driver-specific code here */
27 return new_state;
28 }
29
30 bool driver_create_msti(bridge_t *br, __u16 mstid)
31 {
32 /* TODO: send "create msti" command to driver */
33 return true;
34 }
35
36 bool driver_delete_msti(bridge_t *br, __u16 mstid)
37 {
38 /* TODO: send "delete msti" command to driver */
39 return true;
40 }
41
42 void driver_flush_all_fids(per_tree_port_t *ptp)
43 {
44 /* TODO: do real flushing.
45 * Make it asynchronous, with completion function calling
46 * MSTP_IN_all_fids_flushed(ptp)
47 */
48 MSTP_IN_all_fids_flushed(ptp);
49 }
50
51 /*
52 * Set new ageing time (in seconds) for the bridge.
53 * Return new actual ageing time from driver (the ageing timer granularity
54 * in the hardware can be more than 1 sec)
55 */
56 unsigned int driver_set_ageing_time(bridge_t *br, unsigned int ageingTime)
57 {
58 /* TODO: do set new ageing time */
59 return ageingTime;
60 }