* [PATCH] Make it possible to compile in the Bluetooth subsystem
@ 2002-10-07 20:46 Marcel Holtmann
2002-10-07 20:49 ` Linus Torvalds
2002-10-07 22:40 ` Maksim (Max) Krasnyanskiy
0 siblings, 2 replies; 7+ messages in thread
From: Marcel Holtmann @ 2002-10-07 20:46 UTC (permalink / raw)
To: torvalds; +Cc: linux-kernel, maxk, marcel
You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.
===================================================================
ChangeSet@1.709, 2002-10-07 22:08:56+02:00, marcel@holtmann.org
Make it possible to compile in the Bluetooth subsystem
af_bluetooth.c | 8 +++-----
rfcomm/tty.c | 8 +-------
2 files changed, 4 insertions(+), 12 deletions(-)
diff -Nru a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c
--- a/net/bluetooth/af_bluetooth.c Mon Oct 7 22:16:14 2002
+++ b/net/bluetooth/af_bluetooth.c Mon Oct 7 22:16:14 2002
@@ -320,7 +320,7 @@
PF_BLUETOOTH, bluez_sock_create
};
-static int __init bluez_init(void)
+int __init bluez_init(void)
{
BT_INFO("BlueZ Core ver %s Copyright (C) 2000,2001 Qualcomm Inc",
VERSION);
@@ -337,7 +337,7 @@
BT_ERR("BlueZ socket cache creation failed");
return -ENOMEM;
}
-
+
sock_register(&bluez_sock_family_ops);
hci_core_init();
@@ -345,7 +345,7 @@
return 0;
}
-static void __exit bluez_cleanup(void)
+void __exit bluez_cleanup(void)
{
hci_sock_cleanup();
hci_core_cleanup();
@@ -356,11 +356,9 @@
remove_proc_entry("bluetooth", NULL);
}
-#ifdef MODULE
module_init(bluez_init);
module_exit(bluez_cleanup);
MODULE_AUTHOR("Maxim Krasnyansky <maxk@qualcomm.com>");
MODULE_DESCRIPTION("BlueZ Core ver " VERSION);
MODULE_LICENSE("GPL");
-#endif
diff -Nru a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c
--- a/net/bluetooth/rfcomm/tty.c Mon Oct 7 22:16:14 2002
+++ b/net/bluetooth/rfcomm/tty.c Mon Oct 7 22:16:14 2002
@@ -501,12 +501,6 @@
#endif
}
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
-#define __minor MINOR
-#else
-#define __minor minor
-#endif
-
static int rfcomm_tty_open(struct tty_struct *tty, struct file *filp)
{
DECLARE_WAITQUEUE(wait, current);
@@ -514,7 +508,7 @@
struct rfcomm_dlc *dlc;
int err, id;
- id = __minor(tty->device) - tty->driver.minor_start;
+ id = minor(tty->device) - tty->driver.minor_start;
BT_DBG("tty %p id %d", tty, id);
===================================================================
This BitKeeper patch contains the following changesets:
+
## Wrapped with gzip_uu ##
begin 664 bkpatch19808
M'XL(`([KH3T``\U5;6O;,!#^'/V*@WYI*;9/KW8\4KJV8QO;6.GHMT%0;*4V
MB>U@*VD[_.,G.UO2CBS;2@>U#2?)IT>G>YZ3#N"Z,74\*'2=F#DY@'=58^-!
M5LUMH<O2K^H;-WA556XPR*K"!#]_!9/<SHQ9F#J8S)?FF\=\29SOI;9)!BM3
M-_&`^GPS8N\7)AY<O7E[_?'U%2&C$9QGNKPQ7XR%T8C8JE[I>=J<:IO-J]*W
MM2Z;PECM)U71;EQ;ALC<*VG(4:J6*A1AF]"44BVH29&)2(DMVL*4-\M\/QQ%
M#&G$&*I641PR<@'4#W$(R`**`8;`6(Q1+-4QN@;".EFG#Y,$QPP\)&?PO/LX
M)PE\TC,#N85%U33Y9&[<$N"P%KEKYB78S,"9(\`ZCC)HEI/FOK&F(!]`4>XV
M<[G-,_'^\2$$-9(36'0,[MY1:6S/?[]\H*?C3<=/MIN,N.2BI>&0LY:K%#6C
MB@Y1:3.<[$KGGV$[TAB5',-62,6%B[+0=[/35>X4Z1^656F.?D&IIR[@(K#V
M?HLA$;D0K'4<R*B-PA13)JD14ZV5G/Y%:+M`76!"2=Y*B:'LI?[[.9WVGS]P
M\L3`43"DK@RXB(9]&8@'1<!CH6+)]Q4!!2]\646PYN`S>/5M_SE17^ZAXPDE
M<B%1@'*&AD#)^[6!'T^>P@B*O*SJ0X?OG:1FE2?F"#Q8=^O<G91^[S!NK*[M
MJQUZ>2S_3C'_M2!)[;SWZ7%W.0H'RKEJ'6<8]N)1C\0C>8SA/O%P\.3+$L_Z
M9-DKGL>Y>(I\...=;M8F+RV,QWGIHNUOU;YYN*KR],AY"NP]>_.UZT?K?F<Z
M'S?5W&VF)G.CR^5B,UL.G=L%5\J9S;6<9":9-<MBQ"91)(64Y#L%=!MS$P@`
!````
`
end
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] Make it possible to compile in the Bluetooth subsystem
2002-10-07 20:46 [PATCH] Make it possible to compile in the Bluetooth subsystem Marcel Holtmann
@ 2002-10-07 20:49 ` Linus Torvalds
2002-10-07 20:51 ` Linus Torvalds
2002-10-07 21:24 ` Marcel Holtmann
2002-10-07 22:40 ` Maksim (Max) Krasnyanskiy
1 sibling, 2 replies; 7+ messages in thread
From: Linus Torvalds @ 2002-10-07 20:49 UTC (permalink / raw)
To: Marcel Holtmann; +Cc: linux-kernel, maxk
On Mon, 7 Oct 2002, Marcel Holtmann wrote:
>
> ChangeSet@1.709, 2002-10-07 22:08:56+02:00, marcel@holtmann.org
> Make it possible to compile in the Bluetooth subsystem
Looks good, but you should _not_ remove the "static". Please keep the init
functions static, they will be explicitly exported to the stuff that cares
(and nobody else) by the "module_init()" thing anyway.
Linus
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Make it possible to compile in the Bluetooth subsystem
2002-10-07 20:49 ` Linus Torvalds
@ 2002-10-07 20:51 ` Linus Torvalds
2002-10-07 21:24 ` Marcel Holtmann
1 sibling, 0 replies; 7+ messages in thread
From: Linus Torvalds @ 2002-10-07 20:51 UTC (permalink / raw)
To: Marcel Holtmann; +Cc: linux-kernel, maxk
On Mon, 7 Oct 2002, Linus Torvalds wrote:
>
> Looks good, but you should _not_ remove the "static". Please keep the init
> functions static, they will be explicitly exported to the stuff that cares
> (and nobody else) by the "module_init()" thing anyway.
In other words, I think the patch should be just this instead..
Linus
diff -Nru a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c
--- a/net/bluetooth/af_bluetooth.c Mon Oct 7 22:16:14 2002
+++ b/net/bluetooth/af_bluetooth.c Mon Oct 7 22:16:14 2002
@@ -356,11 +356,9 @@
remove_proc_entry("bluetooth", NULL);
}
-#ifdef MODULE
module_init(bluez_init);
module_exit(bluez_cleanup);
MODULE_AUTHOR("Maxim Krasnyansky <maxk@qualcomm.com>");
MODULE_DESCRIPTION("BlueZ Core ver " VERSION);
MODULE_LICENSE("GPL");
-#endif
diff -Nru a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c
--- a/net/bluetooth/rfcomm/tty.c Mon Oct 7 22:16:14 2002
+++ b/net/bluetooth/rfcomm/tty.c Mon Oct 7 22:16:14 2002
@@ -501,12 +501,6 @@
#endif
}
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
-#define __minor MINOR
-#else
-#define __minor minor
-#endif
-
static int rfcomm_tty_open(struct tty_struct *tty, struct file *filp)
{
DECLARE_WAITQUEUE(wait, current);
@@ -514,7 +508,7 @@
struct rfcomm_dlc *dlc;
int err, id;
- id = __minor(tty->device) - tty->driver.minor_start;
+ id = minor(tty->device) - tty->driver.minor_start;
BT_DBG("tty %p id %d", tty, id);
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] Make it possible to compile in the Bluetooth subsystem
2002-10-07 20:49 ` Linus Torvalds
2002-10-07 20:51 ` Linus Torvalds
@ 2002-10-07 21:24 ` Marcel Holtmann
2002-10-07 21:28 ` Linus Torvalds
1 sibling, 1 reply; 7+ messages in thread
From: Marcel Holtmann @ 2002-10-07 21:24 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Linux Kernel Mailing List, Maksim Krasnyanskiy
On Mon, 2002-10-07 at 22:49, Linus Torvalds wrote:
>
> On Mon, 7 Oct 2002, Marcel Holtmann wrote:
> >
> > ChangeSet@1.709, 2002-10-07 22:08:56+02:00, marcel@holtmann.org
> > Make it possible to compile in the Bluetooth subsystem
>
> Looks good, but you should _not_ remove the "static". Please keep the init
> functions static, they will be explicitly exported to the stuff that cares
> (and nobody else) by the "module_init()" thing anyway.
but when I try to compile in the Bluetooth subsystem I got the following
error:
net/built-in.o: In function `sock_init':
net/built-in.o(.text.init+0x5b): undefined reference to `bluez_init'
make: *** [.tmp_vmlinux1] Error 1
It seems like that I have missed some magic to understand, because
"wanrouter_init" is also not declared static. But for netfilter or
netlink init it seems to work this way. Can you please give me some
infos how to fix this the right way.
Regards
Marcel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Make it possible to compile in the Bluetooth subsystem
2002-10-07 21:24 ` Marcel Holtmann
@ 2002-10-07 21:28 ` Linus Torvalds
2002-10-07 22:38 ` Marcel Holtmann
0 siblings, 1 reply; 7+ messages in thread
From: Linus Torvalds @ 2002-10-07 21:28 UTC (permalink / raw)
To: Marcel Holtmann; +Cc: Linux Kernel Mailing List, Maksim Krasnyanskiy
On 7 Oct 2002, Marcel Holtmann wrote:
>
> but when I try to compile in the Bluetooth subsystem I got the following
> error:
>
> net/built-in.o: In function `sock_init':
> net/built-in.o(.text.init+0x5b): undefined reference to `bluez_init'
> make: *** [.tmp_vmlinux1] Error 1
This is a separate error, apparently because net/socket.c calls
"blues_init()" if bluetooth is configured in.
That shouldn't be needed at all, since the "init_module()" thing should
take care of it. Please try just removing the bluez_init references from
net/socket.c - that should fix the compile, and if all the ordering issues
are ok, it should also work afterwards..
Linus
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Make it possible to compile in the Bluetooth subsystem
2002-10-07 21:28 ` Linus Torvalds
@ 2002-10-07 22:38 ` Marcel Holtmann
0 siblings, 0 replies; 7+ messages in thread
From: Marcel Holtmann @ 2002-10-07 22:38 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Linux Kernel Mailing List, Maksim Krasnyanskiy
On Mon, 2002-10-07 at 23:28, Linus Torvalds wrote:
>
> On 7 Oct 2002, Marcel Holtmann wrote:
> >
> > but when I try to compile in the Bluetooth subsystem I got the following
> > error:
> >
> > net/built-in.o: In function `sock_init':
> > net/built-in.o(.text.init+0x5b): undefined reference to `bluez_init'
> > make: *** [.tmp_vmlinux1] Error 1
>
> This is a separate error, apparently because net/socket.c calls
> "blues_init()" if bluetooth is configured in.
>
> That shouldn't be needed at all, since the "init_module()" thing should
> take care of it. Please try just removing the bluez_init references from
> net/socket.c - that should fix the compile, and if all the ordering issues
> are ok, it should also work afterwards..
I started a clean build kernel without this code and it works. Thanks
for the info and a new patch follows.
Regards
Marcel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Make it possible to compile in the Bluetooth subsystem
2002-10-07 20:46 [PATCH] Make it possible to compile in the Bluetooth subsystem Marcel Holtmann
2002-10-07 20:49 ` Linus Torvalds
@ 2002-10-07 22:40 ` Maksim (Max) Krasnyanskiy
1 sibling, 0 replies; 7+ messages in thread
From: Maksim (Max) Krasnyanskiy @ 2002-10-07 22:40 UTC (permalink / raw)
To: Marcel Holtmann, torvalds; +Cc: linux-kernel, marcel
Marcel,
>@@ -345,7 +345,7 @@
> return 0;
> }
>
>-static void __exit bluez_cleanup(void)
>+void __exit bluez_cleanup(void)
> {
> hci_sock_cleanup();
> hci_core_cleanup();
>@@ -356,11 +356,9 @@
> remove_proc_entry("bluetooth", NULL);
> }
>
>-#ifdef MODULE
> module_init(bluez_init);
> module_exit(bluez_cleanup);
>
> MODULE_AUTHOR("Maxim Krasnyansky <maxk@qualcomm.com>");
> MODULE_DESCRIPTION("BlueZ Core ver " VERSION);
> MODULE_LICENSE("GPL");
>-#endif
This is wrong. If Bluetooth is compiled in, bluez_init() is called from
linux/net/socket.c. We have to change that to subsys_initcall.
Linus, please don't apply. We'll send correct patch later.
Thanks
Max
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2002-10-07 22:36 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-07 20:46 [PATCH] Make it possible to compile in the Bluetooth subsystem Marcel Holtmann
2002-10-07 20:49 ` Linus Torvalds
2002-10-07 20:51 ` Linus Torvalds
2002-10-07 21:24 ` Marcel Holtmann
2002-10-07 21:28 ` Linus Torvalds
2002-10-07 22:38 ` Marcel Holtmann
2002-10-07 22:40 ` Maksim (Max) Krasnyanskiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox