aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/atmdev.h
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2005-12-06 17:31:30 -0500
committerLen Brown <len.brown@intel.com>2005-12-06 17:31:30 -0500
commit3d5271f9883cba7b54762bc4fe027d4172f06db7 (patch)
treeab8a881a14478598a0c8bda0d26c62cdccfffd6d /include/linux/atmdev.h
parent378b2556f4e09fa6f87ff0cb5c4395ff28257d02 (diff)
parent9115a6c787596e687df03010d97fccc5e0762506 (diff)
Pull release into acpica branch
Diffstat (limited to 'include/linux/atmdev.h')
-rw-r--r--include/linux/atmdev.h30
1 files changed, 20 insertions, 10 deletions
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h
index 9f374cfa1b05..b203ea82a0a8 100644
--- a/include/linux/atmdev.h
+++ b/include/linux/atmdev.h
@@ -7,7 +7,6 @@
7#define LINUX_ATMDEV_H 7#define LINUX_ATMDEV_H
8 8
9 9
10#include <linux/config.h>
11#include <linux/atmapi.h> 10#include <linux/atmapi.h>
12#include <linux/atm.h> 11#include <linux/atm.h>
13#include <linux/atmioc.h> 12#include <linux/atmioc.h>
@@ -76,6 +75,13 @@ struct atm_dev_stats {
76 /* set interface ESI */ 75 /* set interface ESI */
77#define ATM_SETESIF _IOW('a',ATMIOC_ITF+13,struct atmif_sioc) 76#define ATM_SETESIF _IOW('a',ATMIOC_ITF+13,struct atmif_sioc)
78 /* force interface ESI */ 77 /* force interface ESI */
78#define ATM_ADDLECSADDR _IOW('a', ATMIOC_ITF+14, struct atmif_sioc)
79 /* register a LECS address */
80#define ATM_DELLECSADDR _IOW('a', ATMIOC_ITF+15, struct atmif_sioc)
81 /* unregister a LECS address */
82#define ATM_GETLECSADDR _IOW('a', ATMIOC_ITF+16, struct atmif_sioc)
83 /* retrieve LECS address(es) */
84
79#define ATM_GETSTAT _IOW('a',ATMIOC_SARCOM+0,struct atmif_sioc) 85#define ATM_GETSTAT _IOW('a',ATMIOC_SARCOM+0,struct atmif_sioc)
80 /* get AAL layer statistics */ 86 /* get AAL layer statistics */
81#define ATM_GETSTATZ _IOW('a',ATMIOC_SARCOM+1,struct atmif_sioc) 87#define ATM_GETSTATZ _IOW('a',ATMIOC_SARCOM+1,struct atmif_sioc)
@@ -203,6 +209,7 @@ struct atm_cirange {
203 209
204#ifdef __KERNEL__ 210#ifdef __KERNEL__
205 211
212#include <linux/config.h>
206#include <linux/wait.h> /* wait_queue_head_t */ 213#include <linux/wait.h> /* wait_queue_head_t */
207#include <linux/time.h> /* struct timeval */ 214#include <linux/time.h> /* struct timeval */
208#include <linux/net.h> 215#include <linux/net.h>
@@ -267,7 +274,7 @@ enum {
267 274
268 275
269enum { 276enum {
270 ATM_DF_CLOSE, /* close device when last VCC is closed */ 277 ATM_DF_REMOVED, /* device was removed from atm_devs list */
271}; 278};
272 279
273 280
@@ -328,6 +335,8 @@ struct atm_dev_addr {
328 struct list_head entry; /* next address */ 335 struct list_head entry; /* next address */
329}; 336};
330 337
338enum atm_addr_type_t { ATM_ADDR_LOCAL, ATM_ADDR_LECS };
339
331struct atm_dev { 340struct atm_dev {
332 const struct atmdev_ops *ops; /* device operations; NULL if unused */ 341 const struct atmdev_ops *ops; /* device operations; NULL if unused */
333 const struct atmphy_ops *phy; /* PHY operations, may be undefined */ 342 const struct atmphy_ops *phy; /* PHY operations, may be undefined */
@@ -338,6 +347,7 @@ struct atm_dev {
338 void *phy_data; /* private PHY date */ 347 void *phy_data; /* private PHY date */
339 unsigned long flags; /* device flags (ATM_DF_*) */ 348 unsigned long flags; /* device flags (ATM_DF_*) */
340 struct list_head local; /* local ATM addresses */ 349 struct list_head local; /* local ATM addresses */
350 struct list_head lecs; /* LECS ATM addresses learned via ILMI */
341 unsigned char esi[ESI_LEN]; /* ESI ("MAC" addr) */ 351 unsigned char esi[ESI_LEN]; /* ESI ("MAC" addr) */
342 struct atm_cirange ci_range; /* VPI/VCI range */ 352 struct atm_cirange ci_range; /* VPI/VCI range */
343 struct k_atm_dev_stats stats; /* statistics */ 353 struct k_atm_dev_stats stats; /* statistics */
@@ -405,7 +415,6 @@ struct atm_dev *atm_dev_register(const char *type,const struct atmdev_ops *ops,
405 int number,unsigned long *flags); /* number == -1: pick first available */ 415 int number,unsigned long *flags); /* number == -1: pick first available */
406struct atm_dev *atm_dev_lookup(int number); 416struct atm_dev *atm_dev_lookup(int number);
407void atm_dev_deregister(struct atm_dev *dev); 417void atm_dev_deregister(struct atm_dev *dev);
408void shutdown_atm_dev(struct atm_dev *dev);
409void vcc_insert_socket(struct sock *sk); 418void vcc_insert_socket(struct sock *sk);
410 419
411 420
@@ -447,18 +456,19 @@ static inline void atm_dev_hold(struct atm_dev *dev)
447 456
448static inline void atm_dev_put(struct atm_dev *dev) 457static inline void atm_dev_put(struct atm_dev *dev)
449{ 458{
450 atomic_dec(&dev->refcnt); 459 if (atomic_dec_and_test(&dev->refcnt)) {
451 460 BUG_ON(!test_bit(ATM_DF_REMOVED, &dev->flags));
452 if ((atomic_read(&dev->refcnt) == 1) && 461 if (dev->ops->dev_close)
453 test_bit(ATM_DF_CLOSE,&dev->flags)) 462 dev->ops->dev_close(dev);
454 shutdown_atm_dev(dev); 463 kfree(dev);
464 }
455} 465}
456 466
457 467
458int atm_charge(struct atm_vcc *vcc,int truesize); 468int atm_charge(struct atm_vcc *vcc,int truesize);
459struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc,int pdu_size, 469struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc,int pdu_size,
460 int gfp_flags); 470 gfp_t gfp_flags);
461int atm_pcr_goal(struct atm_trafprm *tp); 471int atm_pcr_goal(const struct atm_trafprm *tp);
462 472
463void vcc_release_async(struct atm_vcc *vcc, int reply); 473void vcc_release_async(struct atm_vcc *vcc, int reply);
464 474