Linux bluetooth development
 help / color / mirror / Atom feed
* Re: magicmouse: claimed by neither input, hiddev nor hidraw
From: Justin P. Mattock @ 2010-05-11  8:01 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: Michael Poole, linux-bluetooth, Linux Kernel Mailing List
In-Reply-To: <alpine.LNX.2.00.1005110946520.28092@pobox.suse.cz>

here is dmesg with the:
[   27.435674] magicmouse 0005:05AC:030D.0004: claimed by neither input, 
hiddev nor hidraw
[   27.435686] magicmouse 0005:05AC:030D.0004: magicmouse hw start failed




[    0.000000] Linux version 2.6.33-00095-g28918c2 (name@name) (gcc 
version 4.4.2 (GCC) ) #19 SMP Tue May 11 00:49:25 PDT 2010
[    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz root=/dev/sda3 ro 
debug audit=1 selinux=1 vga=790 enforcing=0
[    0.000000] BIOS-provided physical RAM map:
[    0.000000]  BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)
[    0.000000]  BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
[    0.000000]  BIOS-e820: 00000000000e0000 - 0000000000100000 (reserved)
[    0.000000]  BIOS-e820: 0000000000100000 - 000000003f0ea000 (usable)
[    0.000000]  BIOS-e820: 000000003f0ea000 - 000000003f2eb000 (ACPI NVS)
[    0.000000]  BIOS-e820: 000000003f2eb000 - 000000003febe000 (ACPI data)
[    0.000000]  BIOS-e820: 000000003febe000 - 000000003feef000 (ACPI NVS)
[    0.000000]  BIOS-e820: 000000003feef000 - 000000003ff00000 (ACPI data)
[    0.000000]  BIOS-e820: 000000003ff00000 - 0000000040000000 (reserved)
[    0.000000]  BIOS-e820: 00000000f0000000 - 00000000f4000000 (reserved)
[    0.000000]  BIOS-e820: 00000000fec00000 - 00000000fec01000 (reserved)
[    0.000000]  BIOS-e820: 00000000fed14000 - 00000000fed1a000 (reserved)
[    0.000000]  BIOS-e820: 00000000fed1c000 - 00000000fed20000 (reserved)
[    0.000000]  BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved)
[    0.000000]  BIOS-e820: 00000000ffe00000 - 0000000100000000 (reserved)
[    0.000000] NX (Execute Disable) protection: active
[    0.000000] DMI 2.4 present.
[    0.000000] No AGP bridge found
[    0.000000] last_pfn = 0x3f0ea max_arch_pfn = 0x400000000
[    0.000000] MTRR default type: uncachable
[    0.000000] MTRR fixed ranges enabled:
[    0.000000]   00000-9FFFF write-back
[    0.000000]   A0000-BFFFF uncachable
[    0.000000]   C0000-CFFFF write-protect
[    0.000000]   D0000-DFFFF uncachable
[    0.000000]   E0000-FFFFF write-protect
[    0.000000] MTRR variable ranges enabled:
[    0.000000]   0 base 0FFE00000 mask FFFE00000 write-protect
[    0.000000]   1 base 000000000 mask FC0000000 write-back
[    0.000000]   2 base 03FF00000 mask FFFF00000 uncachable
[    0.000000]   3 disabled
[    0.000000]   4 disabled
[    0.000000]   5 disabled
[    0.000000]   6 disabled
[    0.000000]   7 disabled
[    0.000000] x86 PAT enabled: cpu 0, old 0x7040600070406, new 
0x7010600070106
[    0.000000] initial memory mapped : 0 - 20000000
[    0.000000] init_memory_mapping: 0000000000000000-000000003f0ea000
[    0.000000]  0000000000 - 003f000000 page 2M
[    0.000000]  003f000000 - 003f0ea000 page 4k
[    0.000000] kernel direct mapping tables up to 3f0ea000 @ 8000-b000
[    0.000000] ACPI: RSDP 00000000000fe020 00024 (v02 APPLE )
[    0.000000] ACPI: XSDT 000000003fefd1c0 00074 (v01 APPLE   Apple00 
000000A5      01000013)
[    0.000000] ACPI: FACP 000000003fefb000 000F4 (v03 APPLE   Apple00 
000000A5 Loki 0000005F)
[    0.000000] ACPI: DSDT 000000003fef0000 048D1 (v01 APPLE  MacBookP 
00020002 INTL 20050309)
[    0.000000] ACPI: FACS 000000003fec0000 00040
[    0.000000] ACPI: HPET 000000003fefa000 00038 (v01 APPLE   Apple00 
00000001 Loki 0000005F)
[    0.000000] ACPI: APIC 000000003fef9000 00068 (v01 APPLE   Apple00 
00000001 Loki 0000005F)
[    0.000000] ACPI: MCFG 000000003fef8000 0003C (v01 APPLE   Apple00 
00000001 Loki 0000005F)
[    0.000000] ACPI: ASF! 000000003fef7000 000A0 (v32 APPLE   Apple00 
00000001 Loki 0000005F)
[    0.000000] ACPI: SBST 000000003fef6000 00030 (v01 APPLE   Apple00 
00000001 Loki 0000005F)
[    0.000000] ACPI: ECDT 000000003fef5000 00053 (v01 APPLE   Apple00 
00000001 Loki 0000005F)
[    0.000000] ACPI: SSDT 000000003feef000 004DC (v01 APPLE     CpuPm 
00003000 INTL 20050309)
[    0.000000] ACPI: SSDT 000000003febd000 0064F (v01 SataRe  SataPri 
00001000 INTL 20050309)
[    0.000000] ACPI: SSDT 000000003febc000 0069C (v01 SataRe  SataSec 
00001000 INTL 20050309)
[    0.000000] ACPI: Local APIC address 0xfee00000
[    0.000000] (7 early reservations) ==> bootmem [0000000000 - 003f0ea000]
[    0.000000]   #0 [0000000000 - 0000001000]   BIOS data page ==> 
[0000000000 - 0000001000]
[    0.000000]   #1 [0001000000 - 00017a36c8]    TEXT DATA BSS ==> 
[0001000000 - 00017a36c8]
[    0.000000]   #2 [000009fc00 - 0000100000]    BIOS reserved ==> 
[000009fc00 - 0000100000]
[    0.000000]   #3 [00017a4000 - 00017a4271]              BRK ==> 
[00017a4000 - 00017a4271]
[    0.000000]   #4 [0000001000 - 0000003000]       TRAMPOLINE ==> 
[0000001000 - 0000003000]
[    0.000000]   #5 [0000003000 - 0000007000]      ACPI WAKEUP ==> 
[0000003000 - 0000007000]
[    0.000000]   #6 [0000008000 - 0000009000]          PGTABLE ==> 
[0000008000 - 0000009000]
[    0.000000]  [ffffea0000000000-ffffea0000dfffff] PMD -> 
[ffff880001c00000-ffff8800029fffff] on node 0
[    0.000000] Zone PFN ranges:
[    0.000000]   DMA      0x00000000 -> 0x00001000
[    0.000000]   DMA32    0x00001000 -> 0x00100000
[    0.000000]   Normal   0x00100000 -> 0x00100000
[    0.000000] Movable zone start PFN for each node
[    0.000000] early_node_map[2] active PFN ranges
[    0.000000]     0: 0x00000000 -> 0x0000009f
[    0.000000]     0: 0x00000100 -> 0x0003f0ea
[    0.000000] On node 0 totalpages: 258185
[    0.000000]   DMA zone: 56 pages used for memmap
[    0.000000]   DMA zone: 104 pages reserved
[    0.000000]   DMA zone: 3839 pages, LIFO batch:0
[    0.000000]   DMA32 zone: 3476 pages used for memmap
[    0.000000]   DMA32 zone: 250710 pages, LIFO batch:31
[    0.000000] ACPI: PM-Timer IO Port: 0x408
[    0.000000] ACPI: Local APIC address 0xfee00000
[    0.000000] ACPI: LAPIC (acpi_id[0x00] lapic_id[0x00] enabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x01] lapic_id[0x01] enabled)
[    0.000000] ACPI: LAPIC_NMI (acpi_id[0x00] high edge lint[0x1])
[    0.000000] ACPI: LAPIC_NMI (acpi_id[0x01] high edge lint[0x1])
[    0.000000] ACPI: IOAPIC (id[0x01] address[0xfec00000] gsi_base[0])
[    0.000000] IOAPIC[0]: apic_id 1, version 32, address 0xfec00000, GSI 
0-23
[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
[    0.000000] ACPI: IRQ0 used by override.
[    0.000000] ACPI: IRQ2 used by override.
[    0.000000] ACPI: IRQ9 used by override.
[    0.000000] Using ACPI (MADT) for SMP configuration information
[    0.000000] ACPI: HPET id: 0x8086a201 base: 0xfed00000
[    0.000000] SMP: Allowing 2 CPUs, 0 hotplug CPUs
[    0.000000] nr_irqs_gsi: 24
[    0.000000] PM: Registered nosave memory: 000000000009f000 - 
00000000000a0000
[    0.000000] PM: Registered nosave memory: 00000000000a0000 - 
00000000000e0000
[    0.000000] PM: Registered nosave memory: 00000000000e0000 - 
0000000000100000
[    0.000000] Allocating PCI resources starting at 40000000 (gap: 
40000000:b0000000)
[    0.000000] Booting paravirtualized kernel on bare hardware
[    0.000000] setup_percpu: NR_CPUS:2 nr_cpumask_bits:2 nr_cpu_ids:2 
nr_node_ids:1
[    0.000000] PERCPU: Embedded 30 pages/cpu @ffff880001800000 s91096 
r8192 d23592 u1048576
[    0.000000] pcpu-alloc: s91096 r8192 d23592 u1048576 alloc=1*2097152
[    0.000000] pcpu-alloc: [0] 0 1
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on. 
Total pages: 254549
[    0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz 
root=/dev/sda3 ro debug audit=1 selinux=1 vga=790 enforcing=0
[    0.000000] audit: enabled (after initialization)
[    0.000000] PID hash table entries: 4096 (order: 3, 32768 bytes)
[    0.000000] Dentry cache hash table entries: 131072 (order: 8, 
1048576 bytes)
[    0.000000] Inode-cache hash table entries: 65536 (order: 7, 524288 
bytes)
[    0.000000] Checking aperture...
[    0.000000] No AGP bridge found
[    0.000000] Memory: 1007964k/1033128k available (3997k kernel code, 
388k absent, 24084k reserved, 2503k data, 504k init)
[    0.000000] SLUB: Genslabs=13, HWalign=64, Order=0-3, MinObjects=0, 
CPUs=2, Nodes=1
[    0.000000] Hierarchical RCU implementation.
[    0.000000] NR_IRQS:320
[    0.000000] Extended CMOS year: 2000
[    0.000000] Console: colour dummy device 80x25
[    0.000000] console [tty0] enabled
[    0.000000] hpet clockevent registered
[    0.000000] Fast TSC calibration failed
[    0.000000] TSC: Unable to calibrate against PIT
[    0.000000] TSC: using HPET reference calibration
[    0.000000] Detected 2161.241 MHz processor.
[    0.004007] Calibrating delay loop (skipped), value calculated using 
timer frequency.. 4322.48 BogoMIPS (lpj=2161241)
[    0.004080] Security Framework initialized
[    0.004091] SELinux:  Initializing.
[    0.004123] SELinux:  Starting in permissive mode
[    0.004142] Mount-cache hash table entries: 256
[    0.005619] CPU: Physical Processor ID: 0
[    0.005624] CPU: Processor Core ID: 0
[    0.005630] mce: CPU supports 6 MCE banks
[    0.005655] CPU0: Thermal monitoring enabled (TM2)
[    0.005662] using mwait in idle threads.
[    0.005667] Performance Events: Core2 events, Intel PMU driver.
[    0.005677] ... version:                2
[    0.005682] ... bit width:              40
[    0.005686] ... generic registers:      2
[    0.005691] ... value mask:             000000ffffffffff
[    0.005696] ... max period:             000000007fffffff
[    0.005701] ... fixed-purpose events:   3
[    0.005706] ... event mask:             0000000700000003
[    0.006919] ACPI: Core revision 20091214
[    0.030203] Setting APIC routing to flat
[    0.030591] ..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1
[    0.040636] CPU0: Intel(R) Core(TM)2 CPU         T7400  @ 2.16GHz 
stepping 06
[    0.040999] Booting Node   0, Processors  #1 Ok.
[    0.112042] Brought up 2 CPUs
[    0.112051] Total of 2 processors activated (8644.79 BogoMIPS).
[    0.114299] NET: Registered protocol family 16
[    0.116077] ACPI: bus type pci registered
[    0.116172] PCI: Using configuration type 1 for base access
[    0.132295] bio: create slab <bio-0> at 0
[    0.135069] ACPI: EC: EC description table is found, configuring boot EC
[    0.143361] ACPI: BIOS _OSI(Linux) query ignored
[    0.144603] ACPI: Interpreter enabled
[    0.144611] ACPI: (supports S0 S3 S4 S5)
[    0.144715] ACPI: Using IOAPIC for interrupt routing
[    0.178270] ACPI: EC: GPE = 0x17, I/O: command/status = 0x66, data = 0x62
[    0.180074] ACPI: No dock devices found.
[    0.183463] ACPI: PCI Root Bridge [PCI0] (0000:00)
[    0.183584] pci_root PNP0A08:00: ignoring host bridge windows from 
ACPI; boot with "pci=use_crs" to use them
[    0.188651] pci_root PNP0A08:00: host bridge window [io 
0x0000-0x0cf7] (ignored)
[    0.188660] pci_root PNP0A08:00: host bridge window [io 
0x0d00-0xffff] (ignored)
[    0.188669] pci_root PNP0A08:00: host bridge window [mem 
0x000a0000-0x000bffff] (ignored)
[    0.188679] pci_root PNP0A08:00: host bridge window [mem 
0x40000000-0xfebfffff] (ignored)
[    0.188786] pci 0000:00:01.0: PME# supported from D0 D3hot D3cold
[    0.188793] pci 0000:00:01.0: PME# disabled
[    0.188831] pci 0000:00:07.0: reg 10: [mem 0x50404000-0x50404fff]
[    0.188933] pci 0000:00:1b.0: reg 10: [mem 0x50400000-0x50403fff 64bit]
[    0.189004] pci 0000:00:1b.0: PME# supported from D0 D3hot D3cold
[    0.189012] pci 0000:00:1b.0: PME# disabled
[    0.189118] pci 0000:00:1c.0: PME# supported from D0 D3hot D3cold
[    0.189127] pci 0000:00:1c.0: PME# disabled
[    0.189236] pci 0000:00:1c.1: PME# supported from D0 D3hot D3cold
[    0.189244] pci 0000:00:1c.1: PME# disabled
[    0.189353] pci 0000:00:1c.2: PME# supported from D0 D3hot D3cold
[    0.189362] pci 0000:00:1c.2: PME# disabled
[    0.189437] pci 0000:00:1d.0: reg 20: [io  0x4080-0x409f]
[    0.189510] pci 0000:00:1d.1: reg 20: [io  0x4060-0x407f]
[    0.189583] pci 0000:00:1d.2: reg 20: [io  0x4040-0x405f]
[    0.189664] pci 0000:00:1d.3: reg 20: [io  0x4020-0x403f]
[    0.189735] pci 0000:00:1d.7: reg 10: [mem 0x50405400-0x504057ff]
[    0.189803] pci 0000:00:1d.7: PME# supported from D0 D3hot D3cold
[    0.189812] pci 0000:00:1d.7: PME# disabled
[    0.189992] pci 0000:00:1f.0: quirk: [io  0x0400-0x047f] claimed by 
ICH6 ACPI/GPIO/TCO
[    0.190004] pci 0000:00:1f.0: quirk: [io  0x0500-0x053f] claimed by 
ICH6 GPIO
[    0.190012] pci 0000:00:1f.0: ICH7 LPC Generic IO decode 1 PIO at 
0680 (mask 000f)
[    0.190022] pci 0000:00:1f.0: ICH7 LPC Generic IO decode 2 PIO at 
1640 (mask 000f)
[    0.190035] pci 0000:00:1f.0: ICH7 LPC Generic IO decode 4 PIO at 
0300 (mask 001f)
[    0.190132] pci 0000:00:1f.1: reg 10: [io  0x40d8-0x40df]
[    0.190144] pci 0000:00:1f.1: reg 14: [io  0x40ec-0x40ef]
[    0.190155] pci 0000:00:1f.1: reg 18: [io  0x40d0-0x40d7]
[    0.190166] pci 0000:00:1f.1: reg 1c: [io  0x40e8-0x40eb]
[    0.190177] pci 0000:00:1f.1: reg 20: [io  0x40b0-0x40bf]
[    0.190238] pci 0000:00:1f.2: reg 10: [io  0x40c8-0x40cf]
[    0.190250] pci 0000:00:1f.2: reg 14: [io  0x40e4-0x40e7]
[    0.190261] pci 0000:00:1f.2: reg 18: [io  0x40c0-0x40c7]
[    0.190272] pci 0000:00:1f.2: reg 1c: [io  0x40e0-0x40e3]
[    0.190283] pci 0000:00:1f.2: reg 20: [io  0x40a0-0x40af]
[    0.190295] pci 0000:00:1f.2: reg 24: [mem 0x50405000-0x504053ff]
[    0.190329] pci 0000:00:1f.2: PME# supported from D3hot
[    0.190337] pci 0000:00:1f.2: PME# disabled
[    0.190407] pci 0000:00:1f.3: reg 20: [io  0xefa0-0xefbf]
[    0.190485] pci 0000:01:00.0: reg 10: [mem 0x40000000-0x47ffffff pref]
[    0.190497] pci 0000:01:00.0: reg 14: [io  0x3000-0x30ff]
[    0.190509] pci 0000:01:00.0: reg 18: [mem 0x50300000-0x5030ffff]
[    0.190531] pci 0000:01:00.0: reg 30: [mem 0xfffe0000-0xffffffff pref]
[    0.190561] pci 0000:01:00.0: supports D1 D2
[    0.190626] pci 0000:00:01.0: PCI bridge to [bus 01-01]
[    0.190633] pci 0000:00:01.0:   bridge window [io  0x3000-0x3fff]
[    0.190640] pci 0000:00:01.0:   bridge window [mem 0x50300000-0x503fffff]
[    0.190649] pci 0000:00:01.0:   bridge window [mem 
0x40000000-0x47ffffff 64bit pref]
[    0.190723] pci 0000:02:00.0: reg 10: [mem 0x50200000-0x50203fff 64bit]
[    0.190738] pci 0000:02:00.0: reg 18: [io  0x2000-0x20ff]
[    0.190777] pci 0000:02:00.0: reg 30: [mem 0xfffe0000-0xffffffff pref]
[    0.190836] pci 0000:02:00.0: supports D1 D2
[    0.190841] pci 0000:02:00.0: PME# supported from D0 D1 D2 D3hot D3cold
[    0.190851] pci 0000:02:00.0: PME# disabled
[    0.190918] pci 0000:00:1c.0: PCI bridge to [bus 02-02]
[    0.190926] pci 0000:00:1c.0:   bridge window [io  0x2000-0x2fff]
[    0.190935] pci 0000:00:1c.0:   bridge window [mem 0x50200000-0x502fffff]
[    0.191017] pci 0000:03:00.0: reg 10: [mem 0x50100000-0x5010ffff 64bit]
[    0.191114] pci 0000:03:00.0: supports D1
[    0.191119] pci 0000:03:00.0: PME# supported from D0 D1 D3hot
[    0.191129] pci 0000:03:00.0: PME# disabled
[    0.191205] pci 0000:00:1c.1: PCI bridge to [bus 03-03]
[    0.191216] pci 0000:00:1c.1:   bridge window [mem 0x50100000-0x501fffff]
[    0.191291] pci 0000:00:1c.2: PCI bridge to [bus 04-0b]
[    0.191299] pci 0000:00:1c.2:   bridge window [io  0x1000-0x1fff]
[    0.191308] pci 0000:00:1c.2:   bridge window [mem 0x4c100000-0x500fffff]
[    0.191320] pci 0000:00:1c.2:   bridge window [mem 
0x48000000-0x4bffffff 64bit pref]
[    0.191385] pci 0000:0c:03.0: reg 10: [mem 0x4c004000-0x4c0047ff]
[    0.191398] pci 0000:0c:03.0: reg 14: [mem 0x4c000000-0x4c003fff]
[    0.191466] pci 0000:0c:03.0: supports D1 D2
[    0.191471] pci 0000:0c:03.0: PME# supported from D0 D1 D2 D3hot
[    0.191481] pci 0000:0c:03.0: PME# disabled
[    0.191548] pci 0000:00:1e.0: PCI bridge to [bus 0c-0c] (subtractive 
decode)
[    0.191560] pci 0000:00:1e.0:   bridge window [mem 0x4c000000-0x4c0fffff]
[    0.191599] pci_bus 0000:00: on NUMA node 0
[    0.191610] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT]
[    0.192869] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.PEGP._PRT]
[    0.193290] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.RP01._PRT]
[    0.193699] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.RP02._PRT]
[    0.194113] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.RP03._PRT]
[    0.194586] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.PCIB._PRT]
[    0.228230] ACPI: PCI Interrupt Link [LNKA] (IRQs 1 3 4 5 6 7 10 12 
14 15) *11
[    0.228564] ACPI: PCI Interrupt Link [LNKB] (IRQs 1 3 4 5 6 7 *11 12 
14 15)
[    0.228902] ACPI: PCI Interrupt Link [LNKC] (IRQs 1 3 4 5 6 7 10 12 
14 15) *11
[    0.229239] ACPI: PCI Interrupt Link [LNKD] (IRQs 1 3 4 5 6 7 *11 12 
14 15)
[    0.229568] ACPI: PCI Interrupt Link [LNKE] (IRQs 1 3 4 5 6 7 10 12 
14 15) *0, disabled.
[    0.229907] ACPI: PCI Interrupt Link [LNKF] (IRQs 1 3 4 5 6 7 11 12 
14 15) *0, disabled.
[    0.230249] ACPI: PCI Interrupt Link [LNKG] (IRQs 1 3 4 5 6 7 *10 12 
14 15)
[    0.230581] ACPI: PCI Interrupt Link [LNKH] (IRQs 3 4 5 6 7 *11 12 14 15)
[    0.231100] vgaarb: device added: 
PCI:0000:01:00.0,decodes=io+mem,owns=io+mem,locks=none
[    0.231100] vgaarb: loaded
[    0.232081] SCSI subsystem initialized
[    0.232081] libata version 3.00 loaded.
[    0.232110] usbcore: registered new interface driver usbfs
[    0.232110] usbcore: registered new interface driver hub
[    0.233021] usbcore: registered new device driver usb
[    0.233096] PCI: Using ACPI for IRQ routing
[    0.233096] PCI: pci_cache_line_size set to 64 bytes
[    0.234251] cfg80211: Calling CRDA to update world regulatory domain
[    0.235029] NetLabel: Initializing
[    0.235029] NetLabel:  domain hash size = 128
[    0.235029] NetLabel:  protocols = UNLABELED CIPSOv4
[    0.235071] NetLabel:  unlabeled traffic allowed by default
[    0.235082] HPET: 3 timers in total, 0 timers will be used for 
per-cpu timer
[    0.235093] hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0
[    0.235101] hpet0: 3 comparators, 64-bit 14.318180 MHz counter
[    0.238007] Switching to clocksource tsc
[    0.249831] pnp: PnP ACPI init
[    0.249886] ACPI: bus type pnp registered
[    0.256306] pnp 00:07: disabling [io  0x1640-0x164f] because it 
overlaps 0000:00:1c.2 BAR 7 [io  0x1000-0x1fff]
[    0.261321] pnp: PnP ACPI: found 9 devices
[    0.261327] ACPI: ACPI bus type pnp unregistered
[    0.261347] system 00:01: [mem 0xf0000000-0xf3ffffff] has been reserved
[    0.261356] system 00:01: [mem 0xfed14000-0xfed17fff] has been reserved
[    0.261363] system 00:01: [mem 0xfed18000-0xfed18fff] has been reserved
[    0.261371] system 00:01: [mem 0xfed19000-0xfed19fff] has been reserved
[    0.261379] system 00:01: [mem 0xfed1c000-0xfed1ffff] has been reserved
[    0.261387] system 00:01: [mem 0xfed20000-0xfed8ffff] has been reserved
[    0.261401] system 00:05: [mem 0xfed00000-0xfed003ff] has been reserved
[    0.261415] system 00:07: [io  0x0680-0x06ef] has been reserved
[    0.261423] system 00:07: [io  0x0800-0x080f] has been reserved
[    0.261430] system 00:07: [io  0x0810-0x0817] has been reserved
[    0.261437] system 00:07: [io  0x0400-0x047f] has been reserved
[    0.261445] system 00:07: [io  0x0500-0x053f] has been reserved
[    0.267603] pci 0000:01:00.0: no compatible bridge window for [mem 
0xfffe0000-0xffffffff pref]
[    0.267615] pci 0000:02:00.0: no compatible bridge window for [mem 
0xfffe0000-0xffffffff pref]
[    0.267679] pci 0000:00:1c.0: BAR 9: assigned [mem 
0x50500000-0x506fffff pref]
[    0.267689] pci 0000:00:1c.1: BAR 9: assigned [mem 
0x50700000-0x508fffff 64bit pref]
[    0.267699] pci 0000:00:1c.1: BAR 7: assigned [io  0x5000-0x5fff]
[    0.267707] pci 0000:01:00.0: BAR 6: assigned [mem 
0x50320000-0x5033ffff pref]
[    0.267716] pci 0000:00:01.0: PCI bridge to [bus 01-01]
[    0.267722] pci 0000:00:01.0:   bridge window [io  0x3000-0x3fff]
[    0.267730] pci 0000:00:01.0:   bridge window [mem 0x50300000-0x503fffff]
[    0.267738] pci 0000:00:01.0:   bridge window [mem 
0x40000000-0x47ffffff 64bit pref]
[    0.267750] pci 0000:02:00.0: BAR 6: assigned [mem 
0x50500000-0x5051ffff pref]
[    0.267759] pci 0000:00:1c.0: PCI bridge to [bus 02-02]
[    0.267766] pci 0000:00:1c.0:   bridge window [io  0x2000-0x2fff]
[    0.267776] pci 0000:00:1c.0:   bridge window [mem 0x50200000-0x502fffff]
[    0.267785] pci 0000:00:1c.0:   bridge window [mem 
0x50500000-0x506fffff pref]
[    0.267798] pci 0000:00:1c.1: PCI bridge to [bus 03-03]
[    0.267805] pci 0000:00:1c.1:   bridge window [io  0x5000-0x5fff]
[    0.267815] pci 0000:00:1c.1:   bridge window [mem 0x50100000-0x501fffff]
[    0.267824] pci 0000:00:1c.1:   bridge window [mem 
0x50700000-0x508fffff 64bit pref]
[    0.267838] pci 0000:00:1c.2: PCI bridge to [bus 04-0b]
[    0.267845] pci 0000:00:1c.2:   bridge window [io  0x1000-0x1fff]
[    0.267855] pci 0000:00:1c.2:   bridge window [mem 0x4c100000-0x500fffff]
[    0.267864] pci 0000:00:1c.2:   bridge window [mem 
0x48000000-0x4bffffff 64bit pref]
[    0.267878] pci 0000:00:1e.0: PCI bridge to [bus 0c-0c]
[    0.267883] pci 0000:00:1e.0:   bridge window [io  disabled]
[    0.267893] pci 0000:00:1e.0:   bridge window [mem 0x4c000000-0x4c0fffff]
[    0.267901] pci 0000:00:1e.0:   bridge window [mem pref disabled]
[    0.267928] pci 0000:00:01.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
[    0.267936] pci 0000:00:01.0: setting latency timer to 64
[    0.267951] pci 0000:00:1c.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
[    0.267960] pci 0000:00:1c.0: setting latency timer to 64
[    0.267974] pci 0000:00:1c.1: PCI INT B -> GSI 16 (level, low) -> IRQ 16
[    0.267983] pci 0000:00:1c.1: setting latency timer to 64
[    0.267998] pci 0000:00:1c.2: PCI INT C -> GSI 18 (level, low) -> IRQ 18
[    0.268007] pci 0000:00:1c.2: setting latency timer to 64
[    0.268183] pci 0000:00:1e.0: power state changed by ACPI to D0
[    0.268194] pci 0000:00:1e.0: setting latency timer to 64
[    0.268202] pci_bus 0000:00: resource 0 [io  0x0000-0xffff]
[    0.268208] pci_bus 0000:00: resource 1 [mem 
0x00000000-0xffffffffffffffff]
[    0.268215] pci_bus 0000:01: resource 0 [io  0x3000-0x3fff]
[    0.268220] pci_bus 0000:01: resource 1 [mem 0x50300000-0x503fffff]
[    0.268227] pci_bus 0000:01: resource 2 [mem 0x40000000-0x47ffffff 
64bit pref]
[    0.268235] pci_bus 0000:02: resource 0 [io  0x2000-0x2fff]
[    0.268241] pci_bus 0000:02: resource 1 [mem 0x50200000-0x502fffff]
[    0.268247] pci_bus 0000:02: resource 2 [mem 0x50500000-0x506fffff pref]
[    0.268253] pci_bus 0000:03: resource 0 [io  0x5000-0x5fff]
[    0.268258] pci_bus 0000:03: resource 1 [mem 0x50100000-0x501fffff]
[    0.268264] pci_bus 0000:03: resource 2 [mem 0x50700000-0x508fffff 
64bit pref]
[    0.268273] pci_bus 0000:04: resource 0 [io  0x1000-0x1fff]
[    0.268278] pci_bus 0000:04: resource 1 [mem 0x4c100000-0x500fffff]
[    0.268285] pci_bus 0000:04: resource 2 [mem 0x48000000-0x4bffffff 
64bit pref]
[    0.268293] pci_bus 0000:0c: resource 1 [mem 0x4c000000-0x4c0fffff]
[    0.268299] pci_bus 0000:0c: resource 3 [io  0x0000-0xffff]
[    0.268305] pci_bus 0000:0c: resource 4 [mem 
0x00000000-0xffffffffffffffff]
[    0.268344] NET: Registered protocol family 2
[    0.268447] IP route cache hash table entries: 32768 (order: 6, 
262144 bytes)
[    0.269006] TCP established hash table entries: 131072 (order: 9, 
2097152 bytes)
[    0.270072] TCP bind hash table entries: 65536 (order: 9, 2097152 bytes)
[    0.271493] TCP: Hash tables configured (established 131072 bind 65536)
[    0.271502] TCP reno registered
[    0.271515] UDP hash table entries: 512 (order: 3, 49152 bytes)
[    0.271555] UDP-Lite hash table entries: 512 (order: 3, 49152 bytes)
[    0.271820] NET: Registered protocol family 1
[    0.272046] pci 0000:01:00.0: Boot video device
[    0.272069] PCI: CLS mismatch (256 != 64), using 64 bytes
[    0.276213] microcode: CPU0 sig=0x6f6, pf=0x20, revision=0xc7
[    0.276228] microcode: CPU1 sig=0x6f6, pf=0x20, revision=0xc7
[    0.276371] microcode: Microcode Update Driver: v2.00 
<tigran@aivazian.fsnet.co.uk>, Peter Oruba
[    0.278331] Initializing RT-Tester: OK
[    0.278488] audit: initializing netlink socket (enabled)
[    0.278520] type=2000 audit(1273564311.277:1): initialized
[    0.289010] HugeTLB registered 2 MB page size, pre-allocated 0 pages
[    0.312491] ROMFS MTD (C) 2007 Red Hat, Inc.
[    0.312849] fuse init (API version 7.13)
[    0.313639] msgmni has been set to 1970
[    0.314039] SELinux:  Registering netfilter hooks
[    0.315444] alg: No test for stdrng (krng)
[    0.315473] io scheduler noop registered
[    0.316055] io scheduler cfq registered (default)
[    0.317292] vesafb: framebuffer at 0x40000000, mapped to 
0xffffc90000100000, using 3072k, total 3072k
[    0.317302] vesafb: mode is 1024x768x32, linelength=4096, pages=0
[    0.317308] vesafb: scrolling: redraw
[    0.317313] vesafb: Truecolor: size=0:8:8:8, shift=0:16:8:0
[    0.365593] Console: switching to colour frame buffer device 128x48
[    0.409799] fb0: VESA VGA frame buffer device
[    0.427032] Linux agpgart interface v0.103
[    0.430944] loop: module loaded
[    0.431433] input: Macintosh mouse button emulation as 
/devices/virtual/input/input0
[    0.433482] ata_piix 0000:00:1f.1: version 2.13
[    0.434018] ata_piix 0000:00:1f.1: power state changed by ACPI to D0
[    0.434600] ata_piix 0000:00:1f.1: PCI INT A -> GSI 18 (level, low) 
-> IRQ 18
[    0.435295] ata_piix 0000:00:1f.1: setting latency timer to 64
[    0.435933] scsi0 : ata_piix
[    0.437058] scsi1 : ata_piix
[    0.439950] ata1: PATA max UDMA/100 cmd 0x1f0 ctl 0x3f6 bmdma 0x40b0 
irq 14
[    0.440578] ata2: PATA max UDMA/100 cmd 0x170 ctl 0x376 bmdma 0x40b8 
irq 15
[    0.441243] ata_piix 0000:00:1f.2: PCI INT B -> GSI 19 (level, low) 
-> IRQ 19
[    0.441974] ata_piix 0000:00:1f.2: MAP [ P0 P2 -- -- ]
[    0.592917] ata_piix 0000:00:1f.2: setting latency timer to 64
[    0.593624] scsi2 : ata_piix
[    0.594249] scsi3 : ata_piix
[    0.599362] ata3: SATA max UDMA/133 cmd 0x40c8 ctl 0x40e4 bmdma 
0x40a0 irq 19
[    0.606272] ata1.00: ATAPI: MATSHITADVD-R   UJ-857D, KCV9, max UDMA/66
[    0.612186] ata1.00: configured for UDMA/66
[    0.614239] scsi 0:0:0:0: CD-ROM            MATSHITA DVD-R   UJ-857D 
  KCV9 PQ: 0 ANSI: 5
[    0.618804] sr0: scsi3-mmc drive: 24x/24x writer cd/rw xa/form2 cdda tray
[    0.618808] Uniform CD-ROM driver Revision: 3.20
[    0.619234] sr 0:0:0:0: Attached scsi CD-ROM sr0
[    0.619570] sr 0:0:0:0: Attached scsi generic sg0 type 5
[    0.672582] ata4: SATA max UDMA/133 cmd 0x40c0 ctl 0x40e0 bmdma 
0x40a8 irq 19
[    0.683734] usbcore: registered new interface driver usblcd
[    0.695028] usbcore: registered new interface driver usbled
[    0.706743] PNP: No PS/2 controller found. Probing ports directly.
[    0.719281] i8042.c: No controller found.
[    0.731646] mice: PS/2 mouse device common for all mice
[    0.744183] Linux video capture interface: v2.00
[    0.758609] device-mapper: ioctl: 4.16.0-ioctl (2009-11-05) 
initialised: dm-devel@redhat.com
[    0.772251] EDAC MC: Ver: 2.1.0 May 11 2010
[    0.786504] cpuidle: using governor ladder
[    0.800663] cpuidle: using governor menu
[    0.819254] usbcore: registered new interface driver hiddev
[    0.845104] usbcore: registered new interface driver usbhid
[    0.860799] usbhid: USB HID core driver
[    0.876015] oprofile: using NMI interrupt.
[    0.891376] ata3.01: ATA-8: FUJITSU MHW2120BH, 00810013, max UDMA/100
[    0.891695] IPVS: Registered protocols (TCP, AH, ESP)
[    0.891924] IPVS: Connection hash table configured (size=4096, 
memory=64Kbytes)
[    0.891971] IPVS: ipvs loaded.
[    0.892225] Initializing XFRM netlink socket
[    0.892244] NET: Registered protocol family 17
[    0.892301] NET: Registered protocol family 15
[    0.892303] lib80211: common routines for IEEE802.11 drivers
[    0.892306] lib80211_crypt: registered algorithm 'NULL'
[    0.892821] No TPM chip found, activating TPM-bypass!
[    1.047840] ata3.01: 234441648 sectors, multi 16: LBA48 NCQ (depth 0/32)
[    1.067656] ata3.01: configured for UDMA/100
[    1.083567] scsi 2:0:1:0: Direct-Access     ATA      FUJITSU MHW2120B 
0081 PQ: 0 ANSI: 5
[    1.100377] sd 2:0:1:0: [sda] 234441648 512-byte logical blocks: (120 
GB/111 GiB)
[    1.100545] sd 2:0:1:0: Attached scsi generic sg1 type 0
[    1.133413] sd 2:0:1:0: [sda] Write Protect is off
[    1.149624] sd 2:0:1:0: [sda] Mode Sense: 00 3a 00 00
[    1.165896] sd 2:0:1:0: [sda] Write cache: enabled, read cache: 
enabled, doesn't support DPO or FUA
[    1.182967]  sda: sda1 sda2 sda3 sda4
[    1.270559] sd 2:0:1:0: [sda] Attached SCSI disk
[    1.344159] EXT4-fs (sda3): mounted filesystem with ordered data mode
[    1.361097] VFS: Mounted root (ext4 filesystem) readonly on device 8:3.
[    1.378046] Freeing unused kernel memory: 504k freed
[    1.926899] SELinux: 8192 avtab hash slots, 175799 rules.
[    2.095133] SELinux: 8192 avtab hash slots, 175799 rules.
[    2.473851] SELinux:  7 users, 14 roles, 3026 types, 119 bools, 1 
sens, 256 cats
[    2.490458] SELinux:  77 classes, 175799 rules
[    2.517920] SELinux:  Completing initialization.
[    2.534250] SELinux:  Setting up existing superblocks.
[    2.550371] SELinux: initialized (dev sda3, type ext4), uses xattr
[    2.567134] SELinux: initialized (dev securityfs, type securityfs), 
uses genfs_contexts
[    2.583746] SELinux: initialized (dev selinuxfs, type selinuxfs), 
uses genfs_contexts
[    2.600372] SELinux: initialized (dev mqueue, type mqueue), uses 
transition SIDs
[    2.616955] SELinux: initialized (dev hugetlbfs, type hugetlbfs), 
uses transition SIDs
[    2.633622] SELinux: initialized (dev devpts, type devpts), uses 
transition SIDs
[    2.649964] SELinux: initialized (dev inotifyfs, type inotifyfs), 
uses genfs_contexts
[    2.666100] SELinux: initialized (dev anon_inodefs, type 
anon_inodefs), uses genfs_contexts
[    2.682442] SELinux: initialized (dev pipefs, type pipefs), uses task 
SIDs
[    2.698997] SELinux: initialized (dev debugfs, type debugfs), uses 
genfs_contexts
[    2.716410] SELinux: initialized (dev sockfs, type sockfs), uses task 
SIDs
[    2.733275] SELinux: initialized (dev tmpfs, type tmpfs), uses 
transition SIDs
[    2.750141] SELinux: initialized (dev proc, type proc), uses 
genfs_contexts
[    2.767070] SELinux: initialized (dev bdev, type bdev), uses 
genfs_contexts
[    2.783638] SELinux: initialized (dev rootfs, type rootfs), uses 
genfs_contexts
[    2.800155] SELinux: initialized (dev sysfs, type sysfs), uses 
genfs_contexts
[    2.837370] type=1403 audit(1273564313.837:2): policy loaded 
auid=4294967295 ses=4294967295
[    3.689816] usbcore: registered new interface driver uvcvideo
[    3.707461] USB Video Class driver (v0.1.0)
[    3.732724] applesmc: Apple MacBook Pro detected:
[    3.751037] applesmc:  - Model with accelerometer
[    3.769847] applesmc:  - Model with light sensors and backlight
[    3.788595] applesmc:  - Model with 12 temperature sensors
[    3.807926] applesmc: device has already been initialized (0xe0, 0x00).
[    3.807928] applesmc: device successfully initialized.
[    3.826909] applesmc: 2 fans found.
[    3.846517] input: applesmc as 
/devices/platform/applesmc.768/input/input1
[    3.865125] Registered led device: smc::kbd_backlight
[    3.883846] applesmc: driver successfully loaded.
[    3.914201] usbcore: registered new interface driver appletouch
[    3.953843] ACPI: SSDT 000000003feb8c10 002AE (v01 APPLE   Cpu0Ist 
00003000 INTL 20050309)
[    3.974371] ACPI: SSDT 000000003feb8910 002A0 (v01 APPLE   Cpu0Cst 
00003001 INTL 20050309)
[    3.994867] Monitor-Mwait will be used to enter C-1 state
[    3.994913] Monitor-Mwait will be used to enter C-2 state
[    3.994957] Monitor-Mwait will be used to enter C-3 state
[    3.994968] Marking TSC unstable due to TSC halts in idle
[    4.014243] Switching to clocksource hpet
[    4.016958] ACPI: SSDT 000000003feb8f10 00087 (v01 APPLE   Cpu1Ist 
00003000 INTL 20050309)
[    4.018244] ACPI: SSDT 000000003feb7f10 00085 (v01 APPLE   Cpu1Cst 
00003000 INTL 20050309)
[    4.130576] Bluetooth: Core ver 2.15
[    4.156847] NET: Registered protocol family 31
[    4.176676] Bluetooth: HCI device and connection manager initialized
[    4.196874] Bluetooth: HCI socket layer initialized
[    4.221076] Bluetooth: L2CAP ver 2.14
[    4.240644] Bluetooth: L2CAP socket layer initialized
[    4.270139] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[    4.296119] Bluetooth: Generic Bluetooth USB driver ver 0.6
[    4.316286] usbcore: registered new interface driver btusb
[    4.357507] Bluetooth: RFCOMM TTY layer initialized
[    4.383453] Bluetooth: RFCOMM socket layer initialized
[    4.403365] Bluetooth: RFCOMM ver 1.11
[    4.429141] Bluetooth: HCI UART driver ver 2.2
[    4.448753] Bluetooth: HCI H4 protocol initialized
[    4.474685] Bluetooth: HCI BCSP protocol initialized
[    4.511455] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    4.531880] ehci_hcd 0000:00:1d.7: PCI INT A -> GSI 23 (level, low) 
-> IRQ 23
[    4.552618] ehci_hcd 0000:00:1d.7: setting latency timer to 64
[    4.552622] ehci_hcd 0000:00:1d.7: EHCI Host Controller
[    4.573402] ehci_hcd 0000:00:1d.7: new USB bus registered, assigned 
bus number 1
[    4.594424] ehci_hcd 0000:00:1d.7: using broken periodic workaround
[    4.615250] ehci_hcd 0000:00:1d.7: debug port 1
[    4.639400] ehci_hcd 0000:00:1d.7: cache line size of 64 is not supported
[    4.639454] ehci_hcd 0000:00:1d.7: irq 23, io mem 0x50405400
[    4.668385] ehci_hcd 0000:00:1d.7: USB 2.0 started, EHCI 1.00
[    4.694746] hub 1-0:1.0: USB hub found
[    4.714313] hub 1-0:1.0: 8 ports detected
[    4.739510] uhci_hcd: USB Universal Host Controller Interface driver
[    4.758513] uhci_hcd 0000:00:1d.0: PCI INT A -> GSI 23 (level, low) 
-> IRQ 23
[    4.777234] uhci_hcd 0000:00:1d.0: setting latency timer to 64
[    4.777239] uhci_hcd 0000:00:1d.0: UHCI Host Controller
[    4.795119] uhci_hcd 0000:00:1d.0: new USB bus registered, assigned 
bus number 2
[    4.813348] uhci_hcd 0000:00:1d.0: irq 23, io base 0x00004080
[    4.832039] hub 2-0:1.0: USB hub found
[    4.850074] hub 2-0:1.0: 2 ports detected
[    4.868308] uhci_hcd 0000:00:1d.1: PCI INT B -> GSI 19 (level, low) 
-> IRQ 19
[    4.886493] uhci_hcd 0000:00:1d.1: setting latency timer to 64
[    4.886497] uhci_hcd 0000:00:1d.1: UHCI Host Controller
[    4.904293] uhci_hcd 0000:00:1d.1: new USB bus registered, assigned 
bus number 3
[    4.922338] uhci_hcd 0000:00:1d.1: irq 19, io base 0x00004060
[    4.940626] hub 3-0:1.0: USB hub found
[    4.957767] hub 3-0:1.0: 2 ports detected
[    4.974696] uhci_hcd 0000:00:1d.2: PCI INT C -> GSI 18 (level, low) 
-> IRQ 18
[    4.991448] uhci_hcd 0000:00:1d.2: setting latency timer to 64
[    4.991452] uhci_hcd 0000:00:1d.2: UHCI Host Controller
[    5.008039] uhci_hcd 0000:00:1d.2: new USB bus registered, assigned 
bus number 4
[    5.024827] uhci_hcd 0000:00:1d.2: irq 18, io base 0x00004040
[    5.042044] hub 4-0:1.0: USB hub found
[    5.058252] hub 4-0:1.0: 2 ports detected
[    5.074516] uhci_hcd 0000:00:1d.3: PCI INT D -> GSI 16 (level, low) 
-> IRQ 16
[    5.090776] uhci_hcd 0000:00:1d.3: setting latency timer to 64
[    5.090780] uhci_hcd 0000:00:1d.3: UHCI Host Controller
[    5.106837] uhci_hcd 0000:00:1d.3: new USB bus registered, assigned 
bus number 5
[    5.123264] uhci_hcd 0000:00:1d.3: irq 16, io base 0x00004020
[    5.140224] hub 5-0:1.0: USB hub found
[    5.156436] hub 5-0:1.0: 2 ports detected
[    5.190290] usb 1-4: new high speed USB device using ehci_hcd and 
address 3
[    5.194416] ieee1394: raw1394: /dev/raw1394 device initialized
[    5.314194] alg: No test for cipher_null (cipher_null-generic)
[    5.358777] alg: No test for ecb(cipher_null) (ecb-cipher_null)
[    5.376514] alg: No test for digest_null (digest_null-generic)
[    5.394044] alg: No test for compress_null (compress_null-generic)
[    5.413146] uvcvideo: Found UVC 1.00 device Built-in iSight (05ac:8501)
[    5.433446] uvcvideo: UVC non compliance - GET_DEF(PROBE) not 
supported. Enabling workaround.
[    5.577940] SELinux: initialized (dev tmpfs, type tmpfs), uses 
transition SIDs
[    5.862068] usb 2-2: new full speed USB device using uhci_hcd and 
address 2
[    5.934341] udev: starting version 147
[    6.091059] input: Apple Computer Apple Internal Keyboard / Trackpad 
as /devices/pci0000:00/0000:00:1d.0/usb2/2-2/2-2:1.0/input/input2
[    6.195742] apple 0003:05AC:021A.0001: input: USB HID v1.11 Keyboard 
[Apple Computer Apple Internal Keyboard / Trackpad] on 
usb-0000:00:1d.0-2/input0
[    6.197493] i801_smbus 0000:00:1f.3: PCI INT B -> GSI 19 (level, low) 
-> IRQ 19
[    6.197500] ACPI: I/O resource 0000:00:1f.3 [0xefa0-0xefbf] conflicts 
with ACPI region SMBI [0xefa0-0xefaf]
[    6.197502] ACPI: If an ACPI driver is available for this device, you 
should use it instead of the native driver
[    7.017921] input: Lid Switch as 
/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0D:00/input/input3
[    7.022182] sky2 driver version 1.26
[    7.022239] sky2 0000:02:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
[    7.022255] sky2 0000:02:00.0: setting latency timer to 64
[    7.022297] sky2 0000:02:00.0: Yukon-2 EC chip revision 2
[    7.022423] sky2 0000:02:00.0: irq 24 for MSI/MSI-X
[    7.025070] sky2 eth0: addr 00:17:f2:cb:e3:71
[    7.027629] ohci1394 0000:0c:03.0: PCI INT A -> GSI 19 (level, low) 
-> IRQ 19
[    7.158316] ohci1394: fw-host0: OHCI-1394 1.1 (PCI): IRQ=[19] 
MMIO=[4c004000-4c0047ff]  Max Packet=[4096]  IR/IT contexts=[4/8]
[    7.250215] HDA Intel 0000:00:1b.0: PCI INT A -> GSI 22 (level, low) 
-> IRQ 22
[    7.338005] ACPI: Lid Switch [LID0]
[    7.341490] HDA Intel 0000:00:1b.0: irq 25 for MSI/MSI-X
[    7.341548] HDA Intel 0000:00:1b.0: setting latency timer to 64
[    7.357595] appletouch: Geyser mode initialized.
[    7.357759] input: appletouch as 
/devices/pci0000:00/0000:00:1d.0/usb2/2-2/2-2:1.1/input/input4
[    7.363772] input: Apple Computer Apple Internal Keyboard / Trackpad 
as /devices/pci0000:00/0000:00:1d.0/usb2/2-2/2-2:1.2/input/input5
[    7.363878] apple 0003:05AC:021A.0002: input: USB HID v1.11 Device 
[Apple Computer Apple Internal Keyboard / Trackpad] on 
usb-0000:00:1d.0-2/input2
[    7.518433] power_supply ADP1: uevent
[    7.518436] power_supply ADP1: No power supply yet
[    7.518467] power_supply ADP1: power_supply_changed
[    7.518472] ACPI: AC Adapter [ADP1] (on-line)
[    7.544264] power_supply ADP1: power_supply_changed_work
[    7.544267] power_supply ADP1: power_supply_update_gen_leds 1
[    7.544286] power_supply ADP1: uevent
[    7.544288] power_supply ADP1: POWER_SUPPLY_NAME=ADP1
[    7.544292] power_supply ADP1: Static prop TYPE=Mains
[    7.544296] power_supply ADP1: 1 dynamic props
[    7.544299] power_supply ADP1: prop ONLINE=1
[    7.613988] power_supply BAT0: uevent
[    7.613994] power_supply BAT0: No power supply yet
[    7.614137] power_supply BAT0: power_supply_changed
[    7.614149] power_supply BAT0: power_supply_changed_work
[    7.640451] power_supply BAT0: power_supply_update_bat_leds 0
[    7.640925] power_supply BAT0: uevent
[    7.640930] power_supply BAT0: POWER_SUPPLY_NAME=BAT0
[    7.640939] power_supply BAT0: Static prop TYPE=Battery
[    7.641023] power_supply BAT0: 13 dynamic props
[    7.641037] power_supply BAT0: prop STATUS=Unknown
[    7.641048] power_supply BAT0: prop PRESENT=1
[    7.641059] power_supply BAT0: prop TECHNOLOGY=Unknown
[    7.641068] power_supply BAT0: prop VOLTAGE_MIN_DESIGN=10800000
[    7.641079] power_supply BAT0: prop VOLTAGE_NOW=12481000
[    7.641087] power_supply BAT0: prop CURRENT_NOW=0
[    7.641095] power_supply BAT0: prop POWER_NOW=0
[    7.641103] power_supply BAT0: prop ENERGY_FULL_DESIGN=55000000
[    7.641114] power_supply BAT0: prop ENERGY_FULL=47360000
[    7.641122] power_supply BAT0: prop ENERGY_NOW=46810000
[    7.641131] power_supply BAT0: prop MODEL_NAME=ASMB012
[    7.641139] power_supply BAT0: prop MANUFACTURER=SMPN012
[    7.641147] power_supply BAT0: prop SERIAL_NUMBER=
[    7.641507] power_supply BAT0: uevent
[    7.641513] power_supply BAT0: POWER_SUPPLY_NAME=BAT0
[    7.641522] power_supply BAT0: Static prop TYPE=Battery
[    7.641530] power_supply BAT0: 13 dynamic props
[    7.641537] power_supply BAT0: prop STATUS=Unknown
[    7.641546] power_supply BAT0: prop PRESENT=1
[    7.641556] power_supply BAT0: prop TECHNOLOGY=Unknown
[    7.641566] power_supply BAT0: prop VOLTAGE_MIN_DESIGN=10800000
[    7.641578] power_supply BAT0: prop VOLTAGE_NOW=12481000
[    7.641587] power_supply BAT0: prop CURRENT_NOW=0
[    7.641596] power_supply BAT0: prop POWER_NOW=0
[    7.641606] power_supply BAT0: prop ENERGY_FULL_DESIGN=55000000
[    7.641616] power_supply BAT0: prop ENERGY_FULL=47360000
[    7.641626] power_supply BAT0: prop ENERGY_NOW=46810000
[    7.641636] power_supply BAT0: prop MODEL_NAME=ASMB012
[    7.641645] power_supply BAT0: prop MANUFACTURER=SMPN012
[    7.641655] power_supply BAT0: prop SERIAL_NUMBER=
[    7.663896] ACPI: Battery Slot [BAT0] (battery present)
[    7.698556] input: Power Button as 
/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0C:00/input/input6
[    7.735281] ACPI: Power Button [PWRB]
[    7.748032] usb 4-2: new full speed USB device using uhci_hcd and 
address 2
[    7.772215] ath9k 0000:03:00.0: PCI INT A -> GSI 17 (level, low) -> 
IRQ 17
[    7.772228] ath9k 0000:03:00.0: setting latency timer to 64
[    7.847212] input: Sleep Button as 
/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0E:00/input/input7
[    7.896301] ACPI: Sleep Button [SLPB]
[    7.906715] ath: EEPROM regdomain: 0x64
[    7.906717] ath: EEPROM indicates we should expect a direct regpair map
[    7.906721] ath: Country alpha2 being used: 00
[    7.906722] ath: Regpair used: 0x64
[    7.931261] input: Power Button as 
/devices/LNXSYSTM:00/LNXPWRBN:00/input/input8
[    7.935534] hda_codec: STAC922x, Apple subsys_id=106b1e00
[    7.990526] ACPI: Power Button [PWRF]
[    7.997530] phy0: Selected rate control algorithm 'ath9k_rate_control'
[    7.998053] Registered led device: ath9k-phy0::radio
[    7.998108] Registered led device: ath9k-phy0::assoc
[    7.998170] Registered led device: ath9k-phy0::tx
[    7.998225] Registered led device: ath9k-phy0::rx
[    7.998273] phy0: Atheros AR5418 MAC/BB Rev:2 AR5133 RF Rev:81 
mem=0xffffc90000bc0000, irq=17
[    8.041727] generic-usb 0003:05AC:8240.0003: hiddev0: USB HID v1.11 
Device [Apple Computer, Inc. IR Receiver] on usb-0000:00:1d.2-2/input0
[    8.323115] usb 5-1: new full speed USB device using uhci_hcd and 
address 2
[    8.554846] usbhid 5-1:1.0: couldn't find an input interrupt endpoint
[    8.615707] ieee1394: Host added: ID:BUS[0-00:1023] 
GUID[0019e3fffe2ad87e]
[    8.681077] usb 5-1: usbfs: USBDEVFS_CONTROL failed cmd hid2hci rqt 
64 rq 0 len 0 ret -84
[    8.705141] usb 5-1: USB disconnect, address 2
[    8.916170] SELinux: initialized (dev tmpfs, type tmpfs), uses 
transition SIDs
[    9.009347] Adding 390616k swap on /dev/sda4.  Priority:1 extents:1 
across:390616k
[    9.411314] usb 5-1: new full speed USB device using uhci_hcd and 
address 3
[   10.944574] ip_tables: (C) 2000-2006 Netfilter Core Team
[   10.981399] nf_conntrack version 0.5.0 (7884 buckets, 31536 max)
[   10.984245] CONFIG_NF_CT_ACCT is deprecated and will be removed soon. 
Please use
[   10.984248] nf_conntrack.acct=1 kernel parameter, acct=1 nf_conntrack 
module option or
[   10.984250] sysctl net.netfilter.nf_conntrack_acct=1 to enable it.
[   13.176234] applesmc: light sensor data length set to 6
[   16.399290] sky2 eth0: enabling interface
[   19.924510] type=1100 audit(1273564330.924:3): user pid=2016 uid=0 
auid=4294967295 ses=4294967295 
subj=system_u:system_r:local_login_t:s0-s0:c0.c255 
msg='op=PAM:authentication acct="name" exe="/bin/login" hostname=? 
addr=? terminal=/dev/tty1 res=success'
[   19.934946] type=1101 audit(1273564330.934:4): user pid=2016 uid=0 
auid=4294967295 ses=4294967295 
subj=system_u:system_r:local_login_t:s0-s0:c0.c255 
msg='op=PAM:accounting acct="name" exe="/bin/login" hostname=? addr=? 
terminal=/dev/tty1 res=success'
[   20.009616] type=1006 audit(1273564331.009:5): login pid=2016 uid=0 
old auid=4294967295 new auid=1000 old ses=4294967295 new ses=1
[   20.095026] type=2300 audit(1273564331.094:6): user pid=2016 uid=0 
auid=1000 ses=1 subj=system_u:system_r:local_login_t:s0-s0:c0.c255 
msg='pam: default-context=name:staff_r:staff_t:s0 
selected-context=name:staff_r:staff_t:s0: exe="/bin/login" hostname=? 
addr=? terminal=tty1 res=success'
[   20.178135] type=1105 audit(1273564331.178:7): user pid=2016 uid=0 
auid=1000 ses=1 subj=system_u:system_r:local_login_t:s0-s0:c0.c255 
msg='op=PAM:session_open acct="name" exe="/bin/login" hostname=? addr=? 
terminal=/dev/tty1 res=success'
[   20.191074] type=1103 audit(1273564331.190:8): user pid=2016 uid=0 
auid=1000 ses=1 subj=system_u:system_r:local_login_t:s0-s0:c0.c255 
msg='op=PAM:setcred acct="name" exe="/bin/login" hostname=? addr=? 
terminal=/dev/tty1 res=success'
[   20.191379] type=1112 audit(1273564331.191:9): user pid=2016 uid=0 
auid=1000 ses=1 subj=system_u:system_r:local_login_t:s0-s0:c0.c255 
msg='op=login acct="name" exe="/bin/login" hostname=? addr=? 
terminal=/dev/tty1 res=success'
[   22.308976] wlan0: direct probe to AP 00:1e:2a:00:67:f0 (try 1)
[   22.311733] wlan0: direct probe responded
[   22.311741] wlan0: authenticate with AP 00:1e:2a:00:67:f0 (try 1)
[   22.318090] wlan0: authenticated
[   22.318223] wlan0: associate with AP 00:1e:2a:00:67:f0 (try 1)
[   22.320730] wlan0: RX AssocResp from 00:1e:2a:00:67:f0 (capab=0x431 
status=0 aid=1)
[   22.320736] wlan0: associated
[   23.713535] [drm] Initialized drm 1.1.0 20060810
[   23.849540] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   23.849545] Bluetooth: BNEP filters: protocol multicast
[   23.928446] Bluetooth: SCO (Voice Link) ver 0.6
[   23.928449] Bluetooth: SCO socket layer initialized
[   23.929616] [drm] radeon defaulting to userspace modesetting.
[   23.930408] pci 0000:01:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
[   23.930416] pci 0000:01:00.0: setting latency timer to 64
[   23.930766] [drm] Initialized radeon 1.32.0 20080528 for 0000:01:00.0 
on minor 0
[   24.156429] [drm] Setting GART location based on new memory map
[   24.158069] [drm] Loading R500 Microcode
[   24.158077] platform radeon_cp.0: firmware: requesting radeon/R520_cp.bin
[   24.295079] [drm] Num pipes: 1
[   24.295092] [drm] writeback test succeeded in 1 usecs
[   27.435674] magicmouse 0005:05AC:030D.0004: claimed by neither input, 
hiddev nor hidraw
[   27.435686] magicmouse 0005:05AC:030D.0004: magicmouse hw start failed
[   27.435753] type=1400 audit(1273564338.435:10): avc:  denied  { 
search } for  pid=2105 comm="bluetoothd" name="hid" dev=debugfs ino=1056 
scontext=system_u:system_r:bluetooth_t:s0-s0:c0.c255 
tcontext=system_u:object_r:debugfs_t:s0 tclass=dir
[   27.435927] type=1300 audit(1273564338.435:10): arch=c000003e 
syscall=16 success=yes exit=0 a0=18 a1=400448c8 a2=7fd2680460f0 a3=10 
items=0 ppid=1 pid=2105 auid=4294967295 uid=0 gid=0 euid=0 suid=0 
fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 
comm="bluetoothd" exe="/usr/sbin/bluetoothd" 
subj=system_u:system_r:bluetooth_t:s0-s0:c0.c255 key=(null)
[   74.910194] usb 2-1: new low speed USB device using uhci_hcd and 
address 3
[   75.094202] input: Mitsumi Electric Apple Optical USB Mouse as 
/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1:1.0/input/input9
[   75.094598] apple 0003:05AC:0304.0005: input: USB HID v1.10 Mouse 
[Mitsumi Electric Apple Optical USB Mouse] on usb-0000:00:1d.0-1/input0


I'm a bit tired now.. will test commits
in the morning over here with git revert

Justin P. Mattock

^ permalink raw reply

* Re: magicmouse: claimed by neither input, hiddev nor hidraw
From: Justin P. Mattock @ 2010-05-11  7:56 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: Michael Poole, linux-bluetooth, Linux Kernel Mailing List
In-Reply-To: <alpine.LNX.2.00.1005110946520.28092@pobox.suse.cz>

On 05/11/10 00:47, Jiri Kosina wrote:
> On Mon, 10 May 2010, Justin P. Mattock wrote:
>
>> The only other thing that I remember when adding hidraw was adding
>> BT_HCIUART_LL=m (not sure if it matters or not).
>>
>> here is dmesg:
>> http://fpaste.org/OiDf/
>
> Please include the dmesg directly in the mail next time.
>
> Anyway, I don't see the dmesg you provided containing neither the "claimed
> by neither input, hiddev nor hidraw" nor "hw start failed" messages.
>

I'll post that on the next thread
here is the bisect results:


28918c211d86b6eeb70182c523800c7bc442960c is the first bad commit
commit 28918c211d86b6eeb70182c523800c7bc442960c
Author: Michael Poole <mdpoole@troilus.org>
Date:   Tue Mar 9 06:47:35 2010 -0500

     HID: magicmouse: fix oops after device removal

     Ask the HID core not to register an input device for the mouse.
     Fix an oops after removing the device, due to leaving the new
     input device registered.

     Signed-off-by: Michael Poole <mdpoole@troilus.org>
     Signed-off-by: Jiri Kosina <jkosina@suse.cz>

:040000 040000 f84a3ea09666b18abb20b59c128f6fecc5833dfa 
62cdf6cec329e4b761909d02558097ca78d76394 M      drivers

although I have not yet tested this out
with git revert xxxx on the current head.
(me thinks it's another).

here is the bisect log:


# bad: [f1c448e0a9e99c76f4ece368714fb35a40a8daba] Merge branch 
'for-linus' of git://neil.brown.name/md
git bisect bad f1c448e0a9e99c76f4ece368714fb35a40a8daba
# good: [57d54889cd00db2752994b389ba714138652e60c] Linux 2.6.34-rc1
git bisect good 57d54889cd00db2752994b389ba714138652e60c
# bad: [53feb29767c29c877f9d47dcfe14211b5b0f7ebd] cpuset: alloc 
nodemask_t on the heap rather than the stack
git bisect bad 53feb29767c29c877f9d47dcfe14211b5b0f7ebd
# good: [d89b218b801fd93ea95880f1c7fde348cbcc51c5] Merge 
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
git bisect good d89b218b801fd93ea95880f1c7fde348cbcc51c5
# bad: [9d20593a722c2dab7a5ab74f5d8c9b604aca52f9] Merge branch 'merge' 
of git://git.secretlab.ca/git/linux-2.6
git bisect bad 9d20593a722c2dab7a5ab74f5d8c9b604aca52f9
# good: [441f4058a04b2943685ff94e0f5f1992b0b3649e] Merge 
git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable
git bisect good 441f4058a04b2943685ff94e0f5f1992b0b3649e
# bad: [961cde93dee2658000ead32abffb8ddf0727abe0] Merge 
git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
git bisect bad 961cde93dee2658000ead32abffb8ddf0727abe0
# good: [2993cc71d1bff61999ade7f2b6b3ea2dd1e2c8d9] [SCSI] bfa: AEN and 
byte alignment fixes.
git bisect good 2993cc71d1bff61999ade7f2b6b3ea2dd1e2c8d9
# good: [a12b51c478899fe0b7e874a559b05ba35f1128ee] perf tools: Fix 
sparse CPU numbering related bugs
git bisect good a12b51c478899fe0b7e874a559b05ba35f1128ee
# bad: [f82c37e7bb4c4d9b6a476c642d5c2d2efbd6f240] Merge branch 
'perf-fixes-for-linus' of 
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
git bisect bad f82c37e7bb4c4d9b6a476c642d5c2d2efbd6f240
# good: [dcd5c1662db59a6b82942f47fb6ac9dd63f6d3dd] perf: Fix unexported 
generic perf_arch_fetch_caller_regs
git bisect good dcd5c1662db59a6b82942f47fb6ac9dd63f6d3dd
# bad: [2886539d5e649c22a6d2107eb431d3bee81e0e6d] HID: ntrig: fix touch 
events
git bisect bad 2886539d5e649c22a6d2107eb431d3bee81e0e6d
# bad: [eff7f270e9a05688066f40589d7b44e1dcf335dc] HID: add quirk for 
UC-Logik WP4030 tablet
git bisect bad eff7f270e9a05688066f40589d7b44e1dcf335dc
# bad: [28918c211d86b6eeb70182c523800c7bc442960c] HID: magicmouse: fix 
oops after device removal
git bisect bad 28918c211d86b6eeb70182c523800c7bc442960c


I'm thinking it might be  HID: ntrig: fix touch

Justin P. Mattock

^ permalink raw reply

* Re: magicmouse: claimed by neither input, hiddev nor hidraw
From: Jiri Kosina @ 2010-05-11  7:47 UTC (permalink / raw)
  To: Justin P. Mattock
  Cc: Michael Poole, linux-bluetooth, Linux Kernel Mailing List
In-Reply-To: <4BE8C7CD.7030206@gmail.com>

On Mon, 10 May 2010, Justin P. Mattock wrote:

> The only other thing that I remember when adding hidraw was adding 
> BT_HCIUART_LL=m (not sure if it matters or not).
> 
> here is dmesg:
> http://fpaste.org/OiDf/

Please include the dmesg directly in the mail next time.

Anyway, I don't see the dmesg you provided containing neither the "claimed
by neither input, hiddev nor hidraw" nor "hw start failed" messages.

-- 
Jiri Kosina
SUSE Labs, Novell Inc.

^ permalink raw reply

* Re: [PATCH 25/25] Initial support for clock synchronization protocol
From: Santiago Carot-Nemesio @ 2010-05-11  7:45 UTC (permalink / raw)
  To: Gustavo F. Padovan; +Cc: Santiago Carot-Nemesio, linux-bluetooth
In-Reply-To: <20100511055245.GA3252@vigoh>

Hello,

El mar, 11-05-2010 a las 02:52 -0300, Gustavo F. Padovan escribió:
> Ho Santiago,
> 
> * Santiago Carot-Nemesio <sancane@gmail.com> [2010-05-10 12:15:27 +0200]:
> 
> > From: Santiago Carot Nemesio <sancane@gmail.com>
> > 
> > ---
> >  Makefile.am |    4 +-
> >  mcap/mcap.c |    2 +-
> >  mcap/sync.c |   84 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >  3 files changed, 87 insertions(+), 3 deletions(-)
> >  create mode 100644 mcap/sync.c
> > 
> > diff --git a/Makefile.am b/Makefile.am
> > index 7d8f4b5..98dacdf 100644
> > --- a/Makefile.am
> > +++ b/Makefile.am
> > @@ -170,8 +170,8 @@ builtin_sources += plugins/service.c
> >  endif
> >  
> >  if MCAP
> > -mcap_sources += mcap/mcap_lib.h \
> > -		mcap/mcap_internal.h \
> > +mcap_sources += mcap/mcap_internal.h \
> > +		mcap/mcap_lib.h mcap/sync.c \
> >  		mcap/mcap.h mcap/mcap.c
> >  endif
> >  
> > diff --git a/mcap/mcap.c b/mcap/mcap.c
> > index a292dcd..0fd5b97 100644
> > --- a/mcap/mcap.c
> > +++ b/mcap/mcap.c
> > @@ -1500,7 +1500,7 @@ static void rsend_req(struct mcap_mcl *mcl)
> >  static void proc_cmd(struct mcap_mcl *mcl, uint8_t *cmd, uint32_t len)
> >  {
> >  	if ((cmd[0] >= MCAP_MD_SYNC_CAP_REQ) && (cmd[0] <= MCAP_MD_SYNC_INFO_IND)) {
> > -		send4B_cmd(mcl, cmd[0], MCAP_REQUEST_NOT_SUPPORTED, MCAP_MDLID_RESERVED);
> > +		proc_sync_cmd(mcl, cmd, len);
> >  		return;
> >  	}
> >  
> > diff --git a/mcap/sync.c b/mcap/sync.c
> > new file mode 100644
> > index 0000000..ede125a
> > --- /dev/null
> > +++ b/mcap/sync.c
> > @@ -0,0 +1,84 @@
> > +/*
> > + *
> > + *  MCAP for BlueZ - Bluetooth protocol stack for Linux
> > + *
> > + *  Copyright (C) 2010 GSyC/LibreSoft, Universidad Rey Juan Carlos.
> > + *
> > + *  Authors:
> > + *  Santiago Carot-Nemesio <sancane at gmail.com>
> > + *  Jose Antonio Santos-Cadenas <santoscadenas at gmail.com>
> > + *
> > + *  This program is free software; you can redistribute it and/or modify
> > + *  it under the terms of the GNU General Public License as published by
> > + *  the Free Software Foundation; either version 2 of the License, or
> > + *  (at your option) any later version.
> > + *
> > + *  This program is distributed in the hope that it will be useful,
> > + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > + *  GNU General Public License for more details.
> > + *
> > + *  You should have received a copy of the GNU General Public License
> > + *  along with this program; if not, write to the Free Software
> > + *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
> > + *
> > + */
> > +
> > +#include <stdint.h>
> > +#include <netinet/in.h>
> > +
> > +#include "logging.h"
> > +
> > +#include "mcap.h"
> > +#include "mcap_lib.h"
> > +#include "mcap_internal.h"
> > +
> > +static int send_unsupported_req(struct mcap_mcl *mcl, uint8_t oc)
> > +{
> > +	uint8_t *rsp;
> > +	mcap4B_rsp *rsp_err;
> > +	int sent;
> > +
> > +
> > +	rsp = g_malloc0(sizeof(mcap4B_rsp));
> > +
> > +	rsp_err = (mcap4B_rsp *)rsp;
> > +	rsp_err->op = oc;
> > +	rsp_err->rc = MCAP_REQUEST_NOT_SUPPORTED;
> > +	rsp_err->mdl = htons (MCAP_MDLID_RESERVED);
> > +
> > +	sent = mcap_send_data(g_io_channel_unix_get_fd(mcl->cc),
> > +					rsp,
> > +					sizeof(mcap4B_rsp));
> > +	g_free(rsp);
> > +	return sent;
> > +}
> > +
> > +void proc_sync_cmd(struct mcap_mcl *mcl, uint8_t *cmd, uint32_t len)
> > +{
> > +	switch (cmd[0]) {
> > +	case MCAP_MD_SYNC_CAP_REQ:
> > +		debug("TODO: received MCAP_MD_SYNC_CAP_REQ: %d",
> > +							MCAP_MD_SYNC_CAP_REQ);
> > +		break;
> > +	case MCAP_MD_SYNC_CAP_RSP:
> > +		debug("TODO: received MCAP_MD_SYNC_CAP_RSP: %d",
> > +							MCAP_MD_SYNC_CAP_RSP);
> > +		break;
> > +	case MCAP_MD_SYNC_SET_REQ:
> > +		debug("TODO: received MCAP_MD_SYNC_SET_REQ: %d",
> > +							MCAP_MD_SYNC_SET_REQ);
> > +		break;
> > +	case MCAP_MD_SYNC_SET_RSP:
> > +		debug("TODO: received MCAP_MD_SYNC_SET_RSP: %d",
> > +							MCAP_MD_SYNC_SET_RSP);
> > +		break;
> > +	case MCAP_MD_SYNC_INFO_IND:
> > +		debug("TODO: received MCAP_MD_SYNC_INFO_IND :%d",
> > +							MCAP_MD_SYNC_INFO_IND);
> > +		break;
> > +	}
> > +
> > +	/* Not implemented yet. Reply with unsupported request */
> > +        send_unsupported_req(mcl, cmd[0]);
> > +}
> 
> How are you thinking to handle the Clock Sync Protocol? It has to sync
> time with other Bluetooth devices, so I guess it needs some real time
> priority to run, doesn't it? Or Am I wrong?
> 
We are starting the work in CSP now. Elvis, Jose and I are thinking
about this issue. We don't have any precise idea yet. Of course, if you
have some ideas it will be pleasure for us to listen it.

Please, feel free to comment it.

Best regards.



^ permalink raw reply

* Re: [PATCH 01/25] Initial support for MCAP
From: Santiago Carot-Nemesio @ 2010-05-11  7:38 UTC (permalink / raw)
  To: Gustavo F. Padovan; +Cc: Santiago Carot-Nemesio, linux-bluetooth
In-Reply-To: <20100511041127.GA29087@vigoh>

Hello Gustavo,

El mar, 11-05-2010 a las 01:11 -0300, Gustavo F. Padovan escribió:
> Hi Santiago,
> 
> * Santiago Carot-Nemesio <sancane@gmail.com> [2010-05-10 12:15:03 +0200]:
> 
> > From: Santiago Carot Nemesio <sancane@gmail.com>
> > 
> > ---
> >  Makefile.am          |   13 ++++-
> >  acinclude.m4         |    6 ++
> >  mcap/mcap.c          |   55 ++++++++++++++++
> >  mcap/mcap.h          |  176 ++++++++++++++++++++++++++++++++++++++++++++++++++
> >  mcap/mcap_internal.h |  118 +++++++++++++++++++++++++++++++++
> >  mcap/mcap_lib.h      |  163 ++++++++++++++++++++++++++++++++++++++++++++++
> >  6 files changed, 530 insertions(+), 1 deletions(-)
> >  create mode 100644 mcap/mcap.c
> >  create mode 100644 mcap/mcap.h
> >  create mode 100644 mcap/mcap_internal.h
> >  create mode 100644 mcap/mcap_lib.h
> 
> Applying this one with git am I get this:
> 
> Applying: Initial support for MCAP
> /home/padovan/p/bluez/.git/rebase-apply/patch:462: new blank line at
> EOF.
> +
> warning: 1 line adds whitespace errors.
> 

I checked the patch again and I dont see that problem applying it. Here
is what I did:
* Clone new BlueZ repository
* Save mail with the patch got from the mailing list
* Apply it with git am
..and everithing is OK.

> 
> > 
> > diff --git a/Makefile.am b/Makefile.am
> > index f991121..7d8f4b5 100644
> > --- a/Makefile.am
> > +++ b/Makefile.am
> > @@ -101,6 +101,7 @@ gdbus_sources = gdbus/gdbus.h gdbus/mainloop.c gdbus/object.c gdbus/watch.c
> >  builtin_modules =
> >  builtin_sources =
> >  builtin_nodist =
> > +mcap_sources =
> >  
> >  if PNATPLUGIN
> >  builtin_modules += pnat
> > @@ -168,6 +169,12 @@ builtin_modules += service
> >  builtin_sources += plugins/service.c
> >  endif
> >  
> > +if MCAP
> > +mcap_sources += mcap/mcap_lib.h \
> > +		mcap/mcap_internal.h \
> > +		mcap/mcap.h mcap/mcap.c
> 
> Why are you not using builtin_sources here?

MCAP is not a plugin, is just a library like BTIOChannel, etc. Plugins
that need MCAP to work should use it. That is the architecture that we
agree speaking with Claudio.

> 
> > +endif
> > +
> >  builtin_modules += hciops
> >  builtin_sources += plugins/hciops.c
> >  
> > @@ -196,7 +203,8 @@ src_bluetoothd_SOURCES = $(gdbus_sources) $(builtin_sources) \
> >  			src/adapter.h src/adapter.c \
> >  			src/device.h src/device.c \
> >  			src/dbus-common.c src/dbus-common.h \
> > -			src/dbus-hci.h src/dbus-hci.c
> > +			src/dbus-hci.h src/dbus-hci.c \
> > +			$(mcap_sources)
> >  src_bluetoothd_LDADD = lib/libbluetooth.la @GLIB_LIBS@ @DBUS_LIBS@ \
> >  							@CAPNG_LIBS@ -ldl
> >  src_bluetoothd_LDFLAGS = -Wl,--export-dynamic \
> > @@ -318,6 +326,9 @@ AM_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ @CAPNG_CFLAGS@ \
> >  INCLUDES = -I$(builddir)/lib -I$(builddir)/src -I$(srcdir)/src \
> >  			-I$(srcdir)/audio -I$(srcdir)/sbc -I$(srcdir)/gdbus
> >  
> > +if MCAP
> > +INCLUDES += -I$(builddir)/mcap
> > +endif
> 
> Why only MCAP has a separated if for INCLUDES?

Because MCAP is optional, if you don't have any plugin using it, why you
want compile it?

> 
> >  
> >  pkgconfigdir = $(libdir)/pkgconfig
> >  
> > diff --git a/acinclude.m4 b/acinclude.m4
> > index f7bb047..b512cfb 100644
> > --- a/acinclude.m4
> > +++ b/acinclude.m4
> > @@ -167,6 +167,7 @@ AC_DEFUN([AC_ARG_BLUEZ], [
> >  	serial_enable=yes
> >  	network_enable=yes
> >  	service_enable=yes
> > +	mcap_enable=no
> >  	pnat_enable=no
> >  	tracer_enable=no
> >  	tools_enable=yes
> > @@ -215,6 +216,10 @@ AC_DEFUN([AC_ARG_BLUEZ], [
> >  		service_enable=${enableval}
> >  	])
> >  
> > +	AC_ARG_ENABLE(mcap, AC_HELP_STRING([--enable-mcap], [enable mcap support]), [
> > +			mcap_enable=${enableval}
> > +	])
> > +
> >  	AC_ARG_ENABLE(pnat, AC_HELP_STRING([--enable-pnat], [enable pnat plugin]), [
> >  		pnat_enable=${enableval}
> >  	])
> > @@ -325,6 +330,7 @@ AC_DEFUN([AC_ARG_BLUEZ], [
> >  	AM_CONDITIONAL(SERIALPLUGIN, test "${serial_enable}" = "yes")
> >  	AM_CONDITIONAL(NETWORKPLUGIN, test "${network_enable}" = "yes")
> >  	AM_CONDITIONAL(SERVICEPLUGIN, test "${service_enable}" = "yes")
> > +	AM_CONDITIONAL(MCAP, test "${mcap_enable}" = "yes")
> >  	AM_CONDITIONAL(ECHOPLUGIN, test "no" = "yes")
> >  	AM_CONDITIONAL(PNATPLUGIN, test "${pnat_enable}" = "yes")
> >  	AM_CONDITIONAL(TRACER, test "${tracer_enable}" = "yes")
> > diff --git a/mcap/mcap.c b/mcap/mcap.c
> > new file mode 100644
> > index 0000000..df8dd50
> > --- /dev/null
> > +++ b/mcap/mcap.c
> > @@ -0,0 +1,55 @@
> > +/*
> > + *
> > + *  MCAP for BlueZ - Bluetooth protocol stack for Linux
> > + *
> > + *  Copyright (C) 2010 GSyC/LibreSoft, Universidad Rey Juan Carlos.
> > + *
> > + *  Authors:
> > + *  Santiago Carot-Nemesio <sancane at gmail.com>
> > + *  Jose Antonio Santos-Cadenas <santoscadenas at gmail.com>
> > + *
> > + *  This program is free software; you can redistribute it and/or modify
> > + *  it under the terms of the GNU General Public License as published by
> > + *  the Free Software Foundation; either version 2 of the License, or
> > + *  (at your option) any later version.
> > + *
> > + *  This program is distributed in the hope that it will be useful,
> > + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > + *  GNU General Public License for more details.
> > + *
> > + *  You should have received a copy of the GNU General Public License
> > + *  along with this program; if not, write to the Free Software
> > + *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
> > + *
> > + */
> > +
> > +#include "logging.h"
> > +#include "btio.h"
> > +#include "error.h"
> > +
> > +#include <netinet/in.h>
> > +
> > +#include "mcap.h"
> > +#include "mcap_lib.h"
> > +#include "mcap_internal.h"
> > +
> > +struct mcap_session *mcap_create_session(struct btd_adapter *btd_adapter,
> > +					BtIOSecLevel sec,
> > +					uint16_t ccpsm,
> > +					uint16_t dcpsm,
> > +					GError **gerr,
> > +					mcap_mcl_event_cb mcl_connected,
> > +					mcap_mcl_event_cb mcl_reconnected,
> > +					mcap_mcl_event_cb mcl_disconnected,
> > +					mcap_mcl_event_cb mcl_uncached,
> > +					gpointer user_data)
> > +{
> > +	/* TODO: Create MCAP Session */
> > +	return NULL;
> > +}
> > +
> > +void mcap_close_session(struct mcap_session *ms)
> > +{
> > +	/* Free MCAP session */
> > +}
> > diff --git a/mcap/mcap.h b/mcap/mcap.h
> > new file mode 100644
> > index 0000000..598e6ce
> > --- /dev/null
> > +++ b/mcap/mcap.h
> > @@ -0,0 +1,176 @@
> > +/*
> > + *
> > + *  MCAP for BlueZ - Bluetooth protocol stack for Linux
> > + *
> > + *  Copyright (C) 2010 GSyC/LibreSoft, Universidad Rey Juan Carlos.
> > + *
> > + *  Authors:
> > + *  Santiago Carot-Nemesio <sancane at gmail.com>
> > + *  Jose Antonio Santos-Cadenas <santoscadenas at gmail.com>
> > + *
> > + *  This program is free software; you can redistribute it and/or modify
> > + *  it under the terms of the GNU General Public License as published by
> > + *  the Free Software Foundation; either version 2 of the License, or
> > + *  (at your option) any later version.
> > + *
> > + *  This program is distributed in the hope that it will be useful,
> > + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > + *  GNU General Public License for more details.
> > + *
> > + *  You should have received a copy of the GNU General Public License
> > + *  along with this program; if not, write to the Free Software
> > + *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
> > + *
> > + */
> > +
> > +#ifndef __MCAP_H
> > +#define __MCAP_H
> > +
> > +#ifdef __cplusplus
> > +extern "C" {
> > +#endif
> > +
> > +#define MCAP_VERSION	0x0100	/* current version 01.00 */
> > +
> > +/* bytes to get MCAP Supported Procedures */
> > +#define MCAP_SUP_PROC	0x06
> > +
> > +/* maximum transmission unit for channels */
> > +#define MCAP_CC_MTU	48
> > +#define MCAP_DC_MTU	L2CAP_DEFAULT_MTU
> > +
> > +
> > +/* MCAP Standard Op Codes */
> > +#define MCAP_ERROR_RSP			0x00
> > +#define MCAP_MD_CREATE_MDL_REQ		0x01
> > +#define MCAP_MD_CREATE_MDL_RSP		0x02
> > +#define MCAP_MD_RECONNECT_MDL_REQ	0x03
> > +#define MCAP_MD_RECONNECT_MDL_RSP	0x04
> > +#define MCAP_MD_ABORT_MDL_REQ		0x05
> > +#define MCAP_MD_ABORT_MDL_RSP		0x06
> > +#define MCAP_MD_DELETE_MDL_REQ		0x07
> > +#define MCAP_MD_DELETE_MDL_RSP		0x08
> > +/*RESERVED                              0x09*/
> > +/*RESERVED                              0x10*/
> 
> No need for such RESERVED comments.
> 
> > +
> > +/* MCAP Clock Sync Op Codes */
> > +#define MCAP_MD_SYNC_CAP_REQ		0x11
> > +#define MCAP_MD_SYNC_CAP_RSP		0x12
> > +#define MCAP_MD_SYNC_SET_REQ		0x13
> > +#define MCAP_MD_SYNC_SET_RSP            0x14
> > +#define MCAP_MD_SYNC_INFO_IND		0x15
> > +/*RESERVED				0x16*/
> > +/*RESERVED                              0x17*/
> > +/*RESERVED                              0x18*/
> > +/*RESERVED                              0x19*/
> > +/*RESERVED                              0x20*/
> > +
> > +/* MCAP Response codes */
> > +#define MCAP_SUCCESS			0x00
> > +#define MCAP_INVALID_OP_CODE		0x01
> > +#define MCAP_INVALID_PARAM_VALUE	0x02
> > +#define MCAP_INVALID_MDEP		0x03
> > +#define MCAP_MDEP_BUSY			0x04
> > +#define MCAP_INVALID_MDL		0x05
> > +#define MCAP_MDL_BUSY			0x06
> > +#define MCAP_INVALID_OPERATION		0x07
> > +#define MCAP_RESOURCE_UNAVAILABLE	0x08
> > +#define MCAP_UNESPECIFIED_ERROR		0x09
> > +#define MCAP_REQUEST_NOT_SUPPORTED	0x0A
> > +#define MCAP_CONFIGURATION_REJECTED	0x0B
> > +/*RESERVED				0x0C-0xFF*/
> > +
> > +
> > +/* MDL IDs */
> > +#define MCAP_MDLID_RESERVED		0x0000
> > +#define MCAP_MDLID_INITIAL		0x0001
> > +#define MCAP_MDLID_FINAL		0xFEFF
> > +/*RESERVED				0xFF00-0xFFFE*/
> > +#define MCAP_ALL_MDLIDS			0xFFFF
> > +
> > +/* MDEP IDs */
> > +#define MCAP_MDEPID_INITIAL		0x00
> > +#define MCAP_MDEPID_FINAL		0x7F
> > +/*RESERVED				0x80-0xFF*/
> > +
> > +
> > +/*
> > + * MCAP Request Packet Format
> > + */
> > +
> > +typedef struct {
> > +	uint8_t         op;
> > +        uint16_t	mdl;
> > +	uint8_t		mdep;
> > +	uint8_t		conf;
> > +} __attribute__ ((packed)) mcap_md_create_mdl_req;
> > +
> > +typedef struct {
> > +        uint8_t         op;
> > +        uint16_t        mdl;
> > +} __attribute__ ((packed)) mcap_md_req;
> > +
> > +
> > +/*
> > + * MCAP Response Packet Format
> > + */
> > +
> > +typedef struct {
> > +        uint8_t         op;
> > +        uint8_t         rc;
> > +	uint16_t        mdl;
> > +} __attribute__ ((packed)) mcap4B_rsp;
> > +
> > +typedef struct {
> > +        uint8_t         op;
> > +        uint8_t         rc;
> > +        uint16_t        mdl;
> > +        uint8_t         param;
> > +} __attribute__ ((packed)) mcap5B_rsp;
> > +
> > +
> > +/*
> > + * MCAP Clock Synchronization Protocol
> > + */
> > +typedef struct {
> > +        uint8_t         op;
> > +        uint16_t        timest;
> > +} __attribute__ ((packed)) mcap_md_sync_cap_req;
> > +
> > +typedef struct {
> > +        uint8_t         op;
> > +	uint8_t         rc;
> > +	uint8_t         btclock;
> > +        uint16_t        sltime;
> > +	uint16_t        timestnr;
> > +	uint16_t        timestna;
> > +} __attribute__ ((packed)) mcap_md_sync_cap_rsp;
> > +
> > +typedef struct {
> > +        uint8_t         op;
> > +	uint8_t         timestui;
> > +        uint32_t        btclock;
> > +	uint64_t        timestst;
> > +} __attribute__ ((packed)) mcap_md_sync_set_req;
> > +
> > +typedef struct {
> > +        uint8_t         op;
> > +	uint8_t         rc;
> > +        uint32_t        btclock;
> > +	uint64_t        timestst;
> > +	uint16_t        timestsa;
> > +} __attribute__ ((packed)) mcap_md_sync_set_rsp;
> > +
> > +typedef struct {
> > +        uint8_t         op;
> > +        uint32_t        btclock;
> > +	uint64_t        timestst;
> > +	uint16_t        timestsa;
> > +} __attribute__ ((packed)) mcap_md_sync_info_ind;
> > +
> > +#ifdef __cplusplus
> > +}
> > +#endif
> > +
> > +#endif /* __MCAP_H */
> > diff --git a/mcap/mcap_internal.h b/mcap/mcap_internal.h
> > new file mode 100644
> > index 0000000..1e9f521
> > --- /dev/null
> > +++ b/mcap/mcap_internal.h
> > @@ -0,0 +1,118 @@
> > +/*
> > + *
> > + *  MCAP for BlueZ - Bluetooth protocol stack for Linux
> > + *
> > + *  Copyright (C) 2010 GSyC/LibreSoft, Universidad Rey Juan Carlos.
> > + *
> > + *  Authors:
> > + *  Santiago Carot-Nemesio <sancane at gmail.com>
> > + *  Jose Antonio Santos-Cadenas <santoscadenas at gmail.com>
> > + *
> > + *  This program is free software; you can redistribute it and/or modify
> > + *  it under the terms of the GNU General Public License as published by
> > + *  the Free Software Foundation; either version 2 of the License, or
> > + *  (at your option) any later version.
> > + *
> > + *  This program is distributed in the hope that it will be useful,
> > + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > + *  GNU General Public License for more details.
> > + *
> > + *  You should have received a copy of the GNU General Public License
> > + *  along with this program; if not, write to the Free Software
> > + *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
> > + *
> > + */
> > +
> > +#ifndef __MCAP_INTERNAL_H
> > +#define __MCAP_INTERNAL_H
> > +
> > +#ifdef __cplusplus
> > +extern "C" {
> > +#endif
> > +
> > +typedef enum {
> > +	MCL_CONNECTED,
> > +	MCL_PENDING,
> > +	MCL_ACTIVE,
> > +	MCL_IDLE
> > +} MCLState;
> > +
> > +typedef enum {
> > +	MCL_ACCEPTOR,
> > +	MCL_INITIATOR,
> > +} MCLRole;
> > +
> > +typedef enum {
> > +	MCL_AVAILABLE,
> > +	MCL_WAITING_RSP,
> > +} MCAPCtrl;
> > +
> > +typedef enum {
> > +	MDL_WAITING,
> > +	MDL_CONNECTED,
> > +	MDL_DELETING,
> > +	MDL_CLOSED,
> > +} MDLState;
> > +
> > +struct mcap_mdl_cb {
> > +	mcap_mdl_event_cb 		mdl_connected;	/* Remote device has created a mdl */
> > +	mcap_mdl_event_cb 		mdl_closed;	/* Remote device has closed a mdl */
> > +	mcap_mdl_event_cb 		mdl_deleted;	/* Remote device deletion of a mdl */
> > +	mcap_mdl_event_cb		mdl_aborted;	/* Remote device aborted the mdl creation */
> > +	mcap_remote_mdl_conn_req_cb	mdl_conn_req;	/* Remote deive requested a creation of a mdl */
> > +	mcap_remote_mdl_reconn_req_cb 	mdl_reconn_req;	/* Remote device requested reconnection of a mdl */
> > +	gpointer			user_data;	/* user data */
> > +};
> > +
> > +struct mcap_session {
> > +	bdaddr_t			src;			/* Source address */
> > +	GIOChannel			*ccio;			/* Control Channel IO */
> > +	GIOChannel			*dcio;			/* Data Channel IO */
> > +	GSList				*mcls;			/* MCAP session list */
> > +	GSList				*cached;		/* List with all cached MCLs (MAX_CACHED macro) */
> > +	BtIOSecLevel			sec;			/* Security level */
> > +	mcap_mcl_event_cb		mcl_connected_cb;	/* New MCL connected */
> > +	mcap_mcl_event_cb		mcl_reconnected_cb;	/* Old MCL has been reconnected */
> > +	mcap_mcl_event_cb		mcl_disconnected_cb;	/* MCL disconnected */
> > +	mcap_mcl_event_cb		mcl_uncached_cb;	/* MCL has been removed from MCAP cache */
> > +	gpointer			user_data;		/* Data to be provided in a callbacks */
> > +};
> > +
> > +struct mcap_mcl {
> > +	struct mcap_session	*ms;		/* MCAP session where this MCL belongs */
> > +	bdaddr_t		addr;		/* device address */
> > +	GIOChannel		*cc;		/* MCAP Control Channel IO */
> > +	guint			wid;		/* MCL Watcher id */
> > +	GSList			*mdls;		/* List of Data Channels shorted by mdlid */
> > +	MCLState		state;		/* current MCL State */
> > +	MCLRole			role;		/* initiator or aceptor of this MCL*/
> 
> typo aceptor -> acceptor
> 
> > +	MCAPCtrl		req;		/* Request control flag */
> > +	void			*priv_data;	/* Temporal data to manage responses */
> > +	struct mcap_mdl_cb	*cb;		/* MDL callbacks */
> > +	guint			tid;		/* Timer id for waiting for a resposne */
> 
> typo resposne -> response
> 
> > +	uint8_t			*lcmd;		/* Last command sent */
> > +	guint			ref;		/* References counter */
> > +	uint8_t			ctrl;		/* MCL control flag */
> > +};
> > +
> > +#define	MCAP_CTRL_CACHED	0x01	/* MCL is cached */
> > +#define	MCAP_CTRL_STD_OP	0x02	/* Support for standard op codes */
> > +#define	MCAP_CTRL_SYNC_OP	0x04	/* Support for synchronization commands */
> > +#define	MCAP_CTRL_CONN		0x08	/* MCL is in connectcting process */
> 
> typo connectcting -> connecting

Ok, next I'll send a patch to fix typo errors.

> 
> > +#define	MCAP_CTRL_FREE		0x10	/* MCL is marked as releasable */
> > +#define	MCAP_CTRL_NOCACHE	0x20	/* MCL is marked as not cacheable */
> > +
> > +struct mcap_mdl {
> > +	struct mcap_mcl		*mcl;		/* MCAP mcl for this mdl */
> > +	GIOChannel		*dc;		/* MCAP Data Channel IO */
> > +	guint			wid;		/* MDL Watcher id */
> > +	uint16_t		mdlid;		/* MDL id */
> > +	uint8_t			mdep_id;	/* MCAP Data End Point */
> > +	MDLState		state;		/* MDL state */
> > +};
> > +
> > +int mcap_send_data(int sock, const uint8_t *buf, uint32_t size);
> > +void proc_sync_cmd(struct mcap_mcl *mcl, uint8_t *cmd, uint32_t len);
> 
> 
> Marcel, Johan, Luiz, is ok such overstep of line 80 on the comments?
> 
> > +
> > +#endif /* __MCAP_INTERNAL_H */
> > diff --git a/mcap/mcap_lib.h b/mcap/mcap_lib.h
> > new file mode 100644
> > index 0000000..6fed1be
> > --- /dev/null
> > +++ b/mcap/mcap_lib.h
> > @@ -0,0 +1,163 @@
> > +/*
> > + *
> > + *  MCAP for BlueZ - Bluetooth protocol stack for Linux
> > + *
> > + *  Copyright (C) 2010 GSyC/LibreSoft, Universidad Rey Juan Carlos.
> > + *
> > + *  Authors:
> > + *  Santiago Carot-Nemesio <sancane at gmail.com>
> > + *  Jose Antonio Santos-Cadenas <santoscadenas at gmail.com>
> > + *
> > + *  This program is free software; you can redistribute it and/or modify
> > + *  it under the terms of the GNU General Public License as published by
> > + *  the Free Software Foundation; either version 2 of the License, or
> > + *  (at your option) any later version.
> > + *
> > + *  This program is distributed in the hope that it will be useful,
> > + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > + *  GNU General Public License for more details.
> > + *
> > + *  You should have received a copy of the GNU General Public License
> > + *  along with this program; if not, write to the Free Software
> > + *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
> > + *
> > + */
> > +
> > +#ifndef __MCAP_LIB_H
> > +#define __MCAP_LIB_H
> > +
> > +#ifdef __cplusplus
> > +extern "C" {
> > +#endif
> > +
> > +#include "adapter.h"
> > +
> > +#include <bluetooth/l2cap.h>
> > +#include "btio.h"
> > +
> > +typedef enum {
> > +/* MCAP Error Response Codes */
> > +	MCAP_ERROR_INVALID_OP_CODE = 1,
> > +	MCAP_ERROR_INVALID_PARAM_VALUE,
> > +	MCAP_ERROR_INVALID_MDEP,
> > +	MCAP_ERROR_MDEP_BUSY,
> > +	MCAP_ERROR_INVALID_MDL,
> > +	MCAP_ERROR_MDL_BUSY,
> > +	MCAP_ERROR_INVALID_OPERATION,
> > +	MCAP_ERROR_RESOURCE_UNAVAILABLE,
> > +	MCAP_ERROR_UNESPECIFIED_ERROR,
> > +	MCAP_ERROR_REQUEST_NOT_SUPPORTED,
> > +	MCAP_ERROR_CONFIGURATION_REJECTED,
> > +/* MCAP Internal Errors */
> > +	MCAP_ERROR_INVALID_ARGS,
> > +	MCAP_ERROR_ALREADY_EXISTS,
> > +	MCAP_ERROR_FAILED,
> > +} McapError;
> > +
> > +typedef enum {
> > +	MCAP_MDL_CB_INVALID,
> > +	MCAP_MDL_CB_CONNECTED,		/* mcap_mdl_event_cb */
> > +	MCAP_MDL_CB_CLOSED,		/* mcap_mdl_event_cb */
> > +	MCAP_MDL_CB_DELETED,		/* mcap_mdl_event_cb */
> > +	MCAP_MDL_CB_ABORTED,		/* mcap_mdl_event_cb */
> > +	MCAP_MDL_CB_REMOTE_CONN_REQ,	/* mcap_remote_mdl_conn_req_cb */
> > +	MCAP_MDL_CB_REMOTE_RECONN_REQ,	/* mcap_remote_mdl_reconn_req_cb */
> > +} McapMclCb;
> > +
> > +struct mcap_session;
> > +struct mcap_mcl;
> > +struct mcap_mdl;
> > +
> > +/************ Callbacks ************/
> > +
> > +/* mdl callbacks */
> > +
> > +typedef void (* mcap_mdl_event_cb) (struct mcap_mdl *mdl, gpointer data);
> > +typedef void (* mcap_mdl_operation_conf_cb) (struct mcap_mdl *mdl, uint8_t conf,
> > +						GError *err, gpointer data);
> > +typedef void (* mcap_mdl_operation_cb) (struct mcap_mdl *mdl, GError *err,
> > +						gpointer data);
> > +typedef void (* mcap_mdl_del_cb) (GError *err, gpointer data);
> > +
> > +/* Next function should return an MCAP appropiate response code */
> > +typedef uint8_t (* mcap_remote_mdl_conn_req_cb) (struct mcap_mcl *mcl,
> > +						uint8_t mdepid, uint16_t mdlid,
> > +						uint8_t *conf, gpointer data);
> > +typedef uint8_t (* mcap_remote_mdl_reconn_req_cb) (struct mcap_mdl *mdl,
> > +						gpointer data);
> > +
> > +/* mcl callbacks */
> > +
> > +typedef void (* mcap_mcl_event_cb) (struct mcap_mcl *mcl, gpointer data);
> > +typedef void (* mcap_mcl_connect_cb) (struct mcap_mcl *mcl, GError *err,
> > +								gpointer data);
> > +
> > +/************ Operations ************/
> > +
> > +/* Mdl operations*/
> > +
> > +void mcap_req_mdl_creation(struct mcap_mcl *mcl,
> > +				uint8_t mdepid,
> > +				uint8_t conf,
> > +				GError **err,
> > +				mcap_mdl_operation_conf_cb connect_cb,
> > +				gpointer user_data);
> > +void mcap_req_mdl_reconnect(struct mcap_mdl *mdl, GError **err,
> > +				mcap_mdl_operation_cb reconnect_cb,
> > +				gpointer user_data);
> > +void mcap_req_mdl_delete_all(struct mcap_mcl *mcl, GError **err,
> > +			mcap_mdl_del_cb delete_cb, gpointer user_data);
> > +void mcap_req_mdl_deletion(struct mcap_mdl *mdl, GError **err,
> > +			mcap_mdl_del_cb delete_cb, gpointer user_data);
> > +void mcap_mdl_connect(struct mcap_mdl *mdl,
> > +			BtIOType BtType,
> > +			uint16_t dcpsm,
> > +			GError **err,
> > +			mcap_mdl_operation_cb connect_cb,
> > +			gpointer user_data);
> > +void mcap_mdl_abort(struct mcap_mdl *mdl, GError **err,
> > +			mcap_mdl_del_cb abort_cb, gpointer user_data);
> > +
> > +int mcap_mdl_get_fd(struct mcap_mdl *mdl);
> > +uint16_t mcap_mdl_get_mdlid(struct mcap_mdl *mdl);
> > +
> > +/* Mcl operations*/
> > +
> > +void mcap_create_mcl(struct mcap_session *ms,
> > +				const bdaddr_t *addr,
> > +				uint16_t ccpsm,
> > +				GError **err,
> > +				mcap_mcl_connect_cb connect_cb,
> > +				gpointer user_data);
> > +void mcap_close_mcl(struct mcap_mcl *mcl, gboolean cache);
> > +void mcap_mcl_set_cb(struct mcap_mcl *mcl, GError **gerr,
> > +					gpointer user_data, McapMclCb cb1, ...);
> > +bdaddr_t mcap_mcl_get_addr(struct mcap_mcl *mcl);
> > +
> > +struct mcap_mcl *mcap_mcl_ref(struct mcap_mcl *mcl);
> > +void mcap_mcl_unref(struct mcap_mcl *mcl);
> > +
> > +/* MCAP main operations */
> > +
> > +struct mcap_session *mcap_create_session(struct btd_adapter *btd_adapter,
> > +					BtIOSecLevel sec, uint16_t ccpsm,
> > +					uint16_t dcpsm,
> > +					GError **gerr,
> > +					mcap_mcl_event_cb mcl_connected,
> > +					mcap_mcl_event_cb mcl_reconnected,
> > +					mcap_mcl_event_cb mcl_disconnected,
> > +					mcap_mcl_event_cb mcl_uncached,
> > +					gpointer user_data);
> > +
> > +void mcap_close_session(struct mcap_session *ms);
> > +
> > +uint16_t mcap_get_ctrl_psm(struct mcap_session *ms, GError **err);
> > +uint16_t mcap_get_data_psm(struct mcap_session *ms, GError **err);
> > +
> > +#ifdef __cplusplus
> > +}
> > +#endif
> > +
> > +#endif /* __MCAP_LIB_H */
> > +
> > -- 
> > 1.6.3.3
> > 
> > --

Thanks in advance for you comments.

> > To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 



^ permalink raw reply

* Re: [PATCH 25/25] Initial support for clock synchronization protocol
From: Gustavo F. Padovan @ 2010-05-11  5:52 UTC (permalink / raw)
  To: Santiago Carot-Nemesio; +Cc: linux-bluetooth
In-Reply-To: <1273486527-7855-25-git-send-email-sancane@gmail.com>

Ho Santiago,

* Santiago Carot-Nemesio <sancane@gmail.com> [2010-05-10 12:15:27 +0200]:

> From: Santiago Carot Nemesio <sancane@gmail.com>
> 
> ---
>  Makefile.am |    4 +-
>  mcap/mcap.c |    2 +-
>  mcap/sync.c |   84 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 87 insertions(+), 3 deletions(-)
>  create mode 100644 mcap/sync.c
> 
> diff --git a/Makefile.am b/Makefile.am
> index 7d8f4b5..98dacdf 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -170,8 +170,8 @@ builtin_sources += plugins/service.c
>  endif
>  
>  if MCAP
> -mcap_sources += mcap/mcap_lib.h \
> -		mcap/mcap_internal.h \
> +mcap_sources += mcap/mcap_internal.h \
> +		mcap/mcap_lib.h mcap/sync.c \
>  		mcap/mcap.h mcap/mcap.c
>  endif
>  
> diff --git a/mcap/mcap.c b/mcap/mcap.c
> index a292dcd..0fd5b97 100644
> --- a/mcap/mcap.c
> +++ b/mcap/mcap.c
> @@ -1500,7 +1500,7 @@ static void rsend_req(struct mcap_mcl *mcl)
>  static void proc_cmd(struct mcap_mcl *mcl, uint8_t *cmd, uint32_t len)
>  {
>  	if ((cmd[0] >= MCAP_MD_SYNC_CAP_REQ) && (cmd[0] <= MCAP_MD_SYNC_INFO_IND)) {
> -		send4B_cmd(mcl, cmd[0], MCAP_REQUEST_NOT_SUPPORTED, MCAP_MDLID_RESERVED);
> +		proc_sync_cmd(mcl, cmd, len);
>  		return;
>  	}
>  
> diff --git a/mcap/sync.c b/mcap/sync.c
> new file mode 100644
> index 0000000..ede125a
> --- /dev/null
> +++ b/mcap/sync.c
> @@ -0,0 +1,84 @@
> +/*
> + *
> + *  MCAP for BlueZ - Bluetooth protocol stack for Linux
> + *
> + *  Copyright (C) 2010 GSyC/LibreSoft, Universidad Rey Juan Carlos.
> + *
> + *  Authors:
> + *  Santiago Carot-Nemesio <sancane at gmail.com>
> + *  Jose Antonio Santos-Cadenas <santoscadenas at gmail.com>
> + *
> + *  This program is free software; you can redistribute it and/or modify
> + *  it under the terms of the GNU General Public License as published by
> + *  the Free Software Foundation; either version 2 of the License, or
> + *  (at your option) any later version.
> + *
> + *  This program is distributed in the hope that it will be useful,
> + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
> + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + *  GNU General Public License for more details.
> + *
> + *  You should have received a copy of the GNU General Public License
> + *  along with this program; if not, write to the Free Software
> + *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
> + *
> + */
> +
> +#include <stdint.h>
> +#include <netinet/in.h>
> +
> +#include "logging.h"
> +
> +#include "mcap.h"
> +#include "mcap_lib.h"
> +#include "mcap_internal.h"
> +
> +static int send_unsupported_req(struct mcap_mcl *mcl, uint8_t oc)
> +{
> +	uint8_t *rsp;
> +	mcap4B_rsp *rsp_err;
> +	int sent;
> +
> +
> +	rsp = g_malloc0(sizeof(mcap4B_rsp));
> +
> +	rsp_err = (mcap4B_rsp *)rsp;
> +	rsp_err->op = oc;
> +	rsp_err->rc = MCAP_REQUEST_NOT_SUPPORTED;
> +	rsp_err->mdl = htons (MCAP_MDLID_RESERVED);
> +
> +	sent = mcap_send_data(g_io_channel_unix_get_fd(mcl->cc),
> +					rsp,
> +					sizeof(mcap4B_rsp));
> +	g_free(rsp);
> +	return sent;
> +}
> +
> +void proc_sync_cmd(struct mcap_mcl *mcl, uint8_t *cmd, uint32_t len)
> +{
> +	switch (cmd[0]) {
> +	case MCAP_MD_SYNC_CAP_REQ:
> +		debug("TODO: received MCAP_MD_SYNC_CAP_REQ: %d",
> +							MCAP_MD_SYNC_CAP_REQ);
> +		break;
> +	case MCAP_MD_SYNC_CAP_RSP:
> +		debug("TODO: received MCAP_MD_SYNC_CAP_RSP: %d",
> +							MCAP_MD_SYNC_CAP_RSP);
> +		break;
> +	case MCAP_MD_SYNC_SET_REQ:
> +		debug("TODO: received MCAP_MD_SYNC_SET_REQ: %d",
> +							MCAP_MD_SYNC_SET_REQ);
> +		break;
> +	case MCAP_MD_SYNC_SET_RSP:
> +		debug("TODO: received MCAP_MD_SYNC_SET_RSP: %d",
> +							MCAP_MD_SYNC_SET_RSP);
> +		break;
> +	case MCAP_MD_SYNC_INFO_IND:
> +		debug("TODO: received MCAP_MD_SYNC_INFO_IND :%d",
> +							MCAP_MD_SYNC_INFO_IND);
> +		break;
> +	}
> +
> +	/* Not implemented yet. Reply with unsupported request */
> +        send_unsupported_req(mcl, cmd[0]);
> +}

How are you thinking to handle the Clock Sync Protocol? It has to sync
time with other Bluetooth devices, so I guess it needs some real time
priority to run, doesn't it? Or Am I wrong?

-- 
Gustavo F. Padovan
http://padovan.org

^ permalink raw reply

* Re: [PATCH 01/25] Initial support for MCAP
From: Gustavo F. Padovan @ 2010-05-11  4:11 UTC (permalink / raw)
  To: Santiago Carot-Nemesio; +Cc: linux-bluetooth
In-Reply-To: <1273486527-7855-1-git-send-email-sancane@gmail.com>

Hi Santiago,

* Santiago Carot-Nemesio <sancane@gmail.com> [2010-05-10 12:15:03 +0200]:

> From: Santiago Carot Nemesio <sancane@gmail.com>
> 
> ---
>  Makefile.am          |   13 ++++-
>  acinclude.m4         |    6 ++
>  mcap/mcap.c          |   55 ++++++++++++++++
>  mcap/mcap.h          |  176 ++++++++++++++++++++++++++++++++++++++++++++++++++
>  mcap/mcap_internal.h |  118 +++++++++++++++++++++++++++++++++
>  mcap/mcap_lib.h      |  163 ++++++++++++++++++++++++++++++++++++++++++++++
>  6 files changed, 530 insertions(+), 1 deletions(-)
>  create mode 100644 mcap/mcap.c
>  create mode 100644 mcap/mcap.h
>  create mode 100644 mcap/mcap_internal.h
>  create mode 100644 mcap/mcap_lib.h

Applying this one with git am I get this:

Applying: Initial support for MCAP
/home/padovan/p/bluez/.git/rebase-apply/patch:462: new blank line at
EOF.
+
warning: 1 line adds whitespace errors.



> 
> diff --git a/Makefile.am b/Makefile.am
> index f991121..7d8f4b5 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -101,6 +101,7 @@ gdbus_sources = gdbus/gdbus.h gdbus/mainloop.c gdbus/object.c gdbus/watch.c
>  builtin_modules =
>  builtin_sources =
>  builtin_nodist =
> +mcap_sources =
>  
>  if PNATPLUGIN
>  builtin_modules += pnat
> @@ -168,6 +169,12 @@ builtin_modules += service
>  builtin_sources += plugins/service.c
>  endif
>  
> +if MCAP
> +mcap_sources += mcap/mcap_lib.h \
> +		mcap/mcap_internal.h \
> +		mcap/mcap.h mcap/mcap.c

Why are you not using builtin_sources here?

> +endif
> +
>  builtin_modules += hciops
>  builtin_sources += plugins/hciops.c
>  
> @@ -196,7 +203,8 @@ src_bluetoothd_SOURCES = $(gdbus_sources) $(builtin_sources) \
>  			src/adapter.h src/adapter.c \
>  			src/device.h src/device.c \
>  			src/dbus-common.c src/dbus-common.h \
> -			src/dbus-hci.h src/dbus-hci.c
> +			src/dbus-hci.h src/dbus-hci.c \
> +			$(mcap_sources)
>  src_bluetoothd_LDADD = lib/libbluetooth.la @GLIB_LIBS@ @DBUS_LIBS@ \
>  							@CAPNG_LIBS@ -ldl
>  src_bluetoothd_LDFLAGS = -Wl,--export-dynamic \
> @@ -318,6 +326,9 @@ AM_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ @CAPNG_CFLAGS@ \
>  INCLUDES = -I$(builddir)/lib -I$(builddir)/src -I$(srcdir)/src \
>  			-I$(srcdir)/audio -I$(srcdir)/sbc -I$(srcdir)/gdbus
>  
> +if MCAP
> +INCLUDES += -I$(builddir)/mcap
> +endif

Why only MCAP has a separated if for INCLUDES?

>  
>  pkgconfigdir = $(libdir)/pkgconfig
>  
> diff --git a/acinclude.m4 b/acinclude.m4
> index f7bb047..b512cfb 100644
> --- a/acinclude.m4
> +++ b/acinclude.m4
> @@ -167,6 +167,7 @@ AC_DEFUN([AC_ARG_BLUEZ], [
>  	serial_enable=yes
>  	network_enable=yes
>  	service_enable=yes
> +	mcap_enable=no
>  	pnat_enable=no
>  	tracer_enable=no
>  	tools_enable=yes
> @@ -215,6 +216,10 @@ AC_DEFUN([AC_ARG_BLUEZ], [
>  		service_enable=${enableval}
>  	])
>  
> +	AC_ARG_ENABLE(mcap, AC_HELP_STRING([--enable-mcap], [enable mcap support]), [
> +			mcap_enable=${enableval}
> +	])
> +
>  	AC_ARG_ENABLE(pnat, AC_HELP_STRING([--enable-pnat], [enable pnat plugin]), [
>  		pnat_enable=${enableval}
>  	])
> @@ -325,6 +330,7 @@ AC_DEFUN([AC_ARG_BLUEZ], [
>  	AM_CONDITIONAL(SERIALPLUGIN, test "${serial_enable}" = "yes")
>  	AM_CONDITIONAL(NETWORKPLUGIN, test "${network_enable}" = "yes")
>  	AM_CONDITIONAL(SERVICEPLUGIN, test "${service_enable}" = "yes")
> +	AM_CONDITIONAL(MCAP, test "${mcap_enable}" = "yes")
>  	AM_CONDITIONAL(ECHOPLUGIN, test "no" = "yes")
>  	AM_CONDITIONAL(PNATPLUGIN, test "${pnat_enable}" = "yes")
>  	AM_CONDITIONAL(TRACER, test "${tracer_enable}" = "yes")
> diff --git a/mcap/mcap.c b/mcap/mcap.c
> new file mode 100644
> index 0000000..df8dd50
> --- /dev/null
> +++ b/mcap/mcap.c
> @@ -0,0 +1,55 @@
> +/*
> + *
> + *  MCAP for BlueZ - Bluetooth protocol stack for Linux
> + *
> + *  Copyright (C) 2010 GSyC/LibreSoft, Universidad Rey Juan Carlos.
> + *
> + *  Authors:
> + *  Santiago Carot-Nemesio <sancane at gmail.com>
> + *  Jose Antonio Santos-Cadenas <santoscadenas at gmail.com>
> + *
> + *  This program is free software; you can redistribute it and/or modify
> + *  it under the terms of the GNU General Public License as published by
> + *  the Free Software Foundation; either version 2 of the License, or
> + *  (at your option) any later version.
> + *
> + *  This program is distributed in the hope that it will be useful,
> + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
> + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + *  GNU General Public License for more details.
> + *
> + *  You should have received a copy of the GNU General Public License
> + *  along with this program; if not, write to the Free Software
> + *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
> + *
> + */
> +
> +#include "logging.h"
> +#include "btio.h"
> +#include "error.h"
> +
> +#include <netinet/in.h>
> +
> +#include "mcap.h"
> +#include "mcap_lib.h"
> +#include "mcap_internal.h"
> +
> +struct mcap_session *mcap_create_session(struct btd_adapter *btd_adapter,
> +					BtIOSecLevel sec,
> +					uint16_t ccpsm,
> +					uint16_t dcpsm,
> +					GError **gerr,
> +					mcap_mcl_event_cb mcl_connected,
> +					mcap_mcl_event_cb mcl_reconnected,
> +					mcap_mcl_event_cb mcl_disconnected,
> +					mcap_mcl_event_cb mcl_uncached,
> +					gpointer user_data)
> +{
> +	/* TODO: Create MCAP Session */
> +	return NULL;
> +}
> +
> +void mcap_close_session(struct mcap_session *ms)
> +{
> +	/* Free MCAP session */
> +}
> diff --git a/mcap/mcap.h b/mcap/mcap.h
> new file mode 100644
> index 0000000..598e6ce
> --- /dev/null
> +++ b/mcap/mcap.h
> @@ -0,0 +1,176 @@
> +/*
> + *
> + *  MCAP for BlueZ - Bluetooth protocol stack for Linux
> + *
> + *  Copyright (C) 2010 GSyC/LibreSoft, Universidad Rey Juan Carlos.
> + *
> + *  Authors:
> + *  Santiago Carot-Nemesio <sancane at gmail.com>
> + *  Jose Antonio Santos-Cadenas <santoscadenas at gmail.com>
> + *
> + *  This program is free software; you can redistribute it and/or modify
> + *  it under the terms of the GNU General Public License as published by
> + *  the Free Software Foundation; either version 2 of the License, or
> + *  (at your option) any later version.
> + *
> + *  This program is distributed in the hope that it will be useful,
> + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
> + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + *  GNU General Public License for more details.
> + *
> + *  You should have received a copy of the GNU General Public License
> + *  along with this program; if not, write to the Free Software
> + *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
> + *
> + */
> +
> +#ifndef __MCAP_H
> +#define __MCAP_H
> +
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
> +
> +#define MCAP_VERSION	0x0100	/* current version 01.00 */
> +
> +/* bytes to get MCAP Supported Procedures */
> +#define MCAP_SUP_PROC	0x06
> +
> +/* maximum transmission unit for channels */
> +#define MCAP_CC_MTU	48
> +#define MCAP_DC_MTU	L2CAP_DEFAULT_MTU
> +
> +
> +/* MCAP Standard Op Codes */
> +#define MCAP_ERROR_RSP			0x00
> +#define MCAP_MD_CREATE_MDL_REQ		0x01
> +#define MCAP_MD_CREATE_MDL_RSP		0x02
> +#define MCAP_MD_RECONNECT_MDL_REQ	0x03
> +#define MCAP_MD_RECONNECT_MDL_RSP	0x04
> +#define MCAP_MD_ABORT_MDL_REQ		0x05
> +#define MCAP_MD_ABORT_MDL_RSP		0x06
> +#define MCAP_MD_DELETE_MDL_REQ		0x07
> +#define MCAP_MD_DELETE_MDL_RSP		0x08
> +/*RESERVED                              0x09*/
> +/*RESERVED                              0x10*/

No need for such RESERVED comments.

> +
> +/* MCAP Clock Sync Op Codes */
> +#define MCAP_MD_SYNC_CAP_REQ		0x11
> +#define MCAP_MD_SYNC_CAP_RSP		0x12
> +#define MCAP_MD_SYNC_SET_REQ		0x13
> +#define MCAP_MD_SYNC_SET_RSP            0x14
> +#define MCAP_MD_SYNC_INFO_IND		0x15
> +/*RESERVED				0x16*/
> +/*RESERVED                              0x17*/
> +/*RESERVED                              0x18*/
> +/*RESERVED                              0x19*/
> +/*RESERVED                              0x20*/
> +
> +/* MCAP Response codes */
> +#define MCAP_SUCCESS			0x00
> +#define MCAP_INVALID_OP_CODE		0x01
> +#define MCAP_INVALID_PARAM_VALUE	0x02
> +#define MCAP_INVALID_MDEP		0x03
> +#define MCAP_MDEP_BUSY			0x04
> +#define MCAP_INVALID_MDL		0x05
> +#define MCAP_MDL_BUSY			0x06
> +#define MCAP_INVALID_OPERATION		0x07
> +#define MCAP_RESOURCE_UNAVAILABLE	0x08
> +#define MCAP_UNESPECIFIED_ERROR		0x09
> +#define MCAP_REQUEST_NOT_SUPPORTED	0x0A
> +#define MCAP_CONFIGURATION_REJECTED	0x0B
> +/*RESERVED				0x0C-0xFF*/
> +
> +
> +/* MDL IDs */
> +#define MCAP_MDLID_RESERVED		0x0000
> +#define MCAP_MDLID_INITIAL		0x0001
> +#define MCAP_MDLID_FINAL		0xFEFF
> +/*RESERVED				0xFF00-0xFFFE*/
> +#define MCAP_ALL_MDLIDS			0xFFFF
> +
> +/* MDEP IDs */
> +#define MCAP_MDEPID_INITIAL		0x00
> +#define MCAP_MDEPID_FINAL		0x7F
> +/*RESERVED				0x80-0xFF*/
> +
> +
> +/*
> + * MCAP Request Packet Format
> + */
> +
> +typedef struct {
> +	uint8_t         op;
> +        uint16_t	mdl;
> +	uint8_t		mdep;
> +	uint8_t		conf;
> +} __attribute__ ((packed)) mcap_md_create_mdl_req;
> +
> +typedef struct {
> +        uint8_t         op;
> +        uint16_t        mdl;
> +} __attribute__ ((packed)) mcap_md_req;
> +
> +
> +/*
> + * MCAP Response Packet Format
> + */
> +
> +typedef struct {
> +        uint8_t         op;
> +        uint8_t         rc;
> +	uint16_t        mdl;
> +} __attribute__ ((packed)) mcap4B_rsp;
> +
> +typedef struct {
> +        uint8_t         op;
> +        uint8_t         rc;
> +        uint16_t        mdl;
> +        uint8_t         param;
> +} __attribute__ ((packed)) mcap5B_rsp;
> +
> +
> +/*
> + * MCAP Clock Synchronization Protocol
> + */
> +typedef struct {
> +        uint8_t         op;
> +        uint16_t        timest;
> +} __attribute__ ((packed)) mcap_md_sync_cap_req;
> +
> +typedef struct {
> +        uint8_t         op;
> +	uint8_t         rc;
> +	uint8_t         btclock;
> +        uint16_t        sltime;
> +	uint16_t        timestnr;
> +	uint16_t        timestna;
> +} __attribute__ ((packed)) mcap_md_sync_cap_rsp;
> +
> +typedef struct {
> +        uint8_t         op;
> +	uint8_t         timestui;
> +        uint32_t        btclock;
> +	uint64_t        timestst;
> +} __attribute__ ((packed)) mcap_md_sync_set_req;
> +
> +typedef struct {
> +        uint8_t         op;
> +	uint8_t         rc;
> +        uint32_t        btclock;
> +	uint64_t        timestst;
> +	uint16_t        timestsa;
> +} __attribute__ ((packed)) mcap_md_sync_set_rsp;
> +
> +typedef struct {
> +        uint8_t         op;
> +        uint32_t        btclock;
> +	uint64_t        timestst;
> +	uint16_t        timestsa;
> +} __attribute__ ((packed)) mcap_md_sync_info_ind;
> +
> +#ifdef __cplusplus
> +}
> +#endif
> +
> +#endif /* __MCAP_H */
> diff --git a/mcap/mcap_internal.h b/mcap/mcap_internal.h
> new file mode 100644
> index 0000000..1e9f521
> --- /dev/null
> +++ b/mcap/mcap_internal.h
> @@ -0,0 +1,118 @@
> +/*
> + *
> + *  MCAP for BlueZ - Bluetooth protocol stack for Linux
> + *
> + *  Copyright (C) 2010 GSyC/LibreSoft, Universidad Rey Juan Carlos.
> + *
> + *  Authors:
> + *  Santiago Carot-Nemesio <sancane at gmail.com>
> + *  Jose Antonio Santos-Cadenas <santoscadenas at gmail.com>
> + *
> + *  This program is free software; you can redistribute it and/or modify
> + *  it under the terms of the GNU General Public License as published by
> + *  the Free Software Foundation; either version 2 of the License, or
> + *  (at your option) any later version.
> + *
> + *  This program is distributed in the hope that it will be useful,
> + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
> + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + *  GNU General Public License for more details.
> + *
> + *  You should have received a copy of the GNU General Public License
> + *  along with this program; if not, write to the Free Software
> + *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
> + *
> + */
> +
> +#ifndef __MCAP_INTERNAL_H
> +#define __MCAP_INTERNAL_H
> +
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
> +
> +typedef enum {
> +	MCL_CONNECTED,
> +	MCL_PENDING,
> +	MCL_ACTIVE,
> +	MCL_IDLE
> +} MCLState;
> +
> +typedef enum {
> +	MCL_ACCEPTOR,
> +	MCL_INITIATOR,
> +} MCLRole;
> +
> +typedef enum {
> +	MCL_AVAILABLE,
> +	MCL_WAITING_RSP,
> +} MCAPCtrl;
> +
> +typedef enum {
> +	MDL_WAITING,
> +	MDL_CONNECTED,
> +	MDL_DELETING,
> +	MDL_CLOSED,
> +} MDLState;
> +
> +struct mcap_mdl_cb {
> +	mcap_mdl_event_cb 		mdl_connected;	/* Remote device has created a mdl */
> +	mcap_mdl_event_cb 		mdl_closed;	/* Remote device has closed a mdl */
> +	mcap_mdl_event_cb 		mdl_deleted;	/* Remote device deletion of a mdl */
> +	mcap_mdl_event_cb		mdl_aborted;	/* Remote device aborted the mdl creation */
> +	mcap_remote_mdl_conn_req_cb	mdl_conn_req;	/* Remote deive requested a creation of a mdl */
> +	mcap_remote_mdl_reconn_req_cb 	mdl_reconn_req;	/* Remote device requested reconnection of a mdl */
> +	gpointer			user_data;	/* user data */
> +};
> +
> +struct mcap_session {
> +	bdaddr_t			src;			/* Source address */
> +	GIOChannel			*ccio;			/* Control Channel IO */
> +	GIOChannel			*dcio;			/* Data Channel IO */
> +	GSList				*mcls;			/* MCAP session list */
> +	GSList				*cached;		/* List with all cached MCLs (MAX_CACHED macro) */
> +	BtIOSecLevel			sec;			/* Security level */
> +	mcap_mcl_event_cb		mcl_connected_cb;	/* New MCL connected */
> +	mcap_mcl_event_cb		mcl_reconnected_cb;	/* Old MCL has been reconnected */
> +	mcap_mcl_event_cb		mcl_disconnected_cb;	/* MCL disconnected */
> +	mcap_mcl_event_cb		mcl_uncached_cb;	/* MCL has been removed from MCAP cache */
> +	gpointer			user_data;		/* Data to be provided in a callbacks */
> +};
> +
> +struct mcap_mcl {
> +	struct mcap_session	*ms;		/* MCAP session where this MCL belongs */
> +	bdaddr_t		addr;		/* device address */
> +	GIOChannel		*cc;		/* MCAP Control Channel IO */
> +	guint			wid;		/* MCL Watcher id */
> +	GSList			*mdls;		/* List of Data Channels shorted by mdlid */
> +	MCLState		state;		/* current MCL State */
> +	MCLRole			role;		/* initiator or aceptor of this MCL*/

typo aceptor -> acceptor

> +	MCAPCtrl		req;		/* Request control flag */
> +	void			*priv_data;	/* Temporal data to manage responses */
> +	struct mcap_mdl_cb	*cb;		/* MDL callbacks */
> +	guint			tid;		/* Timer id for waiting for a resposne */

typo resposne -> response

> +	uint8_t			*lcmd;		/* Last command sent */
> +	guint			ref;		/* References counter */
> +	uint8_t			ctrl;		/* MCL control flag */
> +};
> +
> +#define	MCAP_CTRL_CACHED	0x01	/* MCL is cached */
> +#define	MCAP_CTRL_STD_OP	0x02	/* Support for standard op codes */
> +#define	MCAP_CTRL_SYNC_OP	0x04	/* Support for synchronization commands */
> +#define	MCAP_CTRL_CONN		0x08	/* MCL is in connectcting process */

typo connectcting -> connecting

> +#define	MCAP_CTRL_FREE		0x10	/* MCL is marked as releasable */
> +#define	MCAP_CTRL_NOCACHE	0x20	/* MCL is marked as not cacheable */
> +
> +struct mcap_mdl {
> +	struct mcap_mcl		*mcl;		/* MCAP mcl for this mdl */
> +	GIOChannel		*dc;		/* MCAP Data Channel IO */
> +	guint			wid;		/* MDL Watcher id */
> +	uint16_t		mdlid;		/* MDL id */
> +	uint8_t			mdep_id;	/* MCAP Data End Point */
> +	MDLState		state;		/* MDL state */
> +};
> +
> +int mcap_send_data(int sock, const uint8_t *buf, uint32_t size);
> +void proc_sync_cmd(struct mcap_mcl *mcl, uint8_t *cmd, uint32_t len);


Marcel, Johan, Luiz, is ok such overstep of line 80 on the comments?

> +
> +#endif /* __MCAP_INTERNAL_H */
> diff --git a/mcap/mcap_lib.h b/mcap/mcap_lib.h
> new file mode 100644
> index 0000000..6fed1be
> --- /dev/null
> +++ b/mcap/mcap_lib.h
> @@ -0,0 +1,163 @@
> +/*
> + *
> + *  MCAP for BlueZ - Bluetooth protocol stack for Linux
> + *
> + *  Copyright (C) 2010 GSyC/LibreSoft, Universidad Rey Juan Carlos.
> + *
> + *  Authors:
> + *  Santiago Carot-Nemesio <sancane at gmail.com>
> + *  Jose Antonio Santos-Cadenas <santoscadenas at gmail.com>
> + *
> + *  This program is free software; you can redistribute it and/or modify
> + *  it under the terms of the GNU General Public License as published by
> + *  the Free Software Foundation; either version 2 of the License, or
> + *  (at your option) any later version.
> + *
> + *  This program is distributed in the hope that it will be useful,
> + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
> + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + *  GNU General Public License for more details.
> + *
> + *  You should have received a copy of the GNU General Public License
> + *  along with this program; if not, write to the Free Software
> + *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
> + *
> + */
> +
> +#ifndef __MCAP_LIB_H
> +#define __MCAP_LIB_H
> +
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
> +
> +#include "adapter.h"
> +
> +#include <bluetooth/l2cap.h>
> +#include "btio.h"
> +
> +typedef enum {
> +/* MCAP Error Response Codes */
> +	MCAP_ERROR_INVALID_OP_CODE = 1,
> +	MCAP_ERROR_INVALID_PARAM_VALUE,
> +	MCAP_ERROR_INVALID_MDEP,
> +	MCAP_ERROR_MDEP_BUSY,
> +	MCAP_ERROR_INVALID_MDL,
> +	MCAP_ERROR_MDL_BUSY,
> +	MCAP_ERROR_INVALID_OPERATION,
> +	MCAP_ERROR_RESOURCE_UNAVAILABLE,
> +	MCAP_ERROR_UNESPECIFIED_ERROR,
> +	MCAP_ERROR_REQUEST_NOT_SUPPORTED,
> +	MCAP_ERROR_CONFIGURATION_REJECTED,
> +/* MCAP Internal Errors */
> +	MCAP_ERROR_INVALID_ARGS,
> +	MCAP_ERROR_ALREADY_EXISTS,
> +	MCAP_ERROR_FAILED,
> +} McapError;
> +
> +typedef enum {
> +	MCAP_MDL_CB_INVALID,
> +	MCAP_MDL_CB_CONNECTED,		/* mcap_mdl_event_cb */
> +	MCAP_MDL_CB_CLOSED,		/* mcap_mdl_event_cb */
> +	MCAP_MDL_CB_DELETED,		/* mcap_mdl_event_cb */
> +	MCAP_MDL_CB_ABORTED,		/* mcap_mdl_event_cb */
> +	MCAP_MDL_CB_REMOTE_CONN_REQ,	/* mcap_remote_mdl_conn_req_cb */
> +	MCAP_MDL_CB_REMOTE_RECONN_REQ,	/* mcap_remote_mdl_reconn_req_cb */
> +} McapMclCb;
> +
> +struct mcap_session;
> +struct mcap_mcl;
> +struct mcap_mdl;
> +
> +/************ Callbacks ************/
> +
> +/* mdl callbacks */
> +
> +typedef void (* mcap_mdl_event_cb) (struct mcap_mdl *mdl, gpointer data);
> +typedef void (* mcap_mdl_operation_conf_cb) (struct mcap_mdl *mdl, uint8_t conf,
> +						GError *err, gpointer data);
> +typedef void (* mcap_mdl_operation_cb) (struct mcap_mdl *mdl, GError *err,
> +						gpointer data);
> +typedef void (* mcap_mdl_del_cb) (GError *err, gpointer data);
> +
> +/* Next function should return an MCAP appropiate response code */
> +typedef uint8_t (* mcap_remote_mdl_conn_req_cb) (struct mcap_mcl *mcl,
> +						uint8_t mdepid, uint16_t mdlid,
> +						uint8_t *conf, gpointer data);
> +typedef uint8_t (* mcap_remote_mdl_reconn_req_cb) (struct mcap_mdl *mdl,
> +						gpointer data);
> +
> +/* mcl callbacks */
> +
> +typedef void (* mcap_mcl_event_cb) (struct mcap_mcl *mcl, gpointer data);
> +typedef void (* mcap_mcl_connect_cb) (struct mcap_mcl *mcl, GError *err,
> +								gpointer data);
> +
> +/************ Operations ************/
> +
> +/* Mdl operations*/
> +
> +void mcap_req_mdl_creation(struct mcap_mcl *mcl,
> +				uint8_t mdepid,
> +				uint8_t conf,
> +				GError **err,
> +				mcap_mdl_operation_conf_cb connect_cb,
> +				gpointer user_data);
> +void mcap_req_mdl_reconnect(struct mcap_mdl *mdl, GError **err,
> +				mcap_mdl_operation_cb reconnect_cb,
> +				gpointer user_data);
> +void mcap_req_mdl_delete_all(struct mcap_mcl *mcl, GError **err,
> +			mcap_mdl_del_cb delete_cb, gpointer user_data);
> +void mcap_req_mdl_deletion(struct mcap_mdl *mdl, GError **err,
> +			mcap_mdl_del_cb delete_cb, gpointer user_data);
> +void mcap_mdl_connect(struct mcap_mdl *mdl,
> +			BtIOType BtType,
> +			uint16_t dcpsm,
> +			GError **err,
> +			mcap_mdl_operation_cb connect_cb,
> +			gpointer user_data);
> +void mcap_mdl_abort(struct mcap_mdl *mdl, GError **err,
> +			mcap_mdl_del_cb abort_cb, gpointer user_data);
> +
> +int mcap_mdl_get_fd(struct mcap_mdl *mdl);
> +uint16_t mcap_mdl_get_mdlid(struct mcap_mdl *mdl);
> +
> +/* Mcl operations*/
> +
> +void mcap_create_mcl(struct mcap_session *ms,
> +				const bdaddr_t *addr,
> +				uint16_t ccpsm,
> +				GError **err,
> +				mcap_mcl_connect_cb connect_cb,
> +				gpointer user_data);
> +void mcap_close_mcl(struct mcap_mcl *mcl, gboolean cache);
> +void mcap_mcl_set_cb(struct mcap_mcl *mcl, GError **gerr,
> +					gpointer user_data, McapMclCb cb1, ...);
> +bdaddr_t mcap_mcl_get_addr(struct mcap_mcl *mcl);
> +
> +struct mcap_mcl *mcap_mcl_ref(struct mcap_mcl *mcl);
> +void mcap_mcl_unref(struct mcap_mcl *mcl);
> +
> +/* MCAP main operations */
> +
> +struct mcap_session *mcap_create_session(struct btd_adapter *btd_adapter,
> +					BtIOSecLevel sec, uint16_t ccpsm,
> +					uint16_t dcpsm,
> +					GError **gerr,
> +					mcap_mcl_event_cb mcl_connected,
> +					mcap_mcl_event_cb mcl_reconnected,
> +					mcap_mcl_event_cb mcl_disconnected,
> +					mcap_mcl_event_cb mcl_uncached,
> +					gpointer user_data);
> +
> +void mcap_close_session(struct mcap_session *ms);
> +
> +uint16_t mcap_get_ctrl_psm(struct mcap_session *ms, GError **err);
> +uint16_t mcap_get_data_psm(struct mcap_session *ms, GError **err);
> +
> +#ifdef __cplusplus
> +}
> +#endif
> +
> +#endif /* __MCAP_LIB_H */
> +
> -- 
> 1.6.3.3
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Gustavo F. Padovan
http://padovan.org

^ permalink raw reply

* [PATCH 1/2] Add dynamic debug feature
From: Gustavo F. Padovan @ 2010-05-11  3:51 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: gustavo

It is still needed a sed work in the sources to changes debug() to DBG()

Thanks, to Vinicius Gomes that helped me sort out a linking issue with
this patch.
---
 src/logging.c |   64 +++++++++++++++++++++++++++++++++++++++++---------------
 src/logging.h |   28 +++++++++++++++++++++++-
 src/main.c    |   34 ++++++++++++++----------------
 tracer/main.c |   24 +++++----------------
 4 files changed, 95 insertions(+), 55 deletions(-)

diff --git a/src/logging.c b/src/logging.c
index 704f848..a9956be 100644
--- a/src/logging.c
+++ b/src/logging.c
@@ -29,9 +29,9 @@
 #include <stdarg.h>
 #include <syslog.h>
 
-#include "logging.h"
+#include <glib.h>
 
-static volatile int debug_enabled = 0;
+#include "logging.h"
 
 static inline void vinfo(const char *format, va_list ap)
 {
@@ -64,9 +64,6 @@ void debug(const char *format, ...)
 {
 	va_list ap;
 
-	if (!debug_enabled)
-		return;
-
 	va_start(ap, format);
 
 	vsyslog(LOG_DEBUG, format, ap);
@@ -74,26 +71,57 @@ void debug(const char *format, ...)
 	va_end(ap);
 }
 
-void toggle_debug(void)
-{
-	debug_enabled = (debug_enabled + 1) % 2;
-}
+extern struct bluez_debug_desc __start___debug[];
+extern struct bluez_debug_desc __stop___debug[];
 
-void enable_debug(void)
-{
-	debug_enabled = 1;
-}
+static gchar **enabled = NULL;
 
-void disable_debug(void)
+static gboolean is_enabled(struct bluez_debug_desc *desc)
 {
-	debug_enabled = 0;
+        int i;
+
+        if (enabled == NULL)
+                return 0;
+
+        for (i = 0; enabled[i] != NULL; i++) {
+                if (desc->name != NULL && g_pattern_match_simple(enabled[i],
+                                                        desc->name) == TRUE)
+                        return 1;
+                if (desc->file != NULL && g_pattern_match_simple(enabled[i],
+                                                        desc->file) == TRUE)
+                        return 1;
+        }
+
+        return 0;
 }
 
-void start_logging(const char *ident, const char *message, ...)
+void start_logging(const char *debug, int detach, const char *ident, const char *message, ...)
 {
+	int option = LOG_NDELAY | LOG_PID;
+	struct bluez_debug_desc *desc;
+	const char *name = NULL, *file = NULL;
 	va_list ap;
 
-	openlog(ident, LOG_PID | LOG_NDELAY | LOG_PERROR, LOG_DAEMON);
+	if (debug != NULL)
+		enabled = g_strsplit_set(debug, ":, ", 0);
+
+	for (desc = __start___debug; desc < __stop___debug; desc++) {
+		if (file != NULL || name != NULL) {
+			if (g_strcmp0(desc->file, file) == 0) {
+				if (desc->name == NULL)
+					desc->name = name;
+			} else
+				file = NULL;
+		}
+
+		if (is_enabled(desc))
+			desc->flags |= BLUEZ_DEBUG_FLAG_PRINT;
+	}
+
+	if (!detach)
+		option |= LOG_PERROR;
+
+	openlog(ident, option, LOG_DAEMON);
 
 	va_start(ap, message);
 
@@ -105,4 +133,6 @@ void start_logging(const char *ident, const char *message, ...)
 void stop_logging(void)
 {
 	closelog();
+
+	g_strfreev(enabled);
 }
diff --git a/src/logging.h b/src/logging.h
index 2e9d564..b1a58a8 100644
--- a/src/logging.h
+++ b/src/logging.h
@@ -30,9 +30,33 @@ void debug(const char *format, ...) __attribute__((format(printf, 1, 2)));
 void toggle_debug(void);
 void enable_debug(void);
 void disable_debug(void);
-void start_logging(const char *ident, const char *message, ...);
+void start_logging(const char *debug, int detach, const char *ident, const char *message, ...);
 void stop_logging(void);
 
-#define DBG(fmt, arg...)  debug("%s: " fmt "\n" , __FUNCTION__ , ## arg)
+struct bluez_debug_desc {
+        const char *name;
+        const char *file;
+#define BLUEZ_DEBUG_FLAG_DEFAULT (0)
+#define BLUEZ_DEBUG_FLAG_PRINT   (1 << 0)
+        unsigned int flags;
+} __attribute__((aligned(8)));
+
+/**
+ * DBG:
+ * @fmt: format string
+ * @arg...: list of arguments
+ *
+ * Simple macro around debug() which also include the function
+ * name it is called in.
+ */
+#define DBG(fmt, arg...) do { \
+        static struct bluez_debug_desc __bluez_debug_desc \
+        __attribute__((used, section("__debug"), aligned(8))) = { \
+                .file = __FILE__, .flags = BLUEZ_DEBUG_FLAG_DEFAULT, \
+        }; \
+        if (__bluez_debug_desc.flags & BLUEZ_DEBUG_FLAG_PRINT) \
+                debug("%s:%s() " fmt, \
+                                        __FILE__, __FUNCTION__ , ## arg); \
+} while (0)
 
 #endif /* __LOGGING_H */
diff --git a/src/main.c b/src/main.c
index 014d8b6..c090493 100644
--- a/src/main.c
+++ b/src/main.c
@@ -288,13 +288,8 @@ static void sig_term(int sig)
 	g_main_loop_quit(event_loop);
 }
 
-static void sig_debug(int sig)
-{
-	toggle_debug();
-}
-
+static gchar *option_debug = NULL;
 static gboolean option_detach = TRUE;
-static gboolean option_debug = FALSE;
 static gboolean option_udev = FALSE;
 
 static guint last_adapter_timeout = 0;
@@ -327,12 +322,22 @@ void btd_stop_exit_timer(void)
 	last_adapter_timeout = 0;
 }
 
+static gboolean parse_debug(const char *key, const char *value, gpointer user_data, GError **error)
+{
+	option_debug = g_strdup(value);
+	if (!option_debug)
+		option_debug = g_strdup("*");
+
+	return TRUE;
+}
+
 static GOptionEntry options[] = {
 	{ "nodaemon", 'n', G_OPTION_FLAG_REVERSE,
 				G_OPTION_ARG_NONE, &option_detach,
 				"Don't run as daemon in background" },
-	{ "debug", 'd', 0, G_OPTION_ARG_NONE, &option_debug,
-				"Enable debug information output" },
+	{ "debug", 'd', G_OPTION_FLAG_OPTIONAL_ARG,
+				G_OPTION_ARG_CALLBACK, parse_debug,
+				"Enable debug information output", "DEBUG" },
 	{ "udev", 'u', 0, G_OPTION_ARG_NONE, &option_udev,
 				"Run from udev mode of operation" },
 	{ NULL },
@@ -392,7 +397,8 @@ int main(int argc, char *argv[])
 
 	umask(0077);
 
-	start_logging("bluetoothd", "Bluetooth daemon %s", VERSION);
+	start_logging(option_debug, option_detach,
+			"bluetoothd", "Bluetooth daemon %s", VERSION);
 
 	memset(&sa, 0, sizeof(sa));
 	sa.sa_flags = SA_NOCLDSTOP;
@@ -400,17 +406,9 @@ int main(int argc, char *argv[])
 	sigaction(SIGTERM, &sa, NULL);
 	sigaction(SIGINT,  &sa, NULL);
 
-	sa.sa_handler = sig_debug;
-	sigaction(SIGUSR2, &sa, NULL);
-
 	sa.sa_handler = SIG_IGN;
 	sigaction(SIGPIPE, &sa, NULL);
 
-	if (option_debug == TRUE) {
-		info("Enabling debug information");
-		enable_debug();
-	}
-
 	config = load_config(CONFIGDIR "/main.conf");
 
 	parse_config(config);
@@ -446,7 +444,7 @@ int main(int argc, char *argv[])
 
 	rfkill_init();
 
-	debug("Entering main loop");
+	DBG("Entering main loop");
 
 	g_main_loop_run(event_loop);
 
diff --git a/tracer/main.c b/tracer/main.c
index 5ec5ff2..0257e00 100644
--- a/tracer/main.c
+++ b/tracer/main.c
@@ -48,20 +48,15 @@ static void sig_term(int sig)
 	g_main_loop_quit(event_loop);
 }
 
-static void sig_debug(int sig)
-{
-	toggle_debug();
-}
-
 static gboolean option_detach = TRUE;
-static gboolean option_debug = FALSE;
+static gchar *option_debug = NULL;
 
 static GOptionEntry options[] = {
 	{ "nodaemon", 'n', G_OPTION_FLAG_REVERSE,
 				G_OPTION_ARG_NONE, &option_detach,
 				"Don't run as daemon in background" },
-	{ "debug", 'd', 0, G_OPTION_ARG_NONE, &option_debug,
-				"Enable debug information output" },
+	{ "debug", 'd', 0, G_OPTION_ARG_STRING, &option_debug,
+				"Enable debug information output", "DEBUG" },
 	{ NULL },
 };
 
@@ -103,7 +98,8 @@ int main(int argc, char *argv[])
 
 	umask(0077);
 
-	start_logging("hcitrace", "HCI trace daemon %s", VERSION);
+	start_logging(option_debug, option_detach,
+			"hcitrace", "HCI trace daemon %s", VERSION);
 
 	memset(&sa, 0, sizeof(sa));
 	sa.sa_flags = SA_NOCLDSTOP;
@@ -111,20 +107,12 @@ int main(int argc, char *argv[])
 	sigaction(SIGTERM, &sa, NULL);
 	sigaction(SIGINT,  &sa, NULL);
 
-	sa.sa_handler = sig_debug;
-	sigaction(SIGUSR2, &sa, NULL);
-
 	sa.sa_handler = SIG_IGN;
 	sigaction(SIGPIPE, &sa, NULL);
 
-	if (option_debug == TRUE) {
-		info("Enabling debug information");
-		enable_debug();
-	}
-
 	event_loop = g_main_loop_new(NULL, FALSE);
 
-	debug("Entering main loop");
+	DBG("Entering main loop");
 
 	g_main_loop_run(event_loop);
 
-- 
1.7.1


^ permalink raw reply related

* Re: magicmouse: claimed by neither input, hiddev nor hidraw
From: Justin P. Mattock @ 2010-05-11  2:58 UTC (permalink / raw)
  To: Michael Poole; +Cc: Jiri Kosina, linux-bluetooth, Linux Kernel Mailing List
In-Reply-To: <87mxw7i33j.fsf@troilus.org>

On 05/10/2010 07:28 PM, Michael Poole wrote:
> Justin P. Mattock writes:
>
>    
>> On 05/10/2010 02:52 PM, Jiri Kosina wrote:
>>      
> [snip]
>    
>>> This sounds a bit strange.
>>>
>>> hidraw shouldn't be making too much difference in the case you describe.
>>> hidraw is basically just a mean of relaying HID events to userspace so
>>> that any driver/application in userspace can access them. But magicmouse
>>> driver is written completely in kernelspace.
>>>
>>> Does anything on your system have /dev/hidraw* nodes open? (you could
>>> check by lsof).
>>>
>>>        
>>
>> right now I see
>> /dev/hidraw0,1,2,3
>>
>> ./lsof | grep /dev
>> (showing bluetooth)
>>
>> bluetooth 2020   root    0u      CHR                1,3       0t0 2551
>> /dev/null
>> bluetooth 2020   root    1u      CHR                1,3       0t0 2551
>> /dev/null
>> bluetooth 2020   root    2u      CHR                1,3       0t0 2551
>> /dev/null
>> bluetooth 2020   root   14u      CHR              10,62       0t0 3895
>> /dev/rfkill
>>
>> I can try a bisect on this and see.
>>      
> A list of which patches you have applied would also be helpful.  The
> standard 2.6.33.* kernels predate the merge of the hid-magicmouse
> driver, but the dmesg entry you pasted makes it look like the driver was
> present.
>
> Michael Poole
>
>    
The only other thing that I remember
when adding hidraw was adding
BT_HCIUART_LL=m
(not sure if it matters or not).

here is dmesg:
http://fpaste.org/OiDf/

Justin P. Mattock


^ permalink raw reply

* Re: magicmouse: claimed by neither input, hiddev nor hidraw
From: Justin P. Mattock @ 2010-05-11  2:45 UTC (permalink / raw)
  To: Michael Poole; +Cc: Jiri Kosina, linux-bluetooth, Linux Kernel Mailing List
In-Reply-To: <87mxw7i33j.fsf@troilus.org>

On 05/10/2010 07:28 PM, Michael Poole wrote:
> Justin P. Mattock writes:
>
>    
>> On 05/10/2010 02:52 PM, Jiri Kosina wrote:
>>      
> [snip]
>    
>>> This sounds a bit strange.
>>>
>>> hidraw shouldn't be making too much difference in the case you describe.
>>> hidraw is basically just a mean of relaying HID events to userspace so
>>> that any driver/application in userspace can access them. But magicmouse
>>> driver is written completely in kernelspace.
>>>
>>> Does anything on your system have /dev/hidraw* nodes open? (you could
>>> check by lsof).
>>>
>>>        
>>
>> right now I see
>> /dev/hidraw0,1,2,3
>>
>> ./lsof | grep /dev
>> (showing bluetooth)
>>
>> bluetooth 2020   root    0u      CHR                1,3       0t0 2551
>> /dev/null
>> bluetooth 2020   root    1u      CHR                1,3       0t0 2551
>> /dev/null
>> bluetooth 2020   root    2u      CHR                1,3       0t0 2551
>> /dev/null
>> bluetooth 2020   root   14u      CHR              10,62       0t0 3895
>> /dev/rfkill
>>
>> I can try a bisect on this and see.
>>      
> A list of which patches you have applied would also be helpful.  The
> standard 2.6.33.* kernels predate the merge of the hid-magicmouse
> driver, but the dmesg entry you pasted makes it look like the driver was
> present.
>
> Michael Poole
>
>    
I'm using the latest HEAD, without any patches
applied. (I'll send a post with dmesg after this post).

Justin P. Mattock

^ permalink raw reply

* Re: magicmouse: claimed by neither input, hiddev nor hidraw
From: Michael Poole @ 2010-05-11  2:28 UTC (permalink / raw)
  To: Justin P. Mattock; +Cc: Jiri Kosina, linux-bluetooth, Linux Kernel Mailing List
In-Reply-To: <4BE8859E.3090305@gmail.com>

Justin P. Mattock writes:

> On 05/10/2010 02:52 PM, Jiri Kosina wrote:
[snip]
>> This sounds a bit strange.
>>
>> hidraw shouldn't be making too much difference in the case you describe.
>> hidraw is basically just a mean of relaying HID events to userspace so
>> that any driver/application in userspace can access them. But magicmouse
>> driver is written completely in kernelspace.
>>
>> Does anything on your system have /dev/hidraw* nodes open? (you could
>> check by lsof).
>>
>
>
> right now I see
> /dev/hidraw0,1,2,3
>
> ./lsof | grep /dev
> (showing bluetooth)
>
> bluetooth 2020   root    0u      CHR                1,3       0t0 2551
> /dev/null
> bluetooth 2020   root    1u      CHR                1,3       0t0 2551
> /dev/null
> bluetooth 2020   root    2u      CHR                1,3       0t0 2551
> /dev/null
> bluetooth 2020   root   14u      CHR              10,62       0t0 3895
> /dev/rfkill
>
> I can try a bisect on this and see.

A list of which patches you have applied would also be helpful.  The
standard 2.6.33.* kernels predate the merge of the hid-magicmouse
driver, but the dmesg entry you pasted makes it look like the driver was
present.

Michael Poole

^ permalink raw reply

* Re: magicmouse: claimed by neither input, hiddev nor hidraw
From: Justin P. Mattock @ 2010-05-10 22:15 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: linux-bluetooth, Linux Kernel Mailing List
In-Reply-To: <alpine.LNX.2.00.1005102351220.28092@pobox.suse.cz>

On 05/10/2010 02:52 PM, Jiri Kosina wrote:
> On Mon, 10 May 2010, Justin Mattock wrote:
>
>>>> with the magicmouse connecting i.g. I've had my system setup to use
>>>> the magicmouse with 2.6.33* with no issues now coming back after
>>>> sometime seems everything is connecting,but then no movement: (and
>>>> some thing in dmesg):
>>>> [  116.267993] magicmouse 0005:05AC:030D.0007: claimed by neither
>>>> input, hiddev nor hidraw
>>>> [  116.268053] magicmouse 0005:05AC:030D.0007: magicmouse hw start failed
>>>> using osx  magicmouse connects fine.
>>>> Using standard mightymouse everything connects.
>>>>   are there any reports of such things?
>>>
>>> Adding Michael Poole to CC.
>>>
>>> No, I haven't seen any such reports. First -- could you please provide
>>> complete dmesg?
>>
>> everything seems to be working o.k. now, just had to enable HIDRAW=y
>> maybe something changed to where I needed this(I remember never really
>> using hidraw, just HIDDEV(but could be wrong)).
>
> This sounds a bit strange.
>
> hidraw shouldn't be making too much difference in the case you describe.
> hidraw is basically just a mean of relaying HID events to userspace so
> that any driver/application in userspace can access them. But magicmouse
> driver is written completely in kernelspace.
>
> Does anything on your system have /dev/hidraw* nodes open? (you could
> check by lsof).
>


right now I see
/dev/hidraw0,1,2,3

./lsof | grep /dev
(showing bluetooth)

bluetooth 2020   root    0u      CHR                1,3       0t0 2551 
/dev/null
bluetooth 2020   root    1u      CHR                1,3       0t0 2551 
/dev/null
bluetooth 2020   root    2u      CHR                1,3       0t0 2551 
/dev/null
bluetooth 2020   root   14u      CHR              10,62       0t0 3895 
/dev/rfkill

I can try a bisect on this and see.


Justin P. Mattock

^ permalink raw reply

* Re: magicmouse: claimed by neither input, hiddev nor hidraw
From: Jiri Kosina @ 2010-05-10 21:52 UTC (permalink / raw)
  To: Justin Mattock; +Cc: linux-bluetooth, Linux Kernel Mailing List
In-Reply-To: <s2odd18b0c31005101439v22d03bfdw4e65d7c4b8315b6a@mail.gmail.com>

On Mon, 10 May 2010, Justin Mattock wrote:

> >> with the magicmouse connecting i.g. I've had my system setup to use 
> >> the magicmouse with 2.6.33* with no issues now coming back after 
> >> sometime seems everything is connecting,but then no movement: (and 
> >> some thing in dmesg):
> >> [  116.267993] magicmouse 0005:05AC:030D.0007: claimed by neither
> >> input, hiddev nor hidraw
> >> [  116.268053] magicmouse 0005:05AC:030D.0007: magicmouse hw start failed
> >> using osx  magicmouse connects fine.
> >> Using standard mightymouse everything connects.
> >>  are there any reports of such things?
> >
> > Adding Michael Poole to CC.
> >
> > No, I haven't seen any such reports. First -- could you please provide
> > complete dmesg?
> 
> everything seems to be working o.k. now, just had to enable HIDRAW=y 
> maybe something changed to where I needed this(I remember never really 
> using hidraw, just HIDDEV(but could be wrong)).

This sounds a bit strange.

hidraw shouldn't be making too much difference in the case you describe. 
hidraw is basically just a mean of relaying HID events to userspace so 
that any driver/application in userspace can access them. But magicmouse 
driver is written completely in kernelspace.

Does anything on your system have /dev/hidraw* nodes open? (you could 
check by lsof).

-- 
Jiri Kosina
SUSE Labs, Novell Inc.

^ permalink raw reply

* Re: magicmouse: claimed by neither input, hiddev nor hidraw
From: Justin Mattock @ 2010-05-10 21:39 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: linux-bluetooth, Linux Kernel Mailing List
In-Reply-To: <alpine.LRH.2.00.1005102334140.14809@twin.jikos.cz>

On Mon, May 10, 2010 at 2:34 PM, Jiri Kosina <jkosina@suse.cz> wrote:
> On Mon, 10 May 2010, Justin Mattock wrote:
>
>> is it me, or is there something wrong
>> with the magicmouse connecting
>> i.g. I've had my system setup to use the
>> magicmouse with 2.6.33* with no issues
>> now coming back after sometime
>> seems everything is connecting,but then no movement:
>> (and some thing in dmesg):
>> [  116.267993] magicmouse 0005:05AC:030D.0007: claimed by neither
>> input, hiddev nor hidraw
>> [  116.268053] magicmouse 0005:05AC:030D.0007: magicmouse hw start failed
>>
>> using osx  magicmouse connects fine.
>> Using standard mightymouse everything connects.
>>  are there any reports of such things?
>
> Adding Michael Poole to CC.
>
> No, I haven't seen any such reports. First -- could you please provide
> complete dmesg?
>
> --
> Jiri Kosina
> SUSE Labs, Novell Inc.
>
>

everything seems to be working o.k. now,
just had to enable HIDRAW=y
maybe something changed to where
I needed this(I remember never really
using hidraw, just HIDDEV(but could be wrong)).

-- 
Justin P. Mattock

^ permalink raw reply

* Re: magicmouse: claimed by neither input, hiddev nor hidraw
From: Jiri Kosina @ 2010-05-10 21:34 UTC (permalink / raw)
  To: Justin Mattock; +Cc: linux-bluetooth, Linux Kernel Mailing List
In-Reply-To: <j2idd18b0c31005101341o43b652c1zf8729f5f9a60e0d3@mail.gmail.com>

On Mon, 10 May 2010, Justin Mattock wrote:

> is it me, or is there something wrong
> with the magicmouse connecting
> i.g. I've had my system setup to use the
> magicmouse with 2.6.33* with no issues
> now coming back after sometime
> seems everything is connecting,but then no movement:
> (and some thing in dmesg):
> [  116.267993] magicmouse 0005:05AC:030D.0007: claimed by neither
> input, hiddev nor hidraw
> [  116.268053] magicmouse 0005:05AC:030D.0007: magicmouse hw start failed
> 
> using osx  magicmouse connects fine.
> Using standard mightymouse everything connects.
>  are there any reports of such things?

Adding Michael Poole to CC.
                                                                                                                                              
No, I haven't seen any such reports. First -- could you please provide 
complete dmesg?

-- 
Jiri Kosina
SUSE Labs, Novell Inc.


^ permalink raw reply

* Re: magicmouse: claimed by neither input, hiddev nor hidraw
From: Justin P. Mattock @ 2010-05-10 21:08 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Linux Kernel Mailing List
In-Reply-To: <j2idd18b0c31005101341o43b652c1zf8729f5f9a60e0d3@mail.gmail.com>

On 05/10/2010 01:41 PM, Justin Mattock wrote:
> is it me, or is there something wrong
> with the magicmouse connecting
> i.g. I've had my system setup to use the
> magicmouse with 2.6.33* with no issues
> now coming back after sometime
> seems everything is connecting,but then no movement:
> (and some thing in dmesg):
> [  116.267993] magicmouse 0005:05AC:030D.0007: claimed by neither
> input, hiddev nor hidraw
> [  116.268053] magicmouse 0005:05AC:030D.0007: magicmouse hw start failed
>
> using osx  magicmouse connects fine.
> Using standard mightymouse everything connects.
>   are there any reports of such things?
>
>

nevermind.. my bad, ended up not
having hiddraw enabled in the kernel.

everything looks good, suspend etc..

Justin P. Mattock

^ permalink raw reply

* magicmouse: claimed by neither input, hiddev nor hidraw
From: Justin Mattock @ 2010-05-10 20:41 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Linux Kernel Mailing List

is it me, or is there something wrong
with the magicmouse connecting
i.g. I've had my system setup to use the
magicmouse with 2.6.33* with no issues
now coming back after sometime
seems everything is connecting,but then no movement:
(and some thing in dmesg):
[  116.267993] magicmouse 0005:05AC:030D.0007: claimed by neither
input, hiddev nor hidraw
[  116.268053] magicmouse 0005:05AC:030D.0007: magicmouse hw start failed

using osx  magicmouse connects fine.
Using standard mightymouse everything connects.
 are there any reports of such things?


-- 
Justin P. Mattock

^ permalink raw reply

* Re: [PATCH v5] Add support for the Atheros AR300x Bluetooth Chip
From: Luis R. Rodriguez @ 2010-05-10 20:12 UTC (permalink / raw)
  To: Suraj Sumangala, David Miller, marcel@holtmann.org,
	Jothikumar Mothilal
  Cc: linux-bluetooth@vger.kernel.org, Luis Rodriguez,
	gfpadovan@gmail.com, linux-kernel
In-Reply-To: <1273062798.19162.6.camel@atheros013-desktop>

On Wed, May 05, 2010 at 05:33:18AM -0700, Suraj Sumangala wrote:
> Hi Marcel,
> 
> Can you take a look at the patch? Your review has been pending for
> sometime.

Marcel, new timeline:

----------
02-22-2010 - Marcel responded to your first patch version for UART bluetooth
02-22-2010 - Suarj posted resplies to Marcel's questions
03-01-2010 - Suraj poked Marcel for feedback based on Suraj's comments
----------
03-11-2010 - Suraj posts new V2 patch but its sent busted with tabs/space mixup
03-11-2010 - Marcel asks for a resend
----------
03-14-2010 - Suaraj posts V3 patch with tabs/spaces fixed
03-23-2010 - First poke to Marcel and list
03-29-2010 - Second poke to Marcel and list
03-31-2010 - Patch for userspace hciattach.c changes posted
----------
04-20-2010 - v3 patch posted
04-21-2010 - v4 patch posted
04-22-2010 - v5 patch posted
04-26-2010 - v5 first poke
05-05-2010 - v5 second poke
----------

What else can our team do?

:(

  Luis

^ permalink raw reply

* Using wireless.kernel.org for Bluetooth documentation as well ?
From: Luis R. Rodriguez @ 2010-05-10 19:45 UTC (permalink / raw)
  To: linux-wireless, linux-bluetooth, linux-kernel
  Cc: John W. Linville, Marcel Holtmann, Johannes Berg

Today we have a wealth of information on 802.11 Linux wireless on
http://wireless.kernel.org and I think the wiki model has worked
wonders for us. I wanted to see what you thought of using the same
site as a source of documentation for Bluetooth as well. We already
have *some* Bluetooth documentation [1], and we could just point to
the BlueZ pages for other docs but it doesn't seem to use a wiki and
those google ads do blind my right eye.

Thoughts?

[1] http://wireless.kernel.org/en/users/Documentation/Bluetooth-coexistence
[2] http://www.bluez.org

  Luis

^ permalink raw reply

* [PATCH 2/2] Bluetooth: Remove L2CAP Extended Features from Kconfig
From: Gustavo F. Padovan @ 2010-05-10 17:39 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: gustavo, marcel, Gustavo F. Padovan
In-Reply-To: <1273513181-28258-1-git-send-email-gustavo@padovan.org>

From: Gustavo F. Padovan <padovan@profusion.mobi>

This reverts commit 84fb0a6334af0ccad3544f6972c055d90fbb9fbe
One can use other mechanisms to enable L2CAP Extended Features.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
---
 net/bluetooth/Kconfig |   13 -------------
 net/bluetooth/l2cap.c |    4 ----
 2 files changed, 0 insertions(+), 17 deletions(-)

diff --git a/net/bluetooth/Kconfig b/net/bluetooth/Kconfig
index ee3b304..ed37168 100644
--- a/net/bluetooth/Kconfig
+++ b/net/bluetooth/Kconfig
@@ -43,19 +43,6 @@ config BT_L2CAP
 	  Say Y here to compile L2CAP support into the kernel or say M to
 	  compile it as module (l2cap).
 
-config BT_L2CAP_EXT_FEATURES
-	bool "L2CAP Extended Features support (EXPERIMENTAL)"
-	depends on BT_L2CAP && EXPERIMENTAL
-	help
-	  This option enables the L2CAP Extended Features support. These
-	  new features include the Enhanced Retransmission and Streaming
-	  Modes, the Frame Check Sequence (FCS), and Segmentation and
-	  Reassembly (SAR) for L2CAP packets. They are a required for the
-	  new Alternate MAC/PHY and the Bluetooth Medical Profile.
-
-	  You should say N unless you know what you are doing. Note that
-	  this is in an experimental state yet.
-
 config BT_SCO
 	tristate "SCO links support"
 	depends on BT
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index a1b826f..e8c8f8b 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -55,11 +55,7 @@
 
 #define VERSION "2.14"
 
-#ifdef CONFIG_BT_L2CAP_EXT_FEATURES
-static int enable_ertm = 1;
-#else
 static int enable_ertm = 0;
-#endif
 
 static u32 l2cap_feat_mask = L2CAP_FEAT_FIXED_CHAN;
 static u8 l2cap_fixed_chan[8] = { 0x02, };
-- 
1.7.1

^ permalink raw reply related

* [PATCH 1/2] Bluetooth: Remove max_tx and tx_window modules paramenter from L2CAP
From: Gustavo F. Padovan @ 2010-05-10 17:39 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: gustavo, marcel, Gustavo F. Padovan

From: Gustavo F. Padovan <padovan@profusion.mobi>

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
---
 net/bluetooth/l2cap.c |   12 ++----------
 1 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index 673a368..a1b826f 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -60,8 +60,6 @@ static int enable_ertm = 1;
 #else
 static int enable_ertm = 0;
 #endif
-static int max_transmit = L2CAP_DEFAULT_MAX_TX;
-static int tx_window = L2CAP_DEFAULT_TX_WINDOW;
 
 static u32 l2cap_feat_mask = L2CAP_FEAT_FIXED_CHAN;
 static u8 l2cap_fixed_chan[8] = { 0x02, };
@@ -808,9 +806,9 @@ static void l2cap_sock_init(struct sock *sk, struct sock *parent)
 			pi->mode = L2CAP_MODE_ERTM;
 		else
 			pi->mode = L2CAP_MODE_BASIC;
-		pi->max_tx = max_transmit;
+		pi->max_tx = L2CAP_DEFAULT_MAX_TX;
 		pi->fcs  = L2CAP_FCS_CRC16;
-		pi->tx_win = tx_window;
+		pi->tx_win = L2CAP_DEFAULT_TX_WINDOW;
 		pi->sec_level = BT_SECURITY_LOW;
 		pi->role_switch = 0;
 		pi->force_reliable = 0;
@@ -4677,12 +4675,6 @@ module_exit(l2cap_exit);
 module_param(enable_ertm, bool, 0644);
 MODULE_PARM_DESC(enable_ertm, "Enable enhanced retransmission mode");
 
-module_param(max_transmit, uint, 0644);
-MODULE_PARM_DESC(max_transmit, "Max transmit value (default = 3)");
-
-module_param(tx_window, uint, 0644);
-MODULE_PARM_DESC(tx_window, "Transmission window size value (default = 63)");
-
 MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>");
 MODULE_DESCRIPTION("Bluetooth L2CAP ver " VERSION);
 MODULE_VERSION(VERSION);
-- 
1.7.1

^ permalink raw reply related

* Question about HDP testing tools submission
From: Elvis Pfützenreuter @ 2010-05-10 15:14 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: epx

We have begun development of some testing tools for MCAP and HDP, mostly Python scripts. I already have a HDP record generator/interpreter; more MCAP and HDP things will be ready soon.

The question is: are such tools suitable for submission to BlueZ? Or should we create a repository/project for themselves?

I see a lot of scripts in bluez/test/ folder, but since we are doing things that are quite HDP-specific, I thought it was better to ask first, before submitting a long string of patches...

^ permalink raw reply

* Re: HDP proposed api (ver 0.2)
From: José Antonio Santos Cadenas @ 2010-05-10 12:57 UTC (permalink / raw)
  To: Luiz Augusto von Dentz
  Cc: Elvis Pfützenreuter, João Paulo Rechi Vita,
	linux-bluetooth
In-Reply-To: <201005101042.50984.jcaden@libresoft.es>

El Monday 10 May 2010 10:42:50 José Antonio Santos Cadenas escribió:
> Hi all,
> 
> El Sunday 09 May 2010 17:14:39 Luiz Augusto von Dentz escribió:
> > Hi,
> > 
> > On Sat, May 8, 2010 at 12:08 AM, Elvis Pfützenreuter <epx@signove.com>
> 
> wrote:
> > >> Device objects exists for each paired device. If the pairing is
> > >> removed the object is also removed and a new pairing is needed before
> > >> connecting to it (as imposed by the whole bluetooth stack logic
> > >> anyway).
> > > 
> > > AFAIK the HDP source and sink must be paired before any session can be
> > > established, so the relevant device objects will always be there, so
> > > the path can be (re)used.
> > 
> > Exactly, I tried to explain this before that device objects is a
> > better way to expose any relevant API since that would be created
> > anyway. It also has integration with the sdp record cache and are
> > reloaded during the initialization and I hardly see us doing anything
> > to revert this, since pretty much every plugin depend on this to work.
> 
> We agree that the best way to expose a remote device is using the path
> already created by bluez. We are thinking, as Elvis suggested, in changing
> some functions to that path for discovering remove services.
> 
> The main problem here is that sessions exist in HDP even if bluez is not
> concerned about them. Imagine that we perform an implementation without
> session management, this not implies that other implementations do the same
> so a remote device could expose multiple HDP session (each one of them
> could expose a SDP record). Now if you are not concern of the sessions and
> you try to connect to a remote device that holds more than one session,
> you can't decide which one of that sessions connect. A simple example of
> this situation is described in the HDP implementation whitepaper (page 18,
> figure 2.4).
> 
> > So, with this in mind, IMHO, the whole concept of exposure the
> > sessions won't fit nicely in BlueZ API, first because it uses the
> > adapter path to create session passing a device path, which btw
> > already is associated with adapter anyway,
> 
> We think that the main problem here is that we don't choose a good path
> name. But we are open to suggestion for a better one.
> 
> > second because any client
> > seems to be able to create those sessions even if they are unable to
> > control them because they don't hold an agent,
> 
> We think that this is not a good reason, the same could happend with other
> profiles. Any client could connect to an Audio or Serial device even if
> they are unable to use them or the don't know how to do it.
> 
> > and third I don't think
> > we should be exposing protocol internals in a D-Bus API,
> 
> We don't understand this. What do you mean with protocol internal? Nothing
> exposed in D-Bus in internal we just propose to concert the client about
> the remote session (remote hdp instance) because it need to decide with
> one to connect, as it decides the device that it will connect with a
> Serial connection. Probably we need a better name than "session id".
> 
> > this id's
> > make as much sense as the bdaddr in the ui (read _none_), it is as
> > usable as we starting exposing local and remote seid (Stream Endpoint
> > id, surprisingly similar to endpoint here) to pulseaudio to carry on
> > with all avdtp protocol details, this will only fragment the logic
> > around those bits and certainly won't make it work better.
> 
> Ok, we shouldn't expose mdepid. But we still need to expose the remote hdp
> session or instances.

Sorry, I was wrong with this. I think that we need a way to identify the end 
point (or feature or something) that will be connected in the remote hdp 
session. Because the application should be able to select where to connect.

> Note that in Audio profile the psm is fixed, so there
> is just one listening on each device, but HDP is different because the psm
> are not fixed and multiple instances can exist in  the same device.
> 
> 

Regards

^ permalink raw reply

* [PATCH 25/25] Initial support for clock synchronization protocol
From: Santiago Carot-Nemesio @ 2010-05-10 10:15 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Santiago Carot Nemesio
In-Reply-To: <1273486527-7855-24-git-send-email-sancane@gmail.com>

From: Santiago Carot Nemesio <sancane@gmail.com>

---
 Makefile.am |    4 +-
 mcap/mcap.c |    2 +-
 mcap/sync.c |   84 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 87 insertions(+), 3 deletions(-)
 create mode 100644 mcap/sync.c

diff --git a/Makefile.am b/Makefile.am
index 7d8f4b5..98dacdf 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -170,8 +170,8 @@ builtin_sources += plugins/service.c
 endif
 
 if MCAP
-mcap_sources += mcap/mcap_lib.h \
-		mcap/mcap_internal.h \
+mcap_sources += mcap/mcap_internal.h \
+		mcap/mcap_lib.h mcap/sync.c \
 		mcap/mcap.h mcap/mcap.c
 endif
 
diff --git a/mcap/mcap.c b/mcap/mcap.c
index a292dcd..0fd5b97 100644
--- a/mcap/mcap.c
+++ b/mcap/mcap.c
@@ -1500,7 +1500,7 @@ static void rsend_req(struct mcap_mcl *mcl)
 static void proc_cmd(struct mcap_mcl *mcl, uint8_t *cmd, uint32_t len)
 {
 	if ((cmd[0] >= MCAP_MD_SYNC_CAP_REQ) && (cmd[0] <= MCAP_MD_SYNC_INFO_IND)) {
-		send4B_cmd(mcl, cmd[0], MCAP_REQUEST_NOT_SUPPORTED, MCAP_MDLID_RESERVED);
+		proc_sync_cmd(mcl, cmd, len);
 		return;
 	}
 
diff --git a/mcap/sync.c b/mcap/sync.c
new file mode 100644
index 0000000..ede125a
--- /dev/null
+++ b/mcap/sync.c
@@ -0,0 +1,84 @@
+/*
+ *
+ *  MCAP for BlueZ - Bluetooth protocol stack for Linux
+ *
+ *  Copyright (C) 2010 GSyC/LibreSoft, Universidad Rey Juan Carlos.
+ *
+ *  Authors:
+ *  Santiago Carot-Nemesio <sancane at gmail.com>
+ *  Jose Antonio Santos-Cadenas <santoscadenas at gmail.com>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#include <stdint.h>
+#include <netinet/in.h>
+
+#include "logging.h"
+
+#include "mcap.h"
+#include "mcap_lib.h"
+#include "mcap_internal.h"
+
+static int send_unsupported_req(struct mcap_mcl *mcl, uint8_t oc)
+{
+	uint8_t *rsp;
+	mcap4B_rsp *rsp_err;
+	int sent;
+
+
+	rsp = g_malloc0(sizeof(mcap4B_rsp));
+
+	rsp_err = (mcap4B_rsp *)rsp;
+	rsp_err->op = oc;
+	rsp_err->rc = MCAP_REQUEST_NOT_SUPPORTED;
+	rsp_err->mdl = htons (MCAP_MDLID_RESERVED);
+
+	sent = mcap_send_data(g_io_channel_unix_get_fd(mcl->cc),
+					rsp,
+					sizeof(mcap4B_rsp));
+	g_free(rsp);
+	return sent;
+}
+
+void proc_sync_cmd(struct mcap_mcl *mcl, uint8_t *cmd, uint32_t len)
+{
+	switch (cmd[0]) {
+	case MCAP_MD_SYNC_CAP_REQ:
+		debug("TODO: received MCAP_MD_SYNC_CAP_REQ: %d",
+							MCAP_MD_SYNC_CAP_REQ);
+		break;
+	case MCAP_MD_SYNC_CAP_RSP:
+		debug("TODO: received MCAP_MD_SYNC_CAP_RSP: %d",
+							MCAP_MD_SYNC_CAP_RSP);
+		break;
+	case MCAP_MD_SYNC_SET_REQ:
+		debug("TODO: received MCAP_MD_SYNC_SET_REQ: %d",
+							MCAP_MD_SYNC_SET_REQ);
+		break;
+	case MCAP_MD_SYNC_SET_RSP:
+		debug("TODO: received MCAP_MD_SYNC_SET_RSP: %d",
+							MCAP_MD_SYNC_SET_RSP);
+		break;
+	case MCAP_MD_SYNC_INFO_IND:
+		debug("TODO: received MCAP_MD_SYNC_INFO_IND :%d",
+							MCAP_MD_SYNC_INFO_IND);
+		break;
+	}
+
+	/* Not implemented yet. Reply with unsupported request */
+        send_unsupported_req(mcl, cmd[0]);
+}
-- 
1.6.3.3


^ permalink raw reply related

* [PATCH 24/25] Process reply to md_delete_mdl_req command
From: Santiago Carot-Nemesio @ 2010-05-10 10:15 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Santiago Carot Nemesio
In-Reply-To: <1273486527-7855-23-git-send-email-sancane@gmail.com>

From: Santiago Carot Nemesio <sancane@gmail.com>

---
 mcap/mcap.c |   66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 65 insertions(+), 1 deletions(-)

diff --git a/mcap/mcap.c b/mcap/mcap.c
index 147f322..a292dcd 100644
--- a/mcap/mcap.c
+++ b/mcap/mcap.c
@@ -1325,6 +1325,70 @@ static gboolean process_md_abort_mdl_rsp(struct mcap_mcl *mcl,
 	return close;
 }
 
+static void restore_mdl(gpointer elem, gpointer data)
+{
+	struct mcap_mdl *mdl = elem;
+
+	if (mdl->state == MDL_DELETING) {
+		if (mdl->dc)
+			mdl->state = MDL_CONNECTED;
+		else
+			mdl->state = MDL_CLOSED;
+	} else if (mdl->state == MDL_CLOSED)
+		mdl->mcl->cb->mdl_closed(mdl, mdl->mcl->cb->user_data);
+}
+
+static gboolean process_md_delete_mdl_rsp(struct mcap_mcl *mcl, uint8_t *cmd,
+								uint32_t len)
+{
+	struct mcap_mdl_op_cb *del = mcl->priv_data;
+	struct mcap_mdl *mdl = del->mdl;
+	mcap_mdl_del_cb deleted_cb = del->cb.del;
+	gpointer user_data = del->user_data;
+	mcap4B_rsp *rsp = (mcap4B_rsp *) cmd;
+	mcap_md_req *cmdlast = (mcap_md_req *) mcl->lcmd;
+	uint16_t mdlid = ntohs(cmdlast->mdl);
+	GError *gerr = NULL;
+	gboolean close = FALSE;
+	gboolean notify = FALSE;
+
+	g_free(mcl->priv_data);
+	mcl->priv_data = NULL;
+
+	rsp->mdl = ntohs(rsp->mdl);
+
+	close = check_err_rsp(rsp->mdl, mdlid, rsp->rc, len,
+						sizeof(mcap4B_rsp), &gerr);
+
+	g_free(mcl->lcmd);
+	mcl->lcmd = NULL;
+	mcl->req = MCL_AVAILABLE;
+	if (gerr) {
+		if (mdl)
+			restore_mdl(mdl, NULL);
+		else
+			g_slist_foreach(mcl->mdls, restore_mdl, NULL);
+		deleted_cb(gerr, user_data);
+		g_error_free(gerr);
+		return close;
+	}
+
+	if (mdlid == MCAP_ALL_MDLIDS) {
+		g_slist_foreach(mcl->mdls, mcap_delete_mdl, &notify);
+		g_slist_free(mcl->mdls);
+		mcl->mdls = NULL;
+		mcl->state = MCL_CONNECTED;
+		goto end;
+	}
+
+	mcl->mdls = g_slist_remove(mcl->mdls, mdl);
+	update_mcl_state(mcl);
+	mcap_delete_mdl(mdl, &notify);
+end:
+	deleted_cb(gerr, user_data);
+	return close;
+}
+
 static gboolean check_rsp(struct mcap_mcl *mcl, uint8_t *cmd, uint32_t len)
 {
 	mcap4B_rsp *rsp;
@@ -1395,7 +1459,7 @@ static void proc_response(struct mcap_mcl *mcl, uint8_t *cmd, uint32_t len)
 		close = process_md_abort_mdl_rsp(mcl, cmd, len);
 		break;
 	case MCAP_MD_DELETE_MDL_RSP:
-		/* close = process_md_delete_mdl_rsp(mcl, cmd, len); */
+		close = process_md_delete_mdl_rsp(mcl, cmd, len);
 		break;
 	default:
 		debug("Unknown cmd response received (op code = %d)",cmd[0]);
-- 
1.6.3.3


^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox