static int __init hci_uart_init(void)
{
	static struct tty_ldisc_ops hci_uart_ldisc;
	int err;

	BT_INFO("HCI UART driver ver %s", VERSION);

	/* Register the tty discipline */

	memset(&hci_uart_ldisc, 0, sizeof (hci_uart_ldisc));
	hci_uart_ldisc.magic		= TTY_LDISC_MAGIC;
	hci_uart_ldisc.name		= "n_hci";
	hci_uart_ldisc.open		= hci_uart_tty_open;
	hci_uart_ldisc.close		= hci_uart_tty_close;
	hci_uart_ldisc.read		= hci_uart_tty_read;
	hci_uart_ldisc.write		= hci_uart_tty_write;
	hci_uart_ldisc.ioctl		= hci_uart_tty_ioctl;
	hci_uart_ldisc.poll		= hci_uart_tty_poll;
	hci_uart_ldisc.receive_buf	= hci_uart_tty_receive;
	hci_uart_ldisc.write_wakeup	= hci_uart_tty_wakeup;
	hci_uart_ldisc.owner		= THIS_MODULE;

	if ((err = tty_register_ldisc(N_HCI, &hci_uart_ldisc))) {
		BT_ERR("HCI line discipline registration failed. (%d)", err);
		return err;
	}

#ifdef CONFIG_BT_HCIUART_H4
	h4_init();
#endif
#ifdef CONFIG_BT_HCIUART_BCSP
	bcsp_init();
#endif
#ifdef CONFIG_BT_HCIUART_LL
	ll_init();
#endif
#ifdef CONFIG_BT_HCIUART_ATH3K
	ath_init();
#endif
#ifdef CONFIG_BT_HCIUART_IBS
	ibs_init();
#endif

	return 0;
}
Пример #2
0
static int __init carrefour_init_module(void) {
   int err;

   memset(&global_stats, 0, sizeof(struct carrefour_global_stats));

   printk("max_lin_address = %lx\n", max_lin_address);
   printk("min_lin_address = %lx\n", min_lin_address);

#if ADAPTIVE_SAMPLING
   sampling_rate = sampling_rate_accurate;
#endif

   printk("sampling_rate   = %x\n", sampling_rate);

#if ADAPTIVE_SAMPLING
   printk("sampling_rate_cheap    = %x\n", sampling_rate_cheap);
   printk("sampling_rate_accurate = %x\n", sampling_rate_accurate);
#endif

   printk("NPPT  = Nr processed page touched\n"); 
   printk("NSAAO = Nr samples after an order\n"); 
   printk("TNO   = Total nr of orders\n"); 
   printk("TNSIT = Total number samples in the tree\n"); 
   printk("TNSM  = Total number sample missed\n"); 

   err = ibs_init();

   if(err) {
      return err;
   }

   ibs_create_procs_files();
   machine_init();

   return 0;
}
Пример #3
0
static int __init nmi_init(void)
{
	__u8 vendor = current_cpu_data.x86_vendor;
	__u8 family = current_cpu_data.x86;
	__u8 _model = current_cpu_data.x86_model;

	if (!cpu_has_apic) {
		printk("xenoprof: Initialization failed. No APIC\n");
		return -ENODEV;
	}

	switch (vendor) {
		case X86_VENDOR_AMD:
			/* Needs to be at least an Athlon (or hammer in 32bit mode) */

			switch (family) {
			default:
				printk("xenoprof: Initialization failed. "
				       "AMD processor family %d is not "
				       "supported\n", family);
				return -ENODEV;
			case 0xf:
				model = &op_athlon_spec;
				cpu_type = "x86-64/hammer";
				break;
			case 0x10:
				model = &op_athlon_spec;
				cpu_type = "x86-64/family10";
				ibs_init();
				break;
			case 0x11:
				model = &op_athlon_spec;
				cpu_type = "x86-64/family11h";
				break;
                        case 0x12:
				model = &op_athlon_spec;
				cpu_type = "x86-64/family12h";
				break;
			case 0x14:
                                model = &op_athlon_spec;
                                cpu_type = "x86-64/family14h";
                                break;
                        case 0x15:
                                model = &op_amd_fam15h_spec;
                                cpu_type = "x86-64/family15h";
                                break;
			case 0x16:
				model = &op_athlon_spec;
				cpu_type = "x86-64/family16h";
				break;
			}
			break;

		case X86_VENDOR_INTEL:
			switch (family) {
				/* Pentium IV */
				case 0xf:
					p4_init(&cpu_type);
					break;

				/* A P6-class processor */
				case 6:
					ppro_init(&cpu_type);
					break;

				default:
				break;
			}
			if (!cpu_type && !arch_perfmon_init(&cpu_type)) {
				printk("xenoprof: Initialization failed. "
				       "Intel processor family %d model %d"
				       "is not supported\n", family, _model);
				return -ENODEV;
			}
			break;

		default:
			printk("xenoprof: Initialization failed. "
			       "Unsupported processor. Unknown vendor %d\n",
				vendor);
			return -ENODEV;
	}

	return 0;
}