Commit e9183702 authored by Stephen Hemminger's avatar Stephen Hemminger

[IRDA]: Move irlmp routines out of irsyms.

Also, make get_{saddr,daddr} inline and rename
lmp_reasons to irlmp_reasons.
parent 94adaf93
...@@ -249,10 +249,17 @@ int irlmp_slsap_inuse(__u8 slsap); ...@@ -249,10 +249,17 @@ int irlmp_slsap_inuse(__u8 slsap);
__u8 irlmp_find_free_slsap(void); __u8 irlmp_find_free_slsap(void);
LM_REASON irlmp_convert_lap_reason(LAP_REASON); LM_REASON irlmp_convert_lap_reason(LAP_REASON);
__u32 irlmp_get_saddr(struct lsap_cb *self); static inline __u32 irlmp_get_saddr(const struct lsap_cb *self)
__u32 irlmp_get_daddr(struct lsap_cb *self); {
return (self && !self->lap) ? self->lap->saddr : 0;
}
static inline __u32 irlmp_get_daddr(const struct lsap_cb *self)
{
return (self && self->lap) ? self->lap->daddr : 0;
}
extern char *lmp_reasons[]; extern const char *irlmp_reasons[];
extern int sysctl_discovery_timeout; extern int sysctl_discovery_timeout;
extern int sysctl_discovery_slots; extern int sysctl_discovery_slots;
extern int sysctl_discovery; extern int sysctl_discovery;
......
...@@ -62,8 +62,6 @@ static const char *ias_charset_types[] = { ...@@ -62,8 +62,6 @@ static const char *ias_charset_types[] = {
static hashbin_t *iriap = NULL; static hashbin_t *iriap = NULL;
static void *service_handle; static void *service_handle;
extern char *lmp_reasons[];
static void __iriap_close(struct iriap_cb *self); static void __iriap_close(struct iriap_cb *self);
static int iriap_register_lsap(struct iriap_cb *self, __u8 slsap_sel, int mode); static int iriap_register_lsap(struct iriap_cb *self, __u8 slsap_sel, int mode);
static void iriap_disconnect_indication(void *instance, void *sap, static void iriap_disconnect_indication(void *instance, void *sap,
...@@ -291,7 +289,7 @@ static void iriap_disconnect_indication(void *instance, void *sap, ...@@ -291,7 +289,7 @@ static void iriap_disconnect_indication(void *instance, void *sap,
{ {
struct iriap_cb *self; struct iriap_cb *self;
IRDA_DEBUG(4, "%s(), reason=%s\n", __FUNCTION__, lmp_reasons[reason]); IRDA_DEBUG(4, "%s(), reason=%s\n", __FUNCTION__, irlmp_reasons[reason]);
self = (struct iriap_cb *) instance; self = (struct iriap_cb *) instance;
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
********************************************************************/ ********************************************************************/
#include <linux/config.h> #include <linux/config.h>
#include <linux/module.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/skbuff.h> #include <linux/skbuff.h>
...@@ -49,11 +50,12 @@ struct irlmp_cb *irlmp = NULL; ...@@ -49,11 +50,12 @@ struct irlmp_cb *irlmp = NULL;
/* These can be altered by the sysctl interface */ /* These can be altered by the sysctl interface */
int sysctl_discovery = 0; int sysctl_discovery = 0;
int sysctl_discovery_timeout = 3; /* 3 seconds by default */ int sysctl_discovery_timeout = 3; /* 3 seconds by default */
EXPORT_SYMBOL(sysctl_discovery_timeout);
int sysctl_discovery_slots = 6; /* 6 slots by default */ int sysctl_discovery_slots = 6; /* 6 slots by default */
int sysctl_lap_keepalive_time = LM_IDLE_TIMEOUT * 1000 / HZ; int sysctl_lap_keepalive_time = LM_IDLE_TIMEOUT * 1000 / HZ;
char sysctl_devname[65]; char sysctl_devname[65];
char *lmp_reasons[] = { const char *irlmp_reasons[] = {
"ERROR, NOT USED", "ERROR, NOT USED",
"LM_USER_REQUEST", "LM_USER_REQUEST",
"LM_LAP_DISCONNECT", "LM_LAP_DISCONNECT",
...@@ -62,8 +64,7 @@ char *lmp_reasons[] = { ...@@ -62,8 +64,7 @@ char *lmp_reasons[] = {
"LM_INIT_DISCONNECT", "LM_INIT_DISCONNECT",
"ERROR, NOT USED", "ERROR, NOT USED",
}; };
EXPORT_SYMBOL(irlmp_reasons);
__u8 *irlmp_hint_to_service(__u8 *hint);
/* /*
* Function irlmp_init (void) * Function irlmp_init (void)
...@@ -189,6 +190,7 @@ struct lsap_cb *irlmp_open_lsap(__u8 slsap_sel, notify_t *notify, __u8 pid) ...@@ -189,6 +190,7 @@ struct lsap_cb *irlmp_open_lsap(__u8 slsap_sel, notify_t *notify, __u8 pid)
return self; return self;
} }
EXPORT_SYMBOL(irlmp_open_lsap);
/* /*
* Function __irlmp_close_lsap (self) * Function __irlmp_close_lsap (self)
...@@ -264,6 +266,7 @@ void irlmp_close_lsap(struct lsap_cb *self) ...@@ -264,6 +266,7 @@ void irlmp_close_lsap(struct lsap_cb *self)
} }
__irlmp_close_lsap(self); __irlmp_close_lsap(self);
} }
EXPORT_SYMBOL(irlmp_close_lsap);
/* /*
* Function irlmp_register_irlap (saddr, notify) * Function irlmp_register_irlap (saddr, notify)
...@@ -496,6 +499,7 @@ int irlmp_connect_request(struct lsap_cb *self, __u8 dlsap_sel, ...@@ -496,6 +499,7 @@ int irlmp_connect_request(struct lsap_cb *self, __u8 dlsap_sel,
dev_kfree_skb(tx_skb); dev_kfree_skb(tx_skb);
return ret; return ret;
} }
EXPORT_SYMBOL(irlmp_connect_request);
/* /*
* Function irlmp_connect_indication (self) * Function irlmp_connect_indication (self)
...@@ -569,6 +573,7 @@ int irlmp_connect_response(struct lsap_cb *self, struct sk_buff *userdata) ...@@ -569,6 +573,7 @@ int irlmp_connect_response(struct lsap_cb *self, struct sk_buff *userdata)
return 0; return 0;
} }
EXPORT_SYMBOL(irlmp_connect_response);
/* /*
* Function irlmp_connect_confirm (handle, skb) * Function irlmp_connect_confirm (handle, skb)
...@@ -667,6 +672,7 @@ struct lsap_cb *irlmp_dup(struct lsap_cb *orig, void *instance) ...@@ -667,6 +672,7 @@ struct lsap_cb *irlmp_dup(struct lsap_cb *orig, void *instance)
return new; return new;
} }
EXPORT_SYMBOL(irlmp_dup);
/* /*
* Function irlmp_disconnect_request (handle, userdata) * Function irlmp_disconnect_request (handle, userdata)
...@@ -729,6 +735,7 @@ int irlmp_disconnect_request(struct lsap_cb *self, struct sk_buff *userdata) ...@@ -729,6 +735,7 @@ int irlmp_disconnect_request(struct lsap_cb *self, struct sk_buff *userdata)
return 0; return 0;
} }
EXPORT_SYMBOL(irlmp_disconnect_request);
/* /*
* Function irlmp_disconnect_indication (reason, userdata) * Function irlmp_disconnect_indication (reason, userdata)
...@@ -740,7 +747,7 @@ void irlmp_disconnect_indication(struct lsap_cb *self, LM_REASON reason, ...@@ -740,7 +747,7 @@ void irlmp_disconnect_indication(struct lsap_cb *self, LM_REASON reason,
{ {
struct lsap_cb *lsap; struct lsap_cb *lsap;
IRDA_DEBUG(1, "%s(), reason=%s\n", __FUNCTION__, lmp_reasons[reason]); IRDA_DEBUG(1, "%s(), reason=%s\n", __FUNCTION__, irlmp_reasons[reason]);
ASSERT(self != NULL, return;); ASSERT(self != NULL, return;);
ASSERT(self->magic == LMP_LSAP_MAGIC, return;); ASSERT(self->magic == LMP_LSAP_MAGIC, return;);
...@@ -900,6 +907,7 @@ void irlmp_discovery_request(int nslots) ...@@ -900,6 +907,7 @@ void irlmp_discovery_request(int nslots)
* Jean II */ * Jean II */
} }
} }
EXPORT_SYMBOL(irlmp_discovery_request);
/* /*
* Function irlmp_get_discoveries (pn, mask, slots) * Function irlmp_get_discoveries (pn, mask, slots)
...@@ -931,6 +939,7 @@ struct irda_device_info *irlmp_get_discoveries(int *pn, __u16 mask, int nslots) ...@@ -931,6 +939,7 @@ struct irda_device_info *irlmp_get_discoveries(int *pn, __u16 mask, int nslots)
/* Return current cached discovery log */ /* Return current cached discovery log */
return(irlmp_copy_discoveries(irlmp->cachelog, pn, mask, TRUE)); return(irlmp_copy_discoveries(irlmp->cachelog, pn, mask, TRUE));
} }
EXPORT_SYMBOL(irlmp_get_discoveries);
/* /*
* Function irlmp_notify_client (log) * Function irlmp_notify_client (log)
...@@ -1122,6 +1131,7 @@ int irlmp_data_request(struct lsap_cb *self, struct sk_buff *userdata) ...@@ -1122,6 +1131,7 @@ int irlmp_data_request(struct lsap_cb *self, struct sk_buff *userdata)
return ret; return ret;
} }
EXPORT_SYMBOL(irlmp_data_request);
/* /*
* Function irlmp_data_indication (handle, skb) * Function irlmp_data_indication (handle, skb)
...@@ -1433,7 +1443,7 @@ __u8 *irlmp_hint_to_service(__u8 *hint) ...@@ -1433,7 +1443,7 @@ __u8 *irlmp_hint_to_service(__u8 *hint)
} }
#endif #endif
const __u16 service_hint_mapping[S_END][2] = { static const __u16 service_hint_mapping[S_END][2] = {
{ HINT_PNP, 0 }, /* S_PNP */ { HINT_PNP, 0 }, /* S_PNP */
{ HINT_PDA, 0 }, /* S_PDA */ { HINT_PDA, 0 }, /* S_PDA */
{ HINT_COMPUTER, 0 }, /* S_COMPUTER */ { HINT_COMPUTER, 0 }, /* S_COMPUTER */
...@@ -1463,6 +1473,7 @@ __u16 irlmp_service_to_hint(int service) ...@@ -1463,6 +1473,7 @@ __u16 irlmp_service_to_hint(int service)
return hint.word; return hint.word;
} }
EXPORT_SYMBOL(irlmp_service_to_hint);
/* /*
* Function irlmp_register_service (service) * Function irlmp_register_service (service)
...@@ -1490,6 +1501,7 @@ void *irlmp_register_service(__u16 hints) ...@@ -1490,6 +1501,7 @@ void *irlmp_register_service(__u16 hints)
return (void *)service; return (void *)service;
} }
EXPORT_SYMBOL(irlmp_register_service);
/* /*
* Function irlmp_unregister_service (handle) * Function irlmp_unregister_service (handle)
...@@ -1532,6 +1544,7 @@ int irlmp_unregister_service(void *handle) ...@@ -1532,6 +1544,7 @@ int irlmp_unregister_service(void *handle)
spin_unlock_irqrestore(&irlmp->services->hb_spinlock, flags); spin_unlock_irqrestore(&irlmp->services->hb_spinlock, flags);
return 0; return 0;
} }
EXPORT_SYMBOL(irlmp_unregister_service);
/* /*
* Function irlmp_register_client (hint_mask, callback1, callback2) * Function irlmp_register_client (hint_mask, callback1, callback2)
...@@ -1568,6 +1581,7 @@ void *irlmp_register_client(__u16 hint_mask, DISCOVERY_CALLBACK1 disco_clb, ...@@ -1568,6 +1581,7 @@ void *irlmp_register_client(__u16 hint_mask, DISCOVERY_CALLBACK1 disco_clb,
return (void *) client; return (void *) client;
} }
EXPORT_SYMBOL(irlmp_register_client);
/* /*
* Function irlmp_update_client (handle, hint_mask, callback1, callback2) * Function irlmp_update_client (handle, hint_mask, callback1, callback2)
...@@ -1599,6 +1613,7 @@ int irlmp_update_client(void *handle, __u16 hint_mask, ...@@ -1599,6 +1613,7 @@ int irlmp_update_client(void *handle, __u16 hint_mask,
return 0; return 0;
} }
EXPORT_SYMBOL(irlmp_update_client);
/* /*
* Function irlmp_unregister_client (handle) * Function irlmp_unregister_client (handle)
...@@ -1628,6 +1643,7 @@ int irlmp_unregister_client(void *handle) ...@@ -1628,6 +1643,7 @@ int irlmp_unregister_client(void *handle)
return 0; return 0;
} }
EXPORT_SYMBOL(irlmp_unregister_client);
/* /*
* Function irlmp_slsap_inuse (slsap) * Function irlmp_slsap_inuse (slsap)
...@@ -1765,22 +1781,6 @@ LM_REASON irlmp_convert_lap_reason( LAP_REASON lap_reason) ...@@ -1765,22 +1781,6 @@ LM_REASON irlmp_convert_lap_reason( LAP_REASON lap_reason)
return reason; return reason;
} }
__u32 irlmp_get_saddr(struct lsap_cb *self)
{
ASSERT(self != NULL, return 0;);
ASSERT(self->lap != NULL, return 0;);
return self->lap->saddr;
}
__u32 irlmp_get_daddr(struct lsap_cb *self)
{
ASSERT(self != NULL, return 0;);
ASSERT(self->lap != NULL, return 0;);
return self->lap->daddr;
}
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
struct irlmp_iter_state { struct irlmp_iter_state {
......
...@@ -79,27 +79,6 @@ EXPORT_SYMBOL(irda_param_extract_all); ...@@ -79,27 +79,6 @@ EXPORT_SYMBOL(irda_param_extract_all);
EXPORT_SYMBOL(irda_param_pack); EXPORT_SYMBOL(irda_param_pack);
EXPORT_SYMBOL(irda_param_unpack); EXPORT_SYMBOL(irda_param_unpack);
/* IrLMP */
EXPORT_SYMBOL(irlmp_discovery_request);
EXPORT_SYMBOL(irlmp_get_discoveries);
EXPORT_SYMBOL(sysctl_discovery_timeout);
EXPORT_SYMBOL(irlmp_register_client);
EXPORT_SYMBOL(irlmp_unregister_client);
EXPORT_SYMBOL(irlmp_update_client);
EXPORT_SYMBOL(irlmp_register_service);
EXPORT_SYMBOL(irlmp_unregister_service);
EXPORT_SYMBOL(irlmp_service_to_hint);
EXPORT_SYMBOL(irlmp_data_request);
EXPORT_SYMBOL(irlmp_open_lsap);
EXPORT_SYMBOL(irlmp_close_lsap);
EXPORT_SYMBOL(irlmp_connect_request);
EXPORT_SYMBOL(irlmp_connect_response);
EXPORT_SYMBOL(irlmp_disconnect_request);
EXPORT_SYMBOL(irlmp_get_daddr);
EXPORT_SYMBOL(irlmp_get_saddr);
EXPORT_SYMBOL(irlmp_dup);
EXPORT_SYMBOL(lmp_reasons);
/* IrLAP */ /* IrLAP */
EXPORT_SYMBOL(irlap_open); EXPORT_SYMBOL(irlap_open);
EXPORT_SYMBOL(irlap_close); EXPORT_SYMBOL(irlap_close);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment