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

irlap.c File Reference

#include <linux/config.h>
#include <linux/malloc.h>
#include <linux/string.h>
#include <linux/skbuff.h>
#include <linux/delay.h>
#include <linux/proc_fs.h>
#include <linux/init.h>
#include <linux/random.h>
#include <net/irda/irda.h>
#include <net/irda/irda_device.h>
#include <net/irda/irqueue.h>
#include <net/irda/irlmp.h>
#include <net/irda/irlmp_frame.h>
#include <net/irda/irlap_frame.h>
#include <net/irda/irlap.h>
#include <net/irda/timer.h>
#include <net/irda/qos.h>
#include <net/irda/irlap_comp.h>

Include dependency graph for irlap.c:

Go to the source code of this file.

Functions

static void __irlap_close (struct irlap_cb *self)
int __init irlap_init (void)
void irlap_cleanup (void)
irlap_cbirlap_open (struct device *dev, struct qos_info *qos)
void irlap_close (struct irlap_cb *self)
void irlap_connect_indication (struct irlap_cb *self, struct sk_buff *skb)
void irlap_connect_response (struct irlap_cb *self, struct sk_buff *skb)
void irlap_connect_request (struct irlap_cb *self, __u32 daddr, struct qos_info *qos_user, int sniff)
void irlap_connect_confirm (struct irlap_cb *self, struct sk_buff *skb)
void irlap_data_indication (struct irlap_cb *self, struct sk_buff *skb, int unreliable)
void irlap_data_request (struct irlap_cb *self, struct sk_buff *skb, int unreliable)
void irlap_disconnect_request (struct irlap_cb *self)
void irlap_disconnect_indication (struct irlap_cb *self, LAP_REASON reason)
void irlap_discovery_request (struct irlap_cb *self, discovery_t *discovery)
void irlap_discovery_confirm (struct irlap_cb *self, hashbin_t *discovery_log)
void irlap_discovery_indication (struct irlap_cb *self, discovery_t *discovery)
void irlap_status_indication (int quality_of_link)
void irlap_reset_indication (struct irlap_cb *self)
void irlap_reset_confirm (void)
int irlap_generate_rand_time_slot (int S, int s)
void irlap_update_nr_received (struct irlap_cb *self, int nr)
int irlap_validate_ns_received (struct irlap_cb *self, int ns)
int irlap_validate_nr_received (struct irlap_cb *self, int nr)
void irlap_initiate_connection_state (struct irlap_cb *self)
void irlap_wait_min_turn_around (struct irlap_cb *self, struct qos_info *qos)
void irlap_flush_all_queues (struct irlap_cb *self)
void irlap_change_speed (struct irlap_cb *self, __u32 speed, int now)
void irlap_init_qos_capabilities (struct irlap_cb *self, struct qos_info *qos_user)
void irlap_apply_default_connection_parameters (struct irlap_cb *self)
void irlap_apply_connection_parameters (struct irlap_cb *self)
void irlap_set_local_busy (struct irlap_cb *self, int status)

Variables

hashbin_tirlap = NULL
int sysctl_slot_timeout = SLOT_TIMEOUT * 1000 / HZ
static char * lap_reasons []


Function Documentation

static void __irlap_close struct irlap_cb self  )  [static]
 

Definition at line 170 of file irlap.c.

References ASSERT, irlap_cb::backoff_timer, del_timer(), irlap_cb::discovery_timer, irlap_cb::final_timer, irlap_flush_all_queues(), kfree(), LAP_MAGIC, irlap_cb::magic, irlap_cb::media_busy_timer, NULL, irlap_cb::poll_timer, irlap_cb::query_timer, irlap_cb::slot_timer, and irlap_cb::wd_timer.

Referenced by irlap_cleanup(), and irlap_close().

Here is the call graph for this function:

void irlap_apply_connection_parameters struct irlap_cb self  ) 
 

Definition at line 1046 of file irlap.c.

References ASSERT, qos_info::baud_rate, FALSE, HZ, IRDA_DEBUG, irda_set_compression(), irlap_change_speed(), irlap_compressor_init(), irlap_max_line_capacity(), LAP_MAGIC, qos_info::link_disc_time, irlap_cb::magic, qos_info::max_turn_time, irlap_cb::N1, irlap_cb::N2, NULL, irlap_cb::qos_tx, and qos_value_t::value.

Referenced by irlap_state_conn(), and irlap_state_setup().

Here is the call graph for this function:

void irlap_apply_default_connection_parameters struct irlap_cb self  ) 
 

Definition at line 988 of file irlap.c.

References ASSERT, irlap_cb::caddr, FALSE, FINAL_TIMEOUT, get_random_bytes(), IRDA_DEBUG, irda_device_set_media_busy(), irlap_change_speed(), irlap_flush_all_queues(), LAP_MAGIC, irlap_cb::magic, irlap_cb::netdev, NULL, POLL_TIMEOUT, sysctl_slot_timeout, TRUE, WD_TIMEOUT, and x00.

Referenced by irlap_open(), irlap_state_nrm_p(), irlap_state_nrm_s(), irlap_state_pclose(), irlap_state_reset(), and irlap_state_sclose().

Here is the call graph for this function:

void irlap_change_speed struct irlap_cb self,
__u32  speed,
int  now
 

Definition at line 864 of file irlap.c.

References ASSERT, IRDA_DEBUG, irda_device_change_speed(), LAP_MAGIC, irlap_cb::magic, irlap_cb::netdev, and NULL.

Referenced by irlap_apply_connection_parameters(), and irlap_apply_default_connection_parameters().

Here is the call graph for this function:

void irlap_cleanup void   ) 
 

Definition at line 93 of file irlap.c.

References __irlap_close(), ASSERT, hashbin_delete(), irlap_compressors, kfree(), and NULL.

Here is the call graph for this function:

void irlap_close struct irlap_cb self  ) 
 

Definition at line 198 of file irlap.c.

References __irlap_close(), ASSERT, hashbin_remove(), IRDA_DEBUG, irlap_disconnect_indication(), irlmp_unregister_link(), LAP_DISC_INDICATION, LAP_MAGIC, irlap_cb::magic, NULL, and irlap_cb::saddr.

Referenced by irport_net_close(), irtty_net_close(), nsc_ircc_net_close(), toshoboe_net_close(), and w83977af_net_close().

Here is the call graph for this function:

void irlap_connect_confirm struct irlap_cb self,
struct sk_buff skb
 

Definition at line 288 of file irlap.c.

References ASSERT, notify_t::instance, IRDA_DEBUG, irlmp_link_connect_confirm(), LAP_MAGIC, irlap_cb::magic, irlap_cb::notify, NULL, and irlap_cb::qos_tx.

Referenced by irlap_state_setup().

Here is the call graph for this function:

void irlap_connect_indication struct irlap_cb self,
struct sk_buff skb
 

Definition at line 227 of file irlap.c.

References ASSERT, irlap_cb::daddr, notify_t::instance, IRDA_DEBUG, irlap_init_qos_capabilities(), irlmp_link_connect_indication(), LAP_MAGIC, irlap_cb::magic, irlap_cb::notify, NULL, irlap_cb::qos_tx, and irlap_cb::saddr.

Referenced by irlap_state_ndm().

Here is the call graph for this function:

void irlap_connect_request struct irlap_cb self,
__u32  daddr,
struct qos_info qos_user,
int  sniff
 

Definition at line 260 of file irlap.c.

References ASSERT, CONNECT_REQUEST, IRDA_DEBUG, irlap_do_event(), irlap_init_qos_capabilities(), LAP_MAGIC, LAP_NDM, irlap_cb::magic, irlap_cb::media_busy, NULL, irlap_cb::state, and TRUE.

Referenced by irlmp_state_standby().

Here is the call graph for this function:

void irlap_connect_response struct irlap_cb self,
struct sk_buff skb
 

Definition at line 246 of file irlap.c.

References CONNECT_RESPONSE, IRDA_DEBUG, irlap_do_event(), and NULL.

Referenced by irlmp_state_standby(), and irlmp_state_u_connect().

Here is the call graph for this function:

void irlap_data_indication struct irlap_cb self,
struct sk_buff skb,
int  unreliable
 

Definition at line 305 of file irlap.c.

References notify_t::instance, IRDA_DEBUG, irlap_decompress_frame(), irlmp_link_data_indication(), LAP_ADDR_HEADER, LAP_CTRL_HEADER, irlap_cb::notify, and irlap_cb::qos_tx.

Referenced by irlap_state_nrm_p(), and irlap_state_nrm_s().

Here is the call graph for this function:

void irlap_data_request struct irlap_cb self,
struct sk_buff skb,
int  unreliable
 

Definition at line 330 of file irlap.c.

References ASSERT, sk_buff::data, I_FRAME, IRDA_DEBUG, irlap_compress_frame(), irlap_do_event(), LAP_ADDR_HEADER, LAP_CTRL_HEADER, LAP_MAGIC, LAP_XMIT_P, LAP_XMIT_S, irlap_cb::magic, NULL, irlap_cb::qos_tx, SEND_I_CMD, irlap_cb::state, irlap_cb::txq, and UI_FRAME.

Referenced by irlmp_send_data_pdu(), and irlmp_send_lcf_pdu().

Here is the call graph for this function:

void irlap_disconnect_indication struct irlap_cb self,
LAP_REASON  reason
 

Definition at line 470 of file irlap.c.

References ASSERT, ERROR, notify_t::instance, IRDA_DEBUG, irda_free_compression(), irlap_do_event(), irlap_flush_all_queues(), irlmp_link_disconnect_indication(), LAP_DISC_INDICATION, LAP_FOUND_NONE, LAP_MAGIC, LAP_MEDIA_BUSY, LAP_NO_RESPONSE, lap_reasons, LAP_RESET_INDICATION, irlap_cb::magic, irlap_cb::notify, NULL, and RESET_REQUEST.

Referenced by irlap_close(), irlap_state_ndm(), irlap_state_nrm_p(), irlap_state_nrm_s(), irlap_state_pclose(), irlap_state_reset(), irlap_state_sclose(), and irlap_state_setup().

Here is the call graph for this function:

void irlap_disconnect_request struct irlap_cb self  ) 
 

Definition at line 434 of file irlap.c.

References ASSERT, DISCONNECT_REQUEST, IRDA_DEBUG, irlap_do_event(), LAP_CONN, LAP_MAGIC, LAP_RESET_CHECK, LAP_RESET_WAIT, LAP_XMIT_P, LAP_XMIT_S, irlap_cb::magic, NULL, irlap_cb::state, TRUE, and irlap_cb::txq.

Referenced by irlmp_state_active().

Here is the call graph for this function:

void irlap_discovery_confirm struct irlap_cb self,
hashbin_t discovery_log
 

Definition at line 569 of file irlap.c.

References ASSERT, FALSE, HASHBIN_GET_SIZE, notify_t::instance, irda_device_set_media_busy(), irlmp_link_discovery_confirm(), LAP_MAGIC, irlap_cb::magic, irlap_cb::netdev, irlap_cb::notify, and NULL.

Referenced by irlap_discovery_request(), irlap_state_ndm(), and irlap_state_query().

Here is the call graph for this function:

void irlap_discovery_indication struct irlap_cb self,
discovery_t discovery
 

Definition at line 594 of file irlap.c.

References ASSERT, notify_t::instance, IRDA_DEBUG, irlmp_link_discovery_indication(), LAP_MAGIC, irlap_cb::magic, irlap_cb::notify, and NULL.

Referenced by irlap_state_reply().

Here is the call graph for this function:

void irlap_discovery_request struct irlap_cb self,
discovery_t discovery
 

Definition at line 506 of file irlap.c.

References ASSERT, irlap_info::discovery, irlap_cb::discovery_log, DISCOVERY_REQUEST, ERROR, hashbin_delete(), hashbin_new(), HB_LOCAL, HZ, IRDA_DEBUG, irlap_discovery_confirm(), irlap_do_event(), kfree(), LAP_MAGIC, LAP_NDM, irlap_cb::magic, discovery_t::nslots, NULL, irlap_info::s, irlap_info::S, irlap_cb::state, and sysctl_slot_timeout.

Referenced by irlmp_state_standby().

Here is the call graph for this function:

void irlap_flush_all_queues struct irlap_cb self  ) 
 

Definition at line 832 of file irlap.c.

References ASSERT, dev_kfree_skb, LAP_MAGIC, irlap_cb::magic, NULL, irlap_cb::txq, irlap_cb::txq_ultra, and irlap_cb::wx_list.

Referenced by __irlap_close(), irlap_apply_default_connection_parameters(), irlap_disconnect_indication(), irlap_state_nrm_p(), irlap_state_nrm_s(), irlap_state_reset_check(), irlap_state_reset_wait(), irlap_state_xmit_p(), and irlap_state_xmit_s().

int irlap_generate_rand_time_slot int  S,
int  s
 

Definition at line 665 of file irlap.c.

References ASSERT, jiffies, and irlap_info::slot.

Referenced by irlap_state_ndm().

int __init irlap_init void   ) 
 

Definition at line 72 of file irlap.c.

References ENOMEM, ERROR, hashbin_new(), HB_LOCAL, irlap_compressors, NULL, and WARNING.

Referenced by irda_init().

Here is the call graph for this function:

void irlap_init_qos_capabilities struct irlap_cb self,
struct qos_info qos_user
 

Definition at line 930 of file irlap.c.

References ASSERT, qos_info::baud_rate, qos_value_t::bits, qos_info::data_size, IRDA_DEBUG, irda_init_max_qos_capabilies(), irda_qos_bits_to_value(), irda_qos_compute_intersection(), LAP_MAGIC, qos_info::link_disc_time, irlap_cb::magic, qos_info::max_turn_time, irlap_cb::netdev, NULL, irlap_cb::qos_dev, and irlap_cb::qos_rx.

Referenced by irlap_connect_indication(), and irlap_connect_request().

Here is the call graph for this function:

void irlap_initiate_connection_state struct irlap_cb self  ) 
 

Definition at line 776 of file irlap.c.

References ASSERT, FALSE, IRDA_DEBUG, LAP_MAGIC, and NULL.

Referenced by irlap_state_conn(), irlap_state_reset(), irlap_state_reset_check(), and irlap_state_setup().

struct irlap_cb* irlap_open struct device *  dev,
struct qos_info qos
 

Definition at line 110 of file irlap.c.

References get_random_bytes(), hashbin_insert(), init_timer(), IRDA_DEBUG, irlap_apply_default_connection_parameters(), irlap_next_state(), irlmp_register_link(), kmalloc(), LAP_MAGIC, LAP_NDM, LAP_OFFLINE, memcpy, memset, and NULL.

Referenced by irport_net_open(), irtty_net_open(), nsc_ircc_net_open(), toshoboe_net_open(), and w83977af_net_open().

Here is the call graph for this function:

void irlap_reset_confirm void   ) 
 

Definition at line 653 of file irlap.c.

References IRDA_DEBUG.

Referenced by irlap_state_reset().

void irlap_reset_indication struct irlap_cb self  ) 
 

Definition at line 634 of file irlap.c.

References ASSERT, IRDA_DEBUG, irlap_do_event(), LAP_MAGIC, LAP_RESET_WAIT, irlap_cb::magic, NULL, RESET_REQUEST, RESET_RESPONSE, and irlap_cb::state.

Referenced by irlap_state_nrm_p(), and irlap_state_nrm_s().

Here is the call graph for this function:

void irlap_set_local_busy struct irlap_cb self,
int  status
 

Definition at line 1114 of file irlap.c.

References IRDA_DEBUG.

void irlap_status_indication int  quality_of_link  ) 
 

Definition at line 613 of file irlap.c.

References irlmp_status_indication(), LOCK_NO_CHANGE, MESSAGE, STATUS_NO_ACTIVITY, and STATUS_NOISY.

Referenced by irlap_state_nrm_p(), and irlap_state_nrm_s().

Here is the call graph for this function:

void irlap_update_nr_received struct irlap_cb self,
int  nr
 

Definition at line 685 of file irlap.c.

References count, dev_kfree_skb, NULL, irlap_cb::va, irlap_cb::vs, and irlap_cb::wx_list.

Referenced by irlap_state_nrm_p(), and irlap_state_nrm_s().

int irlap_validate_nr_received struct irlap_cb self,
int  nr
 

Definition at line 746 of file irlap.c.

References IRDA_DEBUG, NR_EXPECTED, NR_INVALID, NR_UNEXPECTED, irlap_cb::va, and irlap_cb::vs.

Referenced by irlap_state_nrm_p(), and irlap_state_nrm_s().

int irlap_validate_ns_received struct irlap_cb self,
int  ns
 

Definition at line 727 of file irlap.c.

References NS_EXPECTED, NS_UNEXPECTED, and irlap_cb::vr.

Referenced by irlap_state_nrm_p(), and irlap_state_nrm_s().

void irlap_wait_min_turn_around struct irlap_cb self,
struct qos_info qos
 

Definition at line 803 of file irlap.c.

References qos_info::baud_rate, irlap_min_turn_time_in_bytes(), qos_info::min_turn_time, speed, and qos_value_t::value.

Referenced by irlap_resend_rejected_frame(), irlap_resend_rejected_frames(), irlap_send_test_frame(), irlap_state_nrm_p(), irlap_state_nrm_s(), irlap_state_pclose(), irlap_state_reset(), irlap_state_reset_check(), irlap_state_reset_wait(), irlap_state_sclose(), and irlap_state_xmit_p().

Here is the call graph for this function:


Variable Documentation

hashbin_t* irlap = NULL
 

Definition at line 51 of file irlap.c.

char* lap_reasons[] [static]
 

Initial value:

 {
        "ERROR, NOT USED",
        "LAP_DISC_INDICATION",
        "LAP_NO_RESPONSE",
        "LAP_RESET_INDICATION",
        "LAP_FOUND_NONE",
        "LAP_MEDIA_BUSY",
        "LAP_PRIMARY_CONFLICT",
        "ERROR, NOT USED",
}

Definition at line 56 of file irlap.c.

Referenced by irlap_disconnect_indication().

int sysctl_slot_timeout = SLOT_TIMEOUT * 1000 / HZ
 

Definition at line 52 of file irlap.c.

Referenced by irlap_apply_default_connection_parameters(), and irlap_discovery_request().