Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

irttp.c File Reference

#include <linux/config.h>
#include <linux/skbuff.h>
#include <linux/init.h>
#include <asm/byteorder.h>
#include <asm/unaligned.h>
#include <net/irda/irda.h>
#include <net/irda/irmod.h>
#include <net/irda/irlap.h>
#include <net/irda/irlmp.h>
#include <net/irda/parameters.h>
#include <net/irda/irttp.h>

Include dependency graph for irttp.c:

Go to the source code of this file.

Functions

static void __irttp_close_tsap (struct tsap_cb *self)
static int irttp_data_indication (void *instance, void *sap, struct sk_buff *skb)
static int irttp_udata_indication (void *instance, void *sap, struct sk_buff *skb)
static void irttp_disconnect_indication (void *instance, void *sap, LM_REASON reason, struct sk_buff *)
static void irttp_connect_indication (void *instance, void *sap, struct qos_info *qos, __u32 max_sdu_size, __u8 header_size, struct sk_buff *skb)
static void irttp_connect_confirm (void *instance, void *sap, struct qos_info *qos, __u32 max_sdu_size, __u8 header_size, struct sk_buff *skb)
static void irttp_run_tx_queue (struct tsap_cb *self)
static void irttp_run_rx_queue (struct tsap_cb *self)
static void irttp_flush_queues (struct tsap_cb *self)
static void irttp_fragment_skb (struct tsap_cb *self, struct sk_buff *skb)
static void irttp_start_todo_timer (struct tsap_cb *self, int timeout)
static struct sk_buffirttp_reassemble_skb (struct tsap_cb *self)
static int irttp_param_max_sdu_size (void *instance, irda_param_t *param, int get)
int __init irttp_init (void)
tsap_cbirttp_open_tsap (__u8 stsap_sel, int credit, notify_t *notify)
int irttp_close_tsap (struct tsap_cb *self)
int irttp_udata_request (struct tsap_cb *self, struct sk_buff *skb)
int irttp_data_request (struct tsap_cb *self, struct sk_buff *skb)
void irttp_give_credit (struct tsap_cb *self)
void irttp_flow_request (struct tsap_cb *self, LOCAL_FLOW flow)
int irttp_connect_request (struct tsap_cb *self, __u8 dtsap_sel, __u32 saddr, __u32 daddr, struct qos_info *qos, __u32 max_sdu_size, struct sk_buff *userdata)
int irttp_connect_response (struct tsap_cb *self, __u32 max_sdu_size, struct sk_buff *userdata)
tsap_cbirttp_dup (struct tsap_cb *orig, void *instance)
int irttp_disconnect_request (struct tsap_cb *self, struct sk_buff *userdata, int priority)
void irttp_do_data_indication (struct tsap_cb *self, struct sk_buff *skb)
static void irttp_todo_expired (unsigned long data)

Variables

static struct irttp_cbirttp = NULL
static pi_minor_info_t pi_minor_call_table []
static pi_major_info_t pi_major_call_table [] = {{ pi_minor_call_table, 2 }}
static pi_param_info_t param_info = { pi_major_call_table, 1, 0x0f, 4 }


Function Documentation

static void __irttp_close_tsap struct tsap_cb self  )  [static]
 

Definition at line 205 of file irttp.c.

References ASSERT, del_timer(), FALSE, irttp_flush_queues(), kfree(), NULL, and TTP_TSAP_MAGIC.

Referenced by irttp_close_tsap().

Here is the call graph for this function:

int irttp_close_tsap struct tsap_cb self  ) 
 

Definition at line 228 of file irttp.c.

References __irttp_close_tsap(), ASSERT, tsap_cb::connected, tsap_cb::disconnect_pend, hashbin_remove(), HZ, IRDA_DEBUG, irlmp_close_lsap(), irttp_disconnect_request(), irttp_start_todo_timer(), tsap_cb::magic, NULL, P_NORMAL, TRUE, irttp_cb::tsaps, and TTP_TSAP_MAGIC.

Referenced by __ircomm_close(), irda_destroy_socket(), irda_shutdown(), irlan_close_tsaps(), irttp_disconnect_indication(), and irttp_todo_expired().

Here is the call graph for this function:

static void irttp_connect_confirm void *  instance,
void *  sap,
struct qos_info qos,
__u32  max_sdu_size,
__u8  header_size,
struct sk_buff skb
[static]
 

Definition at line 731 of file irttp.c.

References ASSERT, qos_info::baud_rate, qos_value_t::bits, sk_buff::data, dev_kfree_skb, IRDA_DEBUG, IRDA_MIN, irda_param_extract_all(), sk_buff::len, n, NULL, ret, TRUE, TTP_HEADER, TTP_TSAP_MAGIC, qos_value_t::value, and WARNING.

Referenced by irttp_open_tsap().

Here is the call graph for this function:

void irttp_connect_indication void *  instance,
void *  sap,
struct qos_info qos,
__u32  max_sdu_size,
__u8  header_size,
struct sk_buff skb
[static]
 

Definition at line 814 of file irttp.c.

References ASSERT, sk_buff::data, dev_kfree_skb, lsap_cb::dlsap_sel, IRDA_DEBUG, IRDA_MIN, irda_param_extract_all(), sk_buff::len, n, NULL, ret, TTP_HEADER, TTP_TSAP_MAGIC, and WARNING.

Referenced by irttp_open_tsap().

Here is the call graph for this function:

int irttp_connect_request struct tsap_cb self,
__u8  dtsap_sel,
__u32  saddr,
__u32  daddr,
struct qos_info qos,
__u32  max_sdu_size,
struct sk_buff userdata
 

Definition at line 640 of file irttp.c.

References ASSERT, tsap_cb::connected, cpu_to_be16, EBADR, EISCONN, ENOMEM, FALSE, IRDA_DEBUG, irlmp_connect_request(), tsap_cb::lsap, tsap_cb::magic, n, NULL, put_unaligned, TTP_HEADER, TTP_MAX_HEADER, TTP_PARAMETERS, TTP_SAR_HEADER, and TTP_TSAP_MAGIC.

Referenced by ircomm_ttp_connect_request(), irda_connect(), irlan_client_state_arb(), irlan_client_state_open(), and irlan_client_state_query().

Here is the call graph for this function:

int irttp_connect_response struct tsap_cb self,
__u32  max_sdu_size,
struct sk_buff userdata
 

Definition at line 887 of file irttp.c.

References ASSERT, cpu_to_be16, ENOMEM, FALSE, IRDA_DEBUG, irlmp_connect_response(), tsap_cb::lsap, tsap_cb::magic, n, NULL, put_unaligned, ret, tsap_cb::stsap_sel, TRUE, TTP_HEADER, TTP_MAX_HEADER, TTP_PARAMETERS, TTP_SAR_HEADER, and TTP_TSAP_MAGIC.

Referenced by ircomm_ttp_connect_response(), irda_connect_response(), and irlan_provider_connect_response().

Here is the call graph for this function:

static int irttp_data_indication void *  instance,
void *  sap,
struct sk_buff skb
[static]
 

Definition at line 548 of file irttp.c.

References sk_buff::data, dev_kfree_skb, irttp_run_rx_queue(), irttp_start_todo_timer(), sk_buff::len, n, and TTP_LOW_THRESHOLD.

Referenced by irttp_open_tsap().

Here is the call graph for this function:

int irttp_data_request struct tsap_cb self,
struct sk_buff skb
 

Definition at line 302 of file irttp.c.

References ASSERT, tsap_cb::connected, EMSGSIZE, ENOBUFS, ENOTCONN, ERROR, notify_t::flow_indication, FLOW_STOP, notify_t::instance, irttp_fragment_skb(), irttp_run_tx_queue(), sk_buff::len, tsap_cb::max_seg_size, tsap_cb::notify, TRUE, TTP_HEADER, TTP_HIGH_THRESHOLD, TTP_MAX_QUEUE, TTP_SAR_UNBOUND, tsap_cb::tx_max_sdu_size, tsap_cb::tx_queue, tsap_cb::tx_sdu_busy, and WARNING.

Referenced by ircomm_ttp_data_request(), irda_sendmsg(), irlan_client_reconnect_data_channel(), irlan_eth_xmit(), irlan_provider_send_reply(), and irlan_run_ctrl_tx_queue().

Here is the call graph for this function:

void irttp_disconnect_indication void *  instance,
void *  sap,
LM_REASON  reason,
struct sk_buff
[static]
 

Definition at line 1096 of file irttp.c.

References ASSERT, dev_kfree_skb, FALSE, IRDA_DEBUG, irttp_close_tsap(), NULL, and TTP_TSAP_MAGIC.

Referenced by irttp_open_tsap().

Here is the call graph for this function:

int irttp_disconnect_request struct tsap_cb self,
struct sk_buff userdata,
int  priority
 

Definition at line 1011 of file irttp.c.

References ASSERT, tsap_cb::connected, dev_kfree_skb, tsap_cb::disconnect_pend, ENOMEM, FALSE, IRDA_DEBUG, irlmp_disconnect_request(), irttp_flush_queues(), irttp_run_rx_queue(), irttp_run_tx_queue(), irttp_start_todo_timer(), tsap_cb::lsap, tsap_cb::magic, MSECS_TO_JIFFIES, NULL, P_HIGH, P_NORMAL, ret, TRUE, TTP_MAX_HEADER, TTP_TSAP_MAGIC, and tsap_cb::tx_queue.

Referenced by ircomm_ttp_disconnect_request(), irda_destroy_socket(), irda_shutdown(), irlan_close_tsaps(), irttp_close_tsap(), and irttp_todo_expired().

Here is the call graph for this function:

void irttp_do_data_indication struct tsap_cb self,
struct sk_buff skb
 

Definition at line 1135 of file irttp.c.

References tsap_cb::close_pend, sk_buff::data, dev_kfree_skb, tsap_cb::disconnect_pend, ENOMEM, notify_t::instance, IRDA_DEBUG, tsap_cb::notify, tsap_cb::rx_queue, TRUE, and TTP_HEADER.

Referenced by irttp_run_rx_queue().

struct tsap_cb* irttp_dup struct tsap_cb orig,
void *  instance
 

Definition at line 972 of file irttp.c.

References hashbin_find(), hashbin_insert(), init_timer(), IRDA_DEBUG, irlmp_dup(), kmalloc(), memcpy, NULL, and irttp_cb::tsaps.

Referenced by irda_accept().

Here is the call graph for this function:

void irttp_flow_request struct tsap_cb self,
LOCAL_FLOW  flow
 

Definition at line 611 of file irttp.c.

References ASSERT, FALSE, FLOW_START, FLOW_STOP, IRDA_DEBUG, irttp_run_rx_queue(), tsap_cb::magic, NULL, TRUE, and TTP_TSAP_MAGIC.

Referenced by ircomm_flow_request(), irda_recvmsg_dgram(), and irda_recvmsg_stream().

Here is the call graph for this function:

void irttp_flush_queues struct tsap_cb self  )  [static]
 

Definition at line 1269 of file irttp.c.

References ASSERT, dev_kfree_skb, IRDA_DEBUG, tsap_cb::magic, NULL, tsap_cb::rx_fragments, tsap_cb::rx_queue, TTP_TSAP_MAGIC, and tsap_cb::tx_queue.

Referenced by __irttp_close_tsap(), and irttp_disconnect_request().

static void irttp_fragment_skb struct tsap_cb self,
struct sk_buff skb
[static]
 

Definition at line 1348 of file irttp.c.

References ASSERT, sk_buff::data, IRDA_DEBUG, sk_buff::len, tsap_cb::magic, tsap_cb::max_header_size, tsap_cb::max_seg_size, memcpy, NULL, TTP_HEADER, TTP_MORE, TTP_TSAP_MAGIC, and tsap_cb::tx_queue.

Referenced by irttp_data_request().

void irttp_give_credit struct tsap_cb self  ) 
 

Definition at line 466 of file irttp.c.

References ASSERT, IRDA_DEBUG, irlmp_data_request(), n, NULL, spin_lock_irqsave, spin_unlock_irqrestore, and TTP_TSAP_MAGIC.

Referenced by irttp_todo_expired().

Here is the call graph for this function:

int __init irttp_init void   ) 
 

Definition at line 80 of file irttp.c.

References ENOMEM, ERROR, hashbin_new(), HB_LOCAL, kmalloc(), memset, NULL, and TTP_MAGIC.

Referenced by irda_init().

Here is the call graph for this function:

struct tsap_cb* irttp_open_tsap __u8  stsap_sel,
int  credit,
notify_t notify
 

Definition at line 133 of file irttp.c.

References ASSERT, notify_t::connect_confirm, notify_t::connect_indication, notify_t::data_indication, notify_t::disconnect_indication, FALSE, hashbin_insert(), init_timer(), notify_t::instance, IRDA_DEBUG, irda_notify_init(), irlmp_open_lsap(), irttp_connect_confirm(), irttp_connect_indication(), irttp_data_indication(), irttp_disconnect_indication(), irttp_udata_indication(), kmalloc(), irttp_cb::magic, memset, notify_t::name, NOTIFY_MAX_NAME, NULL, lsap_cb::slsap_sel, spin_lock_init, strncpy, irttp_cb::tsaps, TTP_MAGIC, TTP_MAX_QUEUE, TTP_TSAP_MAGIC, notify_t::udata_indication, and WARNING.

Referenced by ircomm_open_tsap(), irda_open_tsap(), irlan_client_open_ctrl_tsap(), irlan_open_data_tsap(), and irlan_provider_open_ctrl_tsap().

Here is the call graph for this function:

static int irttp_param_max_sdu_size void *  instance,
irda_param_t param,
int  get
[static]
 

Definition at line 1403 of file irttp.c.

References ASSERT, irda_pv_t::i, IRDA_DEBUG, NULL, irda_param_t::pv, and TTP_TSAP_MAGIC.

static struct sk_buff * irttp_reassemble_skb struct tsap_cb self  )  [static]
 

Definition at line 1298 of file irttp.c.

References ASSERT, sk_buff::data, dev_kfree_skb, IRDA_DEBUG, sk_buff::len, tsap_cb::magic, memcpy, n, NULL, tsap_cb::rx_fragments, tsap_cb::rx_sdu_size, TTP_HEADER, and TTP_TSAP_MAGIC.

Referenced by irttp_run_rx_queue().

void irttp_run_rx_queue struct tsap_cb self  )  [static]
 

Definition at line 1173 of file irttp.c.

References tsap_cb::avail_credit, sk_buff::data, dev_kfree_skb, FALSE, IRDA_DEBUG, irda_lock(), irttp_do_data_indication(), irttp_reassemble_skb(), sk_buff::len, tsap_cb::remote_credit, tsap_cb::rx_fragments, tsap_cb::rx_max_sdu_size, tsap_cb::rx_queue, tsap_cb::rx_queue_lock, tsap_cb::rx_sdu_busy, tsap_cb::rx_sdu_size, tsap_cb::send_credit, TTP_HEADER, TTP_SAR_DISABLE, and TTP_SAR_UNBOUND.

Referenced by irttp_data_indication(), irttp_disconnect_request(), irttp_flow_request(), and irttp_todo_expired().

Here is the call graph for this function:

static void irttp_run_tx_queue struct tsap_cb self  )  [static]
 

Definition at line 389 of file irttp.c.

References sk_buff::data, FALSE, notify_t::flow_indication, FLOW_START, notify_t::instance, irda_lock(), irlmp_data_request(), irlmp_get_lap_tx_queue_len(), irttp_start_todo_timer(), LAP_MAX_QUEUE, tsap_cb::lock, tsap_cb::lsap, MSECS_TO_JIFFIES, n, tsap_cb::notify, tsap_cb::send_credit, spin_lock_irqsave, spin_unlock_irqrestore, TTP_LOW_THRESHOLD, tsap_cb::tx_queue, tsap_cb::tx_queue_lock, and tsap_cb::tx_sdu_busy.

Referenced by irttp_data_request(), irttp_disconnect_request(), and irttp_todo_expired().

Here is the call graph for this function:

static void irttp_start_todo_timer struct tsap_cb self,
int  timeout
[static]
 

Definition at line 1480 of file irttp.c.

References add_timer(), ASSERT, del_timer(), irttp_todo_expired(), jiffies, long, tsap_cb::magic, NULL, tsap_cb::todo_timer, and TTP_TSAP_MAGIC.

Referenced by irttp_close_tsap(), irttp_data_indication(), irttp_disconnect_request(), irttp_run_tx_queue(), and irttp_todo_expired().

Here is the call graph for this function:

static void irttp_todo_expired unsigned long  data  )  [static]
 

Definition at line 1429 of file irttp.c.

References FALSE, HZ, irttp_close_tsap(), irttp_disconnect_request(), irttp_give_credit(), irttp_run_rx_queue(), irttp_run_tx_queue(), irttp_start_todo_timer(), NULL, P_NORMAL, TTP_LOW_THRESHOLD, and TTP_TSAP_MAGIC.

Referenced by irttp_start_todo_timer().

Here is the call graph for this function:

static int irttp_udata_indication void *  instance,
void *  sap,
struct sk_buff skb
[static]
 

Definition at line 518 of file irttp.c.

References ASSERT, dev_kfree_skb, IRDA_DEBUG, NULL, and TTP_TSAP_MAGIC.

Referenced by irttp_open_tsap().

int irttp_udata_request struct tsap_cb self,
struct sk_buff skb
 

Definition at line 271 of file irttp.c.

References ASSERT, tsap_cb::connected, IRDA_DEBUG, irlmp_udata_request(), sk_buff::len, tsap_cb::lsap, tsap_cb::magic, tsap_cb::max_seg_size, NULL, and TTP_TSAP_MAGIC.

Referenced by irda_sendmsg_dgram(), and irlan_eth_xmit().

Here is the call graph for this function:


Variable Documentation

struct irttp_cb* irttp = NULL [static]
 

Definition at line 40 of file irttp.c.

pi_param_info_t param_info = { pi_major_call_table, 1, 0x0f, 4 } [static]
 

Definition at line 72 of file irttp.c.

pi_major_info_t pi_major_call_table[] = {{ pi_minor_call_table, 2 }} [static]
 

Definition at line 71 of file irttp.c.

pi_minor_info_t pi_minor_call_table[] [static]
 

Initial value:

Definition at line 67 of file irttp.c.