I would do something similar to what you suggested.. but perhaps
not add a "struct stp_net_iface" but just directly add a function
pointer to "struct net_device" which takes the bridge port group
struct pointer, the device pointer itself, and a new stp state value.

Or perhaps just add the function pointer directly to net_bridge_port.
(Sounds cleaner.)

Of course this would all be a dirty hack at best.  STP shouldn't be in
the kernel at all.. wish I realised that earlier :/



On Thu, Jan 30, 2003 at 02:47:15PM -0500, Dan Eble wrote:

> I sent this message to Lennert Buytenhek last Friday, but he must be busy 
> because I haven't received a response yet.  I would appreciate any input 
> anyone has on the subject.  A few google searches didn't turn up anything 
> like this.
> 
> -----Original Message-----
> From: Eble, Dan 
> Sent: Friday, January 24, 2003 4:37 PM
> To: '[EMAIL PROTECTED]'
> Subject: Integrated Hardware/Software Bridging
> 
> 
> Good day,
> 
> I'm using Linux 2.4.18 in an embedded system.  I would like to make a
> managed ethernet switch (Broadcom 5325M) work with the Linux bridge
> driver, including supporting Spanning Tree Protocol.  (Following my
> signature is a diagram that may help you understand the software
> architecture I am about to describe.  You can turn it into postscript
> format with "dot -Tps -o <outputfile> <sourcefile>".  If you don't have
> dot, I will happily send you a postscript version.)
> 
> The BCM 5325M is a 6-port managed ethernet switch.  It offers a way to
> set the Spanning Tree state of each port in hardware.  (The STP
> algorithm itself is not implemented in hardware, but the switch modifies
> its forwarding behavior according to the STP state of each port.)
> 
> The switch driver presents a network device for each port (mii0 to
> mii5).  The current implementation does not allow sending or receiving
> any packets via these devices, but it does allow their physical aspects
> to be managed with "ifconfig" and "mii-tool".  My plan is to allow STP
> PDUs to pass through these devices, so that they may be enslaved to a
> bridge device to participate in Spanning Tree.  (In the diagram, you
> will see that eth0 is enslaved to the BCM 5325M driver.  The switch
> encapsulates STP PDUs received on all ports in specially tagged frames
> and sends them to the CPU via eth0.  The BCM 5325M driver will
> distribute the STP PDUs to the correct miiX device and send everything
> else to the eth1 device.)
> 
> Given what I've said so far, do you see a better way?
> 
> In order for this design to work, the BCM 5325M driver must be informed
> of the STP state.  Can you suggest a good way to accomplish this within
> the existing bridge driver?
> 
> I have examined it for about 15 minutes and my first idea is to add an
> element to "struct net_device" that points to a "struct stp_net_iface"
> (or something like that) provided by the switch driver.  When the bridge
> driver changes the STP state, if this pointer is not NULL, it will call
> a function within "stp_net_iface" to set the STP state in the hardware.
> 
> My second idea is to add an ioctl to do the same thing.  Which is a
> better idea?  Is there a better third way that hasn't occurred to me?
> (Is this already possible by means I have overlooked?)
> 
> Thank you for your time.
> 
> -- 
> Dan Eble <[EMAIL PROTECTED]>  _____  .
>                            |  _  |/|
> Applied Innovation Inc.    | |_| | |
> http://www.aiinet.com/     |__/|_|_|
> 
> digraph "g" {
>       graph [
>               fontsize = "10"
>               fontname = "Helvetica"
>       ]
>       node [
>               fontsize = "10"
>               fontname = "Helvetica"
>               shape = "record"
>       ]
>       edge [
>               fontsize = "10"
>               fontname = "Helvetica"
>               dir = "none"
>       ]
> 
>       "nothing" [
>               style = "dashed"
>               shape = "ellipse"
>       ]
> 
>       "routing" [
>               label = "Routing"
>       ]
> 
>       "BCM" [
>               label = "BCM 5325M\nDriver"
>       ]
> 
>       "FEC" [
>               label = "FEC\nDriver"
>       ]
> 
>       "br0" [
>               label = "Bridging"
>       ]
> 
>       "WAN" [
>               label = "WAN\nDriver"
>       ]
> 
>       "routing" -> "br0" [
>               label = "br0"
>       ]
> 
>       "nothing" -> "BCM" [
>               label = "mii5"
>       ]
> 
>       "br0" -> "BCM" [
>               label = "mii0..4"
>       ]
> 
>       "routing" -> "WAN" [
>               label = "wanY"
>       ]
> 
>       "br0" -> "BCM" [
>               label = "eth1\n(STP off)"
>       ]
> 
>       "br0" -> "WAN" [
>               label = "wanX"
>       ]
> 
>       "BCM" -> "FEC" [
>               label = "eth0"
>       ]
> }
> 
> _______________________________________________
> Bridge mailing list
> [EMAIL PROTECTED]
> http://www.math.leidenuniv.nl/mailman/listinfo/bridge
_______________________________________________
Bridge mailing list
[EMAIL PROTECTED]
http://www.math.leidenuniv.nl/mailman/listinfo/bridge

Reply via email to