From owner-freebsd-new-bus Tue Mar 14 12:53: 8 2000 Delivered-To: freebsd-new-bus@freebsd.org Received: from cs.rpi.edu (mumble.cs.rpi.edu [128.213.8.16]) by hub.freebsd.org (Postfix) with ESMTP id 5957437B6F6 for ; Tue, 14 Mar 2000 12:53:03 -0800 (PST) (envelope-from crossd@cs.rpi.edu) Received: from cs.rpi.edu (monica.cs.rpi.edu [128.213.7.2]) by cs.rpi.edu (8.9.3/8.9.3) with ESMTP id PAA15847 for ; Tue, 14 Mar 2000 15:52:45 -0500 (EST) Message-Id: <200003142052.PAA15847@cs.rpi.edu> To: freebsd-new-bus@freebsd.org Subject: Spring Break and CardBus Date: Tue, 14 Mar 2000 15:52:44 -0500 From: "David E. Cross" Sender: owner-freebsd-new-bus@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Spring break has descended upon me, and I find myself with less overwork, enough so that I think I can finish up an alpha CardBus port in this next week. What I need is some answers to a couple of questions. The first is regarding resource allocation. Normally this is done for us by the BIOS when it walks the PCI bus is my understanding. This is, understandably, not possible with something dynamic like CardBus. What I have is a card is inserted into socket 0, it asks for 4k of memory space, and 16 bytes of IO space. I need to allocate this space out of the pool available to its parent controller (also, in some cases I need to allocate it to the parent controller in the first place). How do I do this? What about IRQ binding? As above mentioned, I sometimes need to configure the parent controller itself... in these cases I also need to assign PCI bus numbers... how do I do this? -- David Cross | email: crossd@cs.rpi.edu Acting Lab Director | NYSLP: FREEBSD Systems Administrator/Research Programmer | Web: http://www.cs.rpi.edu/~crossd Rensselaer Polytechnic Institute, | Ph: 518.276.2860 Department of Computer Science | Fax: 518.276.4033 I speak only for myself. | WinNT:Linux::Linux:FreeBSD To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-new-bus" in the body of the message From owner-freebsd-new-bus Tue Mar 14 13:14: 4 2000 Delivered-To: freebsd-new-bus@freebsd.org Received: from rover.village.org (rover.village.org [204.144.255.49]) by hub.freebsd.org (Postfix) with ESMTP id 66F3637B6C5 for ; Tue, 14 Mar 2000 13:13:53 -0800 (PST) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.9.3/8.9.3) with ESMTP id OAA91321; Tue, 14 Mar 2000 14:13:43 -0700 (MST) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.9.3/8.8.3) with ESMTP id OAA46342; Tue, 14 Mar 2000 14:13:38 -0700 (MST) Message-Id: <200003142113.OAA46342@harmony.village.org> To: "David E. Cross" Subject: Re: Spring Break and CardBus Cc: freebsd-new-bus@FreeBSD.ORG In-reply-to: Your message of "Tue, 14 Mar 2000 15:52:44 EST." <200003142052.PAA15847@cs.rpi.edu> References: <200003142052.PAA15847@cs.rpi.edu> Date: Tue, 14 Mar 2000 14:13:38 -0700 From: Warner Losh Sender: owner-freebsd-new-bus@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message <200003142052.PAA15847@cs.rpi.edu> "David E. Cross" writes: : Spring break has descended upon me, and I find myself with less overwork, : enough so that I think I can finish up an alpha CardBus port in this next : week. What I need is some answers to a couple of questions. The first : is regarding resource allocation. Normally this is done for us by the : BIOS when it walks the PCI bus is my understanding. This is, : understandably, not possible with something dynamic like CardBus. Cool. there's another cardbus thing in Japan, but it has a lot of problems with it. If you could have something that works in that short a time frame, great! There's some pcibios routines that will do the resource allocation for you at the bridge level. These are what you want to learn. Netbsd has a bunch of routines to do this, and I seem to recall seeing them in FreeBSD. : What I have is a card is inserted into socket 0, it asks for 4k of memory : space, and 16 bytes of IO space. I need to allocate this space out of the : pool available to its parent controller (also, in some cases I need to : allocate it to the parent controller in the first place). How do I do this? I'm not sure I understand what you are asking. If you are asking what do you do about the newbus way to do this, I can help. : What about IRQ binding? Just pick one. Make it shared if you like. The pcibios things will help you here. The newbus stuff may need some help here... : As above mentioned, I sometimes need to configure the parent controller : itself... in these cases I also need to assign PCI bus numbers... how : do I do this? This is definitely a pcibios thing, iirc. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-new-bus" in the body of the message From owner-freebsd-new-bus Tue Mar 14 13:17:36 2000 Delivered-To: freebsd-new-bus@freebsd.org Received: from rover.village.org (rover.village.org [204.144.255.49]) by hub.freebsd.org (Postfix) with ESMTP id 1D88F37B772 for ; Tue, 14 Mar 2000 13:17:32 -0800 (PST) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.9.3/8.9.3) with ESMTP id OAA91351; Tue, 14 Mar 2000 14:17:27 -0700 (MST) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.9.3/8.8.3) with ESMTP id OAA46390; Tue, 14 Mar 2000 14:17:21 -0700 (MST) Message-Id: <200003142117.OAA46390@harmony.village.org> To: "David E. Cross" Subject: Re: Spring Break and CardBus Cc: freebsd-new-bus@FreeBSD.ORG In-reply-to: Your message of "Tue, 14 Mar 2000 15:52:44 EST." <200003142052.PAA15847@cs.rpi.edu> References: <200003142052.PAA15847@cs.rpi.edu> Date: Tue, 14 Mar 2000 14:17:21 -0700 From: Warner Losh Sender: owner-freebsd-new-bus@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message <200003142052.PAA15847@cs.rpi.edu> "David E. Cross" writes: : What I have is a card is inserted into socket 0, it asks for 4k of memory : space, and 16 bytes of IO space. I need to allocate this space out of the : pool available to its parent controller (also, in some cases I need to : allocate it to the parent controller in the first place). How do I do this? : What about IRQ binding? Thought you sent this to me personally, but looks like it went to the new-bus list.. The theory here is that you would create your own resource manager like the nexus does with its resources and then assign stuff out of that pool. Given how cardbus and pccard works, you don't necessarily need to allocate the pool at the pccard/cardbus bridge level. Instead, you can just pass the requests up and down through the bridge and then progrma the bridge to respond to the ranges that the upper layers assign. Finally, I'm curious, what code base are you targeting with this? NEWCARD or something else? I'd love to take a look at this code. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-new-bus" in the body of the message From owner-freebsd-new-bus Tue Mar 14 13:36:27 2000 Delivered-To: freebsd-new-bus@freebsd.org Received: from cs.rpi.edu (mumble.cs.rpi.edu [128.213.8.16]) by hub.freebsd.org (Postfix) with ESMTP id C5D0337B6EB for ; Tue, 14 Mar 2000 13:36:24 -0800 (PST) (envelope-from crossd@cs.rpi.edu) Received: from cs.rpi.edu (monica.cs.rpi.edu [128.213.7.2]) by cs.rpi.edu (8.9.3/8.9.3) with ESMTP id QAA17058; Tue, 14 Mar 2000 16:36:19 -0500 (EST) Message-Id: <200003142136.QAA17058@cs.rpi.edu> To: Warner Losh Cc: "David E. Cross" , freebsd-new-bus@FreeBSD.ORG, crossd@cs.rpi.edu Subject: Re: Spring Break and CardBus In-Reply-To: Message from Warner Losh of "Tue, 14 Mar 2000 14:17:21 MST." <200003142117.OAA46390@harmony.village.org> Date: Tue, 14 Mar 2000 16:36:19 -0500 From: "David E. Cross" Sender: owner-freebsd-new-bus@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG The code base (so far) is almost entirely original. I have looked at the newconfig and netbsd CardBus drivers to gain some insights on how to handle certain things. At this point almost everything is hardcoded for my specific setup (an IBM ThinkPad 600e). I am trying to work away from that now. I also want to import as much code as I can from the other efforts as I hope that will increase portability (I can only work on the TI1251A), as well as minimize bugs. I am hoping to have a large quantity of time this evening to work on this... lets see how far I get. You mentioned the resource manager... and I agree this is "the right way" to do things, however this would necessitate making some substantial changes to the PCI bus code... since things are already passed up and down the bus with 'bus_alloc_resource()' the impact should be minimal.. I just wanted to make sure that this wasn't already done for me. Although on an aside, a given PCI device may not be attached when other devices are probed/attached, so I would need to actively peek into the configuration space of other devices and reserve their spaces before they actually call 'bus_alloc_resource()' does this sound reasonable? What should be the name for the functions to request space that has not been allocated yet? bus_reserve_resource()? -- David Cross | email: crossd@cs.rpi.edu Acting Lab Director | NYSLP: FREEBSD Systems Administrator/Research Programmer | Web: http://www.cs.rpi.edu/~crossd Rensselaer Polytechnic Institute, | Ph: 518.276.2860 Department of Computer Science | Fax: 518.276.4033 I speak only for myself. | WinNT:Linux::Linux:FreeBSD To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-new-bus" in the body of the message From owner-freebsd-new-bus Tue Mar 14 13:43:45 2000 Delivered-To: freebsd-new-bus@freebsd.org Received: from rover.village.org (rover.village.org [204.144.255.49]) by hub.freebsd.org (Postfix) with ESMTP id 0E80C37B73A for ; Tue, 14 Mar 2000 13:43:41 -0800 (PST) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.9.3/8.9.3) with ESMTP id OAA91585; Tue, 14 Mar 2000 14:43:39 -0700 (MST) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.9.3/8.8.3) with ESMTP id OAA46750; Tue, 14 Mar 2000 14:43:33 -0700 (MST) Message-Id: <200003142143.OAA46750@harmony.village.org> To: "David E. Cross" Subject: Re: Spring Break and CardBus Cc: freebsd-new-bus@FreeBSD.ORG In-reply-to: Your message of "Tue, 14 Mar 2000 16:36:19 EST." <200003142136.QAA17058@cs.rpi.edu> References: <200003142136.QAA17058@cs.rpi.edu> Date: Tue, 14 Mar 2000 14:43:33 -0700 From: Warner Losh Sender: owner-freebsd-new-bus@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message <200003142136.QAA17058@cs.rpi.edu> "David E. Cross" writes: : The code base (so far) is almost entirely original. I have looked at : the newconfig and netbsd CardBus drivers to gain some insights on how : to handle certain things. At this point almost everything is hardcoded for : my specific setup (an IBM ThinkPad 600e). I am trying to work away from : that now. I also want to import as much code as I can from the other efforts : as I hope that will increase portability (I can only work on the TI1251A), : as well as minimize bugs. Cool. I'd love to help in whatever ways that I can. : I am hoping to have a large quantity of time this evening to work on this... : lets see how far I get. When you are ready to make a code dump, lemme know. I'll be glad to take a look, add support for my cardbus devices and offer guidance. : You mentioned the resource manager... and I agree this is "the right way" to : do things, however this would necessitate making some substantial changes to : the PCI bus code... since things are already passed up and down the bus : with 'bus_alloc_resource()' the impact should be minimal.. I just wanted : to make sure that this wasn't already done for me. : Although on an aside, : a given PCI device may not be attached when other devices are : probed/attached, so I would need to actively peek into the configuration : space of other devices and reserve their spaces before they actually : call 'bus_alloc_resource()' does this sound reasonable? What should be : the name for the functions to request space that has not been allocated yet? : bus_reserve_resource()? That's why I was talking about the pcibios routines. They do things like this for you. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-new-bus" in the body of the message From owner-freebsd-new-bus Wed Mar 15 14:55:29 2000 Delivered-To: freebsd-new-bus@freebsd.org Received: from bluebottle.calcaphon.com (calcaphon.demon.co.uk [193.237.19.5]) by hub.freebsd.org (Postfix) with ESMTP id 13A4037C0B0 for ; Wed, 15 Mar 2000 14:55:20 -0800 (PST) (envelope-from n_hibma@calcaphon.com) Received: from henny.calcaphon.com (henny.calcaphon.com [10.0.0.36]) by bluebottle.calcaphon.com (8.9.3/8.9.1) with ESMTP id WAA63930 for ; Wed, 15 Mar 2000 22:57:33 GMT (envelope-from n_hibma@calcaphon.com) Date: Wed, 15 Mar 2000 22:53:08 +0000 (GMT) From: Nick Hibma X-Sender: n_hibma@localhost Reply-To: Nick Hibma To: FreeBSD Newbus Mailing List Subject: Patch for review Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-659987233-953160788=:571" Sender: owner-freebsd-new-bus@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --0-659987233-953160788=:571 Content-Type: TEXT/PLAIN; charset=US-ASCII The attached patch removes the use of nextunit and replaces it with a linear search for the first element available. This avoids the unit number from ever increasing and memory being wasted if you unplug & plug two devices alternatingly. It also flags that we have called DEVICE_NOMATCH and should not call it again during a reprobe. Let me know if this is anything you would not like to see implemented. Nick -- n_hibma@webweaving.org n_hibma@freebsd.org USB project http://www.etla.net/~n_hibma/ --0-659987233-953160788=:571 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="subr_bus.diff" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="subr_bus.diff" SW5kZXg6IGtlcm4vc3Vicl9idXMuYw0KPT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PQ0KUkNTIGZpbGU6IC9ob21lL25jdnMvc3JjL3N5cy9rZXJuL3N1YnJfYnVz LmMsdg0KcmV0cmlldmluZyByZXZpc2lvbiAxLjU0DQpkaWZmIC11IC1yMS41 NCBzdWJyX2J1cy5jDQotLS0ga2Vybi9zdWJyX2J1cy5jCTIwMDAvMDIvMjkg MDk6MzY6MjUJMS41NA0KKysrIGtlcm4vc3Vicl9idXMuYwkyMDAwLzAzLzE1 IDIyOjQ5OjQ3DQpAQCAtMjY3LDcgKzI2Nyw2IEBADQogCXN0cmNweShkYy0+ bmFtZSwgY2xhc3NuYW1lKTsNCiAJZGMtPmRldmljZXMgPSBOVUxMOw0KIAlk Yy0+bWF4dW5pdCA9IDA7DQotCWRjLT5uZXh0dW5pdCA9IDA7DQogCVRBSUxR X0lOSVQoJmRjLT5kcml2ZXJzKTsNCiAJVEFJTFFfSU5TRVJUX1RBSUwoJmRl dmNsYXNzZXMsIGRjLCBsaW5rKTsNCiAgICAgfQ0KQEAgLTQ4NywyMSArNDg2 LDI4IEBADQogICAgICAqIGRldmljZS4NCiAgICAgICovDQogICAgIGlmICh1 bml0ICE9IC0xKSB7DQotCWRldmljZV90IGRldjsNCi0JZGV2ID0gZGV2Y2xh c3NfZ2V0X2RldmljZShkYywgdW5pdCk7DQotCWlmIChkZXYpIHsNCisJaWYg KHVuaXQgPj0gMCAmJiB1bml0IDwgZGMtPm1heHVuaXQgJiYgZGMtPmRldmlj ZXNbdW5pdF0gIT0g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Pm5h bWUsIGRjLT5tYXh1bml0KSk7DQogfQ0KIA0KIHN0YXRpYyB2b2lkDQpJbmRl eDogc3lzL2J1c19wcml2YXRlLmgNCj09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0N ClJDUyBmaWxlOiAvaG9tZS9uY3ZzL3NyYy9zeXMvc3lzL2J1c19wcml2YXRl Lmgsdg0KcmV0cmlldmluZyByZXZpc2lvbiAxLjExDQpkaWZmIC11IC1yMS4x MSBidXNfcHJpdmF0ZS5oDQotLS0gc3lzL2J1c19wcml2YXRlLmgJMTk5OS8w OS8wNyAwODo0Mjo0OQkxLjExDQorKysgc3lzL2J1c19wcml2YXRlLmgJMjAw MC8wMi8xMSAxMzowNzo0MQ0KQEAgLTUzLDcgKzUzLDYgQEANCiAgICAgY2hh cgkJKm5hbWU7DQogICAgIGRldmljZV90CQkqZGV2aWNlczsgLyogYXJyYXkg b2YgZGV2aWNlcyBpbmRleGVkIGJ5IHVuaXQgKi8NCiAgICAgaW50CQkJbWF4 dW5pdDsgLyogc2l6ZSBvZiBkZXZpY2VzIGFycmF5ICovDQotICAgIGludAkJ CW5leHR1bml0OyAvKiBuZXh0IHVudXNlZCB1bml0IG51bWJlciAqLw0KIH07 DQogDQogLyoNCkBAIC0xMzQsNiArMTMzLDcgQEANCiAjZGVmaW5lIERGX1dJ TERDQVJECTQJLyogdW5pdCB3YXMgb3JpZ2luYWxseSB3aWxkY2FyZCAqLw0K ICNkZWZpbmUgREZfREVTQ01BTExPQ0VECTgJLyogZGVzY3JpcHRpb24gd2Fz IG1hbGxvY2VkICovDQogI2RlZmluZSBERl9RVUlFVAkxNgkvKiBkb24ndCBw cmludCB2ZXJib3NlIGF0dGFjaCBtZXNzYWdlICovDQorI2RlZmluZSBERl9E T05FTk9NQVRDSAkzMgkvKiBkb24ndCBleGVjdXRlIERFVklDRV9OT01BVENI IGFnYWluICovDQogICAgIHVfY2hhcgkJb3JkZXI7CS8qIG9yZGVyIGZyb20g ZGV2aWNlX2FkZF9jaGlsZF9vcmRlcmVkKCkgKi8NCiAgICAgdV9jaGFyCQlw YWQ7DQogI2lmZGVmIERFVklDRV9TWVNDVExTDQo= --0-659987233-953160788=:571-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-new-bus" in the body of the message From owner-freebsd-new-bus Thu Mar 16 1: 3:30 2000 Delivered-To: freebsd-new-bus@freebsd.org Received: from anchor-post-34.mail.demon.net (anchor-post-34.mail.demon.net [194.217.242.92]) by hub.freebsd.org (Postfix) with ESMTP id B758737B794 for ; Thu, 16 Mar 2000 01:03:24 -0800 (PST) (envelope-from dfr@nlsystems.com) Received: from nlsys.demon.co.uk ([158.152.125.33] helo=herring.nlsystems.com) by anchor-post-34.mail.demon.net with esmtp (Exim 2.12 #1) id 12VWBb-000Ajn-0Y; Thu, 16 Mar 2000 09:03:19 +0000 Received: from salmon.nlsystems.com (salmon.nlsystems.com [10.0.0.3]) by herring.nlsystems.com (8.9.3/8.8.8) with ESMTP id JAA35449; Thu, 16 Mar 2000 09:02:14 GMT (envelope-from dfr@nlsystems.com) Date: Thu, 16 Mar 2000 09:08:48 +0000 (GMT) From: Doug Rabson To: Nick Hibma Cc: FreeBSD Newbus Mailing List Subject: Re: Patch for review In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-new-bus@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, 15 Mar 2000, Nick Hibma wrote: > > The attached patch removes the use of nextunit and replaces it with a > linear search for the first element available. > > This avoids the unit number from ever increasing and memory being wasted > if you unplug & plug two devices alternatingly. Good. > > It also flags that we have called DEVICE_NOMATCH and should not call it > again during a reprobe. > > Let me know if this is anything you would not like to see implemented. I was working around this by putting "if (!cold) return" in pci_nomatch but this is cleaner. -- Doug Rabson Mail: dfr@nlsystems.com Nonlinear Systems Ltd. Phone: +44 181 442 9037 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-new-bus" in the body of the message From owner-freebsd-new-bus Sat Mar 18 23:53:10 2000 Delivered-To: freebsd-new-bus@freebsd.org Received: from cs.rpi.edu (mumble.cs.rpi.edu [128.213.8.16]) by hub.freebsd.org (Postfix) with ESMTP id ED1A237B5E4 for ; Sat, 18 Mar 2000 23:53:07 -0800 (PST) (envelope-from crossd@cs.rpi.edu) Received: from cs.rpi.edu (monica.cs.rpi.edu [128.213.7.2]) by cs.rpi.edu (8.9.3/8.9.3) with ESMTP id CAA56296; Sun, 19 Mar 2000 02:53:06 -0500 (EST) Message-Id: <200003190753.CAA56296@cs.rpi.edu> To: freebsd-new-bus@freebsd.org Cc: crossd@cs.rpi.edu Subject: when is dinfo instantiated? Date: Sun, 19 Mar 2000 02:53:05 -0500 From: "David E. Cross" Sender: owner-freebsd-new-bus@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I am writing resource reservation and allocation code for PCI buses. What I am currently doing is hooking into pci_attach() in sys/pci/pci.c (new function by my creation). It gets the softc for this instance of the pci bus (again, my modification). In this softc it stores a resource list of all of the resources that are allocated to the bridge. This currently is membase, memlimit, iobase, iolimit, secondary bus, and subordinate bus. Then as each child on the bus is probed its resource allocations are marked 'in use' in the parent's softc, any children with invalid, or unallocated resources may then be filled in dynamically. The problem that I am having is that 'device_get_ivars(dev);' in the 'pci_attach()' function is returning NULL. Going through the code it appears that pci_new_probe() should take care of this. That is, the parent of the current bus (and all buses have parents, right?) should set that structure correctly? Apparently not. What am I missing? -- David Cross | email: crossd@cs.rpi.edu Acting Lab Director | NYSLP: FREEBSD Systems Administrator/Research Programmer | Web: http://www.cs.rpi.edu/~crossd Rensselaer Polytechnic Institute, | Ph: 518.276.2860 Department of Computer Science | Fax: 518.276.4033 I speak only for myself. | WinNT:Linux::Linux:FreeBSD To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-new-bus" in the body of the message