linux/drivers/bluetooth/bluecard_cs.c

/*
 *
 *  Bluetooth driver for the Anycom BlueCard (LSE039/LSE041)
 *
 *  Copyright (C) 2001-2002  Marcel Holtmann <[email protected]>
 *
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License version 2 as
 *  published by the Free Software Foundation;
 *
 *  Software distributed under the License is distributed on an "AS
 *  IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
 *  implied. See the License for the specific language governing
 *  rights and limitations under the License.
 *
 *  The initial developer of the original code is David A. Hinds
 *  <[email protected]>.  Portions created by David A. Hinds
 *  are Copyright (C) 1999 David A. Hinds.  All Rights Reserved.
 *
 */

#include <linux/module.h>

#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/sched.h>
#include <linux/delay.h>
#include <linux/timer.h>
#include <linux/errno.h>
#include <linux/ptrace.h>
#include <linux/ioport.h>
#include <linux/spinlock.h>
#include <linux/moduleparam.h>
#include <linux/wait.h>

#include <linux/skbuff.h>
#include <linux/io.h>

#include <pcmcia/cistpl.h>
#include <pcmcia/ciscode.h>
#include <pcmcia/ds.h>
#include <pcmcia/cisreg.h>

#include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/hci_core.h>



/* ======================== Module parameters ======================== */


MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();



/* ======================== Local structures ======================== */


struct bluecard_info {};


static int bluecard_config(struct pcmcia_device *link);
static void bluecard_release(struct pcmcia_device *link);

static void bluecard_detach(struct pcmcia_device *p_dev);


/* Default baud rate: 57600, 115200, 230400 or 460800 */
#define DEFAULT_BAUD_RATE


/* Hardware states */
#define CARD_READY
#define CARD_ACTIVITY
#define CARD_HAS_PCCARD_ID
#define CARD_HAS_POWER_LED
#define CARD_HAS_ACTIVITY_LED

/* Transmit states  */
#define XMIT_SENDING
#define XMIT_WAKEUP
#define XMIT_BUFFER_NUMBER
#define XMIT_BUF_ONE_READY
#define XMIT_BUF_TWO_READY
#define XMIT_SENDING_READY

/* Receiver states */
#define RECV_WAIT_PACKET_TYPE
#define RECV_WAIT_EVENT_HEADER
#define RECV_WAIT_ACL_HEADER
#define RECV_WAIT_SCO_HEADER
#define RECV_WAIT_DATA

/* Special packet types */
#define PKT_BAUD_RATE_57600
#define PKT_BAUD_RATE_115200
#define PKT_BAUD_RATE_230400
#define PKT_BAUD_RATE_460800


/* These are the register offsets */
#define REG_COMMAND
#define REG_INTERRUPT
#define REG_CONTROL
#define REG_RX_CONTROL
#define REG_CARD_RESET
#define REG_LED_CTRL

/* REG_COMMAND */
#define REG_COMMAND_TX_BUF_ONE
#define REG_COMMAND_TX_BUF_TWO
#define REG_COMMAND_RX_BUF_ONE
#define REG_COMMAND_RX_BUF_TWO
#define REG_COMMAND_RX_WIN_ONE
#define REG_COMMAND_RX_WIN_TWO

/* REG_CONTROL */
#define REG_CONTROL_BAUD_RATE_57600
#define REG_CONTROL_BAUD_RATE_115200
#define REG_CONTROL_BAUD_RATE_230400
#define REG_CONTROL_BAUD_RATE_460800
#define REG_CONTROL_RTS
#define REG_CONTROL_BT_ON
#define REG_CONTROL_BT_RESET
#define REG_CONTROL_BT_RES_PU
#define REG_CONTROL_INTERRUPT
#define REG_CONTROL_CARD_RESET

/* REG_RX_CONTROL */
#define RTS_LEVEL_SHIFT_BITS



/* ======================== LED handling routines ======================== */


static void bluecard_activity_led_timeout(struct timer_list *t)
{}


static void bluecard_enable_activity_led(struct bluecard_info *info)
{}



/* ======================== Interrupt handling ======================== */


static int bluecard_write(unsigned int iobase, unsigned int offset, __u8 *buf, int len)
{}


static void bluecard_write_wakeup(struct bluecard_info *info)
{}


static int bluecard_read(unsigned int iobase, unsigned int offset, __u8 *buf, int size)
{}


static void bluecard_receive(struct bluecard_info *info,
			     unsigned int offset)
{}


static irqreturn_t bluecard_interrupt(int irq, void *dev_inst)
{}



/* ======================== Device specific HCI commands ======================== */


static int bluecard_hci_set_baud_rate(struct hci_dev *hdev, int baud)
{}



/* ======================== HCI interface ======================== */


static int bluecard_hci_flush(struct hci_dev *hdev)
{}


static int bluecard_hci_open(struct hci_dev *hdev)
{}


static int bluecard_hci_close(struct hci_dev *hdev)
{}


static int bluecard_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
{}



/* ======================== Card services HCI interaction ======================== */


static int bluecard_open(struct bluecard_info *info)
{}


static int bluecard_close(struct bluecard_info *info)
{}

static int bluecard_probe(struct pcmcia_device *link)
{}


static void bluecard_detach(struct pcmcia_device *link)
{}


static int bluecard_config(struct pcmcia_device *link)
{}


static void bluecard_release(struct pcmcia_device *link)
{}

static const struct pcmcia_device_id bluecard_ids[] =;
MODULE_DEVICE_TABLE(pcmcia, bluecard_ids);

static struct pcmcia_driver bluecard_driver =;
module_pcmcia_driver();