diff options
Diffstat (limited to 'include/linux/atmdev.h')
| -rw-r--r-- | include/linux/atmdev.h | 30 |
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 | ||
| 269 | enum { | 276 | enum { |
| 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 | ||
| 338 | enum atm_addr_type_t { ATM_ADDR_LOCAL, ATM_ADDR_LECS }; | ||
| 339 | |||
| 331 | struct atm_dev { | 340 | struct 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 */ |
| 406 | struct atm_dev *atm_dev_lookup(int number); | 416 | struct atm_dev *atm_dev_lookup(int number); |
| 407 | void atm_dev_deregister(struct atm_dev *dev); | 417 | void atm_dev_deregister(struct atm_dev *dev); |
| 408 | void shutdown_atm_dev(struct atm_dev *dev); | ||
| 409 | void vcc_insert_socket(struct sock *sk); | 418 | void 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 | ||
| 448 | static inline void atm_dev_put(struct atm_dev *dev) | 457 | static 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 | ||
| 458 | int atm_charge(struct atm_vcc *vcc,int truesize); | 468 | int atm_charge(struct atm_vcc *vcc,int truesize); |
| 459 | struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc,int pdu_size, | 469 | struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc,int pdu_size, |
| 460 | int gfp_flags); | 470 | gfp_t gfp_flags); |
| 461 | int atm_pcr_goal(struct atm_trafprm *tp); | 471 | int atm_pcr_goal(const struct atm_trafprm *tp); |
| 462 | 472 | ||
| 463 | void vcc_release_async(struct atm_vcc *vcc, int reply); | 473 | void vcc_release_async(struct atm_vcc *vcc, int reply); |
| 464 | 474 | ||
