lanai.c (7e66eaf14e19c032433be7c4df3c892fa2a5282f) lanai.c (3a816054fcd345d0fe47c666c375d372c6170371)
1/* lanai.c -- Copyright 1999-2003 by Mitchell Blank Jr <mitch@sfgoth.com>
2 *
3 * This program is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU General Public License
5 * as published by the Free Software Foundation; either version
6 * 2 of the License, or (at your option) any later version.
7 *
8 * This driver supports ATM cards based on the Efficient "Lanai"

--- 1443 unchanged lines hidden (view full) ---

1452{
1453#ifdef VCCTABLE_GETFREEPAGE
1454 APRINTK((lanai->num_vci) * sizeof(struct lanai_vcc *) <= PAGE_SIZE,
1455 "vcc table > PAGE_SIZE!");
1456 lanai->vccs = (struct lanai_vcc **) get_zeroed_page(GFP_KERNEL);
1457 return (lanai->vccs == NULL) ? -ENOMEM : 0;
1458#else
1459 int bytes = (lanai->num_vci) * sizeof(struct lanai_vcc *);
1/* lanai.c -- Copyright 1999-2003 by Mitchell Blank Jr <mitch@sfgoth.com>
2 *
3 * This program is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU General Public License
5 * as published by the Free Software Foundation; either version
6 * 2 of the License, or (at your option) any later version.
7 *
8 * This driver supports ATM cards based on the Efficient "Lanai"

--- 1443 unchanged lines hidden (view full) ---

1452{
1453#ifdef VCCTABLE_GETFREEPAGE
1454 APRINTK((lanai->num_vci) * sizeof(struct lanai_vcc *) <= PAGE_SIZE,
1455 "vcc table > PAGE_SIZE!");
1456 lanai->vccs = (struct lanai_vcc **) get_zeroed_page(GFP_KERNEL);
1457 return (lanai->vccs == NULL) ? -ENOMEM : 0;
1458#else
1459 int bytes = (lanai->num_vci) * sizeof(struct lanai_vcc *);
1460 lanai->vccs = (struct lanai_vcc **) vmalloc(bytes);
1460 lanai->vccs = vzalloc(bytes);
1461 if (unlikely(lanai->vccs == NULL))
1462 return -ENOMEM;
1461 if (unlikely(lanai->vccs == NULL))
1462 return -ENOMEM;
1463 memset(lanai->vccs, 0, bytes);
1464 return 0;
1465#endif
1466}
1467
1468static inline void vcc_table_deallocate(const struct lanai_dev *lanai)
1469{
1470#ifdef VCCTABLE_GETFREEPAGE
1471 free_page((unsigned long) lanai->vccs);

--- 1171 unchanged lines hidden ---
1463 return 0;
1464#endif
1465}
1466
1467static inline void vcc_table_deallocate(const struct lanai_dev *lanai)
1468{
1469#ifdef VCCTABLE_GETFREEPAGE
1470 free_page((unsigned long) lanai->vccs);

--- 1171 unchanged lines hidden ---