Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] pcmcia: remove dev_link_t and client_handle_t indirection

dev_link_t * and client_handle_t both mean struct pcmcai_device * by now.
Therefore, remove all such indirections.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>

+1235 -1467
+17 -20
drivers/bluetooth/bluecard_cs.c
··· 85 85 } bluecard_info_t; 86 86 87 87 88 - static void bluecard_config(dev_link_t *link); 89 - static void bluecard_release(dev_link_t *link); 88 + static void bluecard_config(struct pcmcia_device *link); 89 + static void bluecard_release(struct pcmcia_device *link); 90 90 91 91 static void bluecard_detach(struct pcmcia_device *p_dev); 92 92 ··· 856 856 return 0; 857 857 } 858 858 859 - static int bluecard_attach(struct pcmcia_device *p_dev) 859 + static int bluecard_attach(struct pcmcia_device *link) 860 860 { 861 861 bluecard_info_t *info; 862 - dev_link_t *link = dev_to_instance(p_dev); 863 862 864 863 /* Create new info device */ 865 864 info = kzalloc(sizeof(*info), GFP_KERNEL); 866 865 if (!info) 867 866 return -ENOMEM; 868 867 869 - info->p_dev = p_dev; 868 + info->p_dev = link; 870 869 link->priv = info; 871 870 872 871 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; ··· 886 887 } 887 888 888 889 889 - static void bluecard_detach(struct pcmcia_device *p_dev) 890 + static void bluecard_detach(struct pcmcia_device *link) 890 891 { 891 - dev_link_t *link = dev_to_instance(p_dev); 892 892 bluecard_info_t *info = link->priv; 893 893 894 894 if (link->state & DEV_CONFIG) ··· 897 899 } 898 900 899 901 900 - static int first_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse) 902 + static int first_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t *parse) 901 903 { 902 904 int i; 903 905 ··· 912 914 return pcmcia_parse_tuple(handle, tuple, parse); 913 915 } 914 916 915 - static void bluecard_config(dev_link_t *link) 917 + static void bluecard_config(struct pcmcia_device *link) 916 918 { 917 - client_handle_t handle = link->handle; 918 919 bluecard_info_t *info = link->priv; 919 920 tuple_t tuple; 920 921 u_short buf[256]; ··· 927 930 928 931 /* Get configuration register information */ 929 932 tuple.DesiredTuple = CISTPL_CONFIG; 930 - last_ret = first_tuple(handle, &tuple, &parse); 933 + last_ret = first_tuple(link, &tuple, &parse); 931 934 if (last_ret != CS_SUCCESS) { 932 935 last_fn = ParseTuple; 933 936 goto cs_failed; ··· 944 947 945 948 for (n = 0; n < 0x400; n += 0x40) { 946 949 link->io.BasePort1 = n ^ 0x300; 947 - i = pcmcia_request_io(link->handle, &link->io); 950 + i = pcmcia_request_io(link, &link->io); 948 951 if (i == CS_SUCCESS) 949 952 break; 950 953 } 951 954 952 955 if (i != CS_SUCCESS) { 953 - cs_error(link->handle, RequestIO, i); 956 + cs_error(link, RequestIO, i); 954 957 goto failed; 955 958 } 956 959 957 - i = pcmcia_request_irq(link->handle, &link->irq); 960 + i = pcmcia_request_irq(link, &link->irq); 958 961 if (i != CS_SUCCESS) { 959 - cs_error(link->handle, RequestIRQ, i); 962 + cs_error(link, RequestIRQ, i); 960 963 link->irq.AssignedIRQ = 0; 961 964 } 962 965 963 - i = pcmcia_request_configuration(link->handle, &link->conf); 966 + i = pcmcia_request_configuration(link, &link->conf); 964 967 if (i != CS_SUCCESS) { 965 - cs_error(link->handle, RequestConfiguration, i); 968 + cs_error(link, RequestConfiguration, i); 966 969 goto failed; 967 970 } 968 971 ··· 976 979 return; 977 980 978 981 cs_failed: 979 - cs_error(link->handle, last_fn, last_ret); 982 + cs_error(link, last_fn, last_ret); 980 983 981 984 failed: 982 985 bluecard_release(link); 983 986 } 984 987 985 988 986 - static void bluecard_release(dev_link_t *link) 989 + static void bluecard_release(struct pcmcia_device *link) 987 990 { 988 991 bluecard_info_t *info = link->priv; 989 992 ··· 992 995 993 996 del_timer(&(info->timer)); 994 997 995 - pcmcia_disable_device(link->handle); 998 + pcmcia_disable_device(link); 996 999 } 997 1000 998 1001 static struct pcmcia_device_id bluecard_ids[] = {
+24 -27
drivers/bluetooth/bt3c_cs.c
··· 88 88 } bt3c_info_t; 89 89 90 90 91 - static void bt3c_config(dev_link_t *link); 92 - static void bt3c_release(dev_link_t *link); 91 + static void bt3c_config(struct pcmcia_device *link); 92 + static void bt3c_release(struct pcmcia_device *link); 93 93 94 94 static void bt3c_detach(struct pcmcia_device *p_dev); 95 95 ··· 645 645 return 0; 646 646 } 647 647 648 - static int bt3c_attach(struct pcmcia_device *p_dev) 648 + static int bt3c_attach(struct pcmcia_device *link) 649 649 { 650 650 bt3c_info_t *info; 651 - dev_link_t *link = dev_to_instance(p_dev); 652 651 653 652 /* Create new info device */ 654 653 info = kzalloc(sizeof(*info), GFP_KERNEL); 655 654 if (!info) 656 655 return -ENOMEM; 657 656 658 - info->p_dev = p_dev; 657 + info->p_dev = link; 659 658 link->priv = info; 660 659 661 660 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; ··· 675 676 } 676 677 677 678 678 - static void bt3c_detach(struct pcmcia_device *p_dev) 679 + static void bt3c_detach(struct pcmcia_device *link) 679 680 { 680 - dev_link_t *link = dev_to_instance(p_dev); 681 681 bt3c_info_t *info = link->priv; 682 682 683 683 if (link->state & DEV_CONFIG) ··· 685 687 kfree(info); 686 688 } 687 689 688 - static int get_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse) 690 + static int get_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t *parse) 689 691 { 690 692 int i; 691 693 ··· 696 698 return pcmcia_parse_tuple(handle, tuple, parse); 697 699 } 698 700 699 - static int first_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse) 701 + static int first_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t *parse) 700 702 { 701 703 if (pcmcia_get_first_tuple(handle, tuple) != CS_SUCCESS) 702 704 return CS_NO_MORE_ITEMS; 703 705 return get_tuple(handle, tuple, parse); 704 706 } 705 707 706 - static int next_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse) 708 + static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t *parse) 707 709 { 708 710 if (pcmcia_get_next_tuple(handle, tuple) != CS_SUCCESS) 709 711 return CS_NO_MORE_ITEMS; 710 712 return get_tuple(handle, tuple, parse); 711 713 } 712 714 713 - static void bt3c_config(dev_link_t *link) 715 + static void bt3c_config(struct pcmcia_device *link) 714 716 { 715 717 static kio_addr_t base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; 716 - client_handle_t handle = link->handle; 717 718 bt3c_info_t *info = link->priv; 718 719 tuple_t tuple; 719 720 u_short buf[256]; ··· 727 730 728 731 /* Get configuration register information */ 729 732 tuple.DesiredTuple = CISTPL_CONFIG; 730 - last_ret = first_tuple(handle, &tuple, &parse); 733 + last_ret = first_tuple(link, &tuple, &parse); 731 734 if (last_ret != CS_SUCCESS) { 732 735 last_fn = ParseTuple; 733 736 goto cs_failed; ··· 746 749 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 747 750 /* Two tries: without IO aliases, then with aliases */ 748 751 for (try = 0; try < 2; try++) { 749 - i = first_tuple(handle, &tuple, &parse); 752 + i = first_tuple(link, &tuple, &parse); 750 753 while (i != CS_NO_MORE_ITEMS) { 751 754 if (i != CS_SUCCESS) 752 755 goto next_entry; ··· 756 759 link->conf.ConfigIndex = cf->index; 757 760 link->io.BasePort1 = cf->io.win[0].base; 758 761 link->io.IOAddrLines = (try == 0) ? 16 : cf->io.flags & CISTPL_IO_LINES_MASK; 759 - i = pcmcia_request_io(link->handle, &link->io); 762 + i = pcmcia_request_io(link, &link->io); 760 763 if (i == CS_SUCCESS) 761 764 goto found_port; 762 765 } 763 766 next_entry: 764 - i = next_tuple(handle, &tuple, &parse); 767 + i = next_tuple(link, &tuple, &parse); 765 768 } 766 769 } 767 770 768 771 /* Second pass: try to find an entry that isn't picky about 769 772 its base address, then try to grab any standard serial port 770 773 address, and finally try to get any free port. */ 771 - i = first_tuple(handle, &tuple, &parse); 774 + i = first_tuple(link, &tuple, &parse); 772 775 while (i != CS_NO_MORE_ITEMS) { 773 776 if ((i == CS_SUCCESS) && (cf->io.nwin > 0) && ((cf->io.flags & CISTPL_IO_LINES_MASK) <= 3)) { 774 777 link->conf.ConfigIndex = cf->index; 775 778 for (j = 0; j < 5; j++) { 776 779 link->io.BasePort1 = base[j]; 777 780 link->io.IOAddrLines = base[j] ? 16 : 3; 778 - i = pcmcia_request_io(link->handle, &link->io); 781 + i = pcmcia_request_io(link, &link->io); 779 782 if (i == CS_SUCCESS) 780 783 goto found_port; 781 784 } 782 785 } 783 - i = next_tuple(handle, &tuple, &parse); 786 + i = next_tuple(link, &tuple, &parse); 784 787 } 785 788 786 789 found_port: 787 790 if (i != CS_SUCCESS) { 788 791 BT_ERR("No usable port range found"); 789 - cs_error(link->handle, RequestIO, i); 792 + cs_error(link, RequestIO, i); 790 793 goto failed; 791 794 } 792 795 793 - i = pcmcia_request_irq(link->handle, &link->irq); 796 + i = pcmcia_request_irq(link, &link->irq); 794 797 if (i != CS_SUCCESS) { 795 - cs_error(link->handle, RequestIRQ, i); 798 + cs_error(link, RequestIRQ, i); 796 799 link->irq.AssignedIRQ = 0; 797 800 } 798 801 799 - i = pcmcia_request_configuration(link->handle, &link->conf); 802 + i = pcmcia_request_configuration(link, &link->conf); 800 803 if (i != CS_SUCCESS) { 801 - cs_error(link->handle, RequestConfiguration, i); 804 + cs_error(link, RequestConfiguration, i); 802 805 goto failed; 803 806 } 804 807 ··· 812 815 return; 813 816 814 817 cs_failed: 815 - cs_error(link->handle, last_fn, last_ret); 818 + cs_error(link, last_fn, last_ret); 816 819 817 820 failed: 818 821 bt3c_release(link); 819 822 } 820 823 821 824 822 - static void bt3c_release(dev_link_t *link) 825 + static void bt3c_release(struct pcmcia_device *link) 823 826 { 824 827 bt3c_info_t *info = link->priv; 825 828 826 829 if (link->state & DEV_PRESENT) 827 830 bt3c_close(info); 828 831 829 - pcmcia_disable_device(link->handle); 832 + pcmcia_disable_device(link); 830 833 } 831 834 832 835
+24 -27
drivers/bluetooth/btuart_cs.c
··· 84 84 } btuart_info_t; 85 85 86 86 87 - static void btuart_config(dev_link_t *link); 88 - static void btuart_release(dev_link_t *link); 87 + static void btuart_config(struct pcmcia_device *link); 88 + static void btuart_release(struct pcmcia_device *link); 89 89 90 90 static void btuart_detach(struct pcmcia_device *p_dev); 91 91 ··· 576 576 return 0; 577 577 } 578 578 579 - static int btuart_attach(struct pcmcia_device *p_dev) 579 + static int btuart_attach(struct pcmcia_device *link) 580 580 { 581 581 btuart_info_t *info; 582 - dev_link_t *link = dev_to_instance(p_dev); 583 582 584 583 /* Create new info device */ 585 584 info = kzalloc(sizeof(*info), GFP_KERNEL); 586 585 if (!info) 587 586 return -ENOMEM; 588 587 589 - info->p_dev = p_dev; 588 + info->p_dev = link; 590 589 link->priv = info; 591 590 592 591 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; ··· 606 607 } 607 608 608 609 609 - static void btuart_detach(struct pcmcia_device *p_dev) 610 + static void btuart_detach(struct pcmcia_device *link) 610 611 { 611 - dev_link_t *link = dev_to_instance(p_dev); 612 612 btuart_info_t *info = link->priv; 613 613 614 614 if (link->state & DEV_CONFIG) ··· 616 618 kfree(info); 617 619 } 618 620 619 - static int get_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse) 621 + static int get_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t *parse) 620 622 { 621 623 int i; 622 624 ··· 627 629 return pcmcia_parse_tuple(handle, tuple, parse); 628 630 } 629 631 630 - static int first_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse) 632 + static int first_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t *parse) 631 633 { 632 634 if (pcmcia_get_first_tuple(handle, tuple) != CS_SUCCESS) 633 635 return CS_NO_MORE_ITEMS; 634 636 return get_tuple(handle, tuple, parse); 635 637 } 636 638 637 - static int next_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse) 639 + static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t *parse) 638 640 { 639 641 if (pcmcia_get_next_tuple(handle, tuple) != CS_SUCCESS) 640 642 return CS_NO_MORE_ITEMS; 641 643 return get_tuple(handle, tuple, parse); 642 644 } 643 645 644 - static void btuart_config(dev_link_t *link) 646 + static void btuart_config(struct pcmcia_device *link) 645 647 { 646 648 static kio_addr_t base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; 647 - client_handle_t handle = link->handle; 648 649 btuart_info_t *info = link->priv; 649 650 tuple_t tuple; 650 651 u_short buf[256]; ··· 658 661 659 662 /* Get configuration register information */ 660 663 tuple.DesiredTuple = CISTPL_CONFIG; 661 - last_ret = first_tuple(handle, &tuple, &parse); 664 + last_ret = first_tuple(link, &tuple, &parse); 662 665 if (last_ret != CS_SUCCESS) { 663 666 last_fn = ParseTuple; 664 667 goto cs_failed; ··· 677 680 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 678 681 /* Two tries: without IO aliases, then with aliases */ 679 682 for (try = 0; try < 2; try++) { 680 - i = first_tuple(handle, &tuple, &parse); 683 + i = first_tuple(link, &tuple, &parse); 681 684 while (i != CS_NO_MORE_ITEMS) { 682 685 if (i != CS_SUCCESS) 683 686 goto next_entry; ··· 687 690 link->conf.ConfigIndex = cf->index; 688 691 link->io.BasePort1 = cf->io.win[0].base; 689 692 link->io.IOAddrLines = (try == 0) ? 16 : cf->io.flags & CISTPL_IO_LINES_MASK; 690 - i = pcmcia_request_io(link->handle, &link->io); 693 + i = pcmcia_request_io(link, &link->io); 691 694 if (i == CS_SUCCESS) 692 695 goto found_port; 693 696 } 694 697 next_entry: 695 - i = next_tuple(handle, &tuple, &parse); 698 + i = next_tuple(link, &tuple, &parse); 696 699 } 697 700 } 698 701 699 702 /* Second pass: try to find an entry that isn't picky about 700 703 its base address, then try to grab any standard serial port 701 704 address, and finally try to get any free port. */ 702 - i = first_tuple(handle, &tuple, &parse); 705 + i = first_tuple(link, &tuple, &parse); 703 706 while (i != CS_NO_MORE_ITEMS) { 704 707 if ((i == CS_SUCCESS) && (cf->io.nwin > 0) 705 708 && ((cf->io.flags & CISTPL_IO_LINES_MASK) <= 3)) { ··· 707 710 for (j = 0; j < 5; j++) { 708 711 link->io.BasePort1 = base[j]; 709 712 link->io.IOAddrLines = base[j] ? 16 : 3; 710 - i = pcmcia_request_io(link->handle, &link->io); 713 + i = pcmcia_request_io(link, &link->io); 711 714 if (i == CS_SUCCESS) 712 715 goto found_port; 713 716 } 714 717 } 715 - i = next_tuple(handle, &tuple, &parse); 718 + i = next_tuple(link, &tuple, &parse); 716 719 } 717 720 718 721 found_port: 719 722 if (i != CS_SUCCESS) { 720 723 BT_ERR("No usable port range found"); 721 - cs_error(link->handle, RequestIO, i); 724 + cs_error(link, RequestIO, i); 722 725 goto failed; 723 726 } 724 727 725 - i = pcmcia_request_irq(link->handle, &link->irq); 728 + i = pcmcia_request_irq(link, &link->irq); 726 729 if (i != CS_SUCCESS) { 727 - cs_error(link->handle, RequestIRQ, i); 730 + cs_error(link, RequestIRQ, i); 728 731 link->irq.AssignedIRQ = 0; 729 732 } 730 733 731 - i = pcmcia_request_configuration(link->handle, &link->conf); 734 + i = pcmcia_request_configuration(link, &link->conf); 732 735 if (i != CS_SUCCESS) { 733 - cs_error(link->handle, RequestConfiguration, i); 736 + cs_error(link, RequestConfiguration, i); 734 737 goto failed; 735 738 } 736 739 ··· 744 747 return; 745 748 746 749 cs_failed: 747 - cs_error(link->handle, last_fn, last_ret); 750 + cs_error(link, last_fn, last_ret); 748 751 749 752 failed: 750 753 btuart_release(link); 751 754 } 752 755 753 756 754 - static void btuart_release(dev_link_t *link) 757 + static void btuart_release(struct pcmcia_device *link) 755 758 { 756 759 btuart_info_t *info = link->priv; 757 760 758 761 if (link->state & DEV_PRESENT) 759 762 btuart_close(info); 760 763 761 - pcmcia_disable_device(link->handle); 764 + pcmcia_disable_device(link); 762 765 } 763 766 764 767 static struct pcmcia_device_id btuart_ids[] = {
+21 -24
drivers/bluetooth/dtl1_cs.c
··· 87 87 } dtl1_info_t; 88 88 89 89 90 - static void dtl1_config(dev_link_t *link); 91 - static void dtl1_release(dev_link_t *link); 90 + static void dtl1_config(struct pcmcia_device *link); 91 + static void dtl1_release(struct pcmcia_device *link); 92 92 93 93 static void dtl1_detach(struct pcmcia_device *p_dev); 94 94 ··· 555 555 return 0; 556 556 } 557 557 558 - static int dtl1_attach(struct pcmcia_device *p_dev) 558 + static int dtl1_attach(struct pcmcia_device *link) 559 559 { 560 560 dtl1_info_t *info; 561 - dev_link_t *link = dev_to_instance(p_dev); 562 561 563 562 /* Create new info device */ 564 563 info = kzalloc(sizeof(*info), GFP_KERNEL); 565 564 if (!info) 566 565 return -ENOMEM; 567 566 568 - info->p_dev = p_dev; 567 + info->p_dev = link; 569 568 link->priv = info; 570 569 571 570 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; ··· 585 586 } 586 587 587 588 588 - static void dtl1_detach(struct pcmcia_device *p_dev) 589 + static void dtl1_detach(struct pcmcia_device *link) 589 590 { 590 - dev_link_t *link = dev_to_instance(p_dev); 591 591 dtl1_info_t *info = link->priv; 592 592 593 593 if (link->state & DEV_CONFIG) ··· 595 597 kfree(info); 596 598 } 597 599 598 - static int get_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse) 600 + static int get_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t *parse) 599 601 { 600 602 int i; 601 603 ··· 606 608 return pcmcia_parse_tuple(handle, tuple, parse); 607 609 } 608 610 609 - static int first_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse) 611 + static int first_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t *parse) 610 612 { 611 613 if (pcmcia_get_first_tuple(handle, tuple) != CS_SUCCESS) 612 614 return CS_NO_MORE_ITEMS; 613 615 return get_tuple(handle, tuple, parse); 614 616 } 615 617 616 - static int next_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse) 618 + static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t *parse) 617 619 { 618 620 if (pcmcia_get_next_tuple(handle, tuple) != CS_SUCCESS) 619 621 return CS_NO_MORE_ITEMS; 620 622 return get_tuple(handle, tuple, parse); 621 623 } 622 624 623 - static void dtl1_config(dev_link_t *link) 625 + static void dtl1_config(struct pcmcia_device *link) 624 626 { 625 - client_handle_t handle = link->handle; 626 627 dtl1_info_t *info = link->priv; 627 628 tuple_t tuple; 628 629 u_short buf[256]; ··· 636 639 637 640 /* Get configuration register information */ 638 641 tuple.DesiredTuple = CISTPL_CONFIG; 639 - last_ret = first_tuple(handle, &tuple, &parse); 642 + last_ret = first_tuple(link, &tuple, &parse); 640 643 if (last_ret != CS_SUCCESS) { 641 644 last_fn = ParseTuple; 642 645 goto cs_failed; ··· 655 658 656 659 /* Look for a generic full-sized window */ 657 660 link->io.NumPorts1 = 8; 658 - i = first_tuple(handle, &tuple, &parse); 661 + i = first_tuple(link, &tuple, &parse); 659 662 while (i != CS_NO_MORE_ITEMS) { 660 663 if ((i == CS_SUCCESS) && (cf->io.nwin == 1) && (cf->io.win[0].len > 8)) { 661 664 link->conf.ConfigIndex = cf->index; 662 665 link->io.BasePort1 = cf->io.win[0].base; 663 666 link->io.NumPorts1 = cf->io.win[0].len; /*yo */ 664 667 link->io.IOAddrLines = cf->io.flags & CISTPL_IO_LINES_MASK; 665 - i = pcmcia_request_io(link->handle, &link->io); 668 + i = pcmcia_request_io(link, &link->io); 666 669 if (i == CS_SUCCESS) 667 670 break; 668 671 } 669 - i = next_tuple(handle, &tuple, &parse); 672 + i = next_tuple(link, &tuple, &parse); 670 673 } 671 674 672 675 if (i != CS_SUCCESS) { 673 - cs_error(link->handle, RequestIO, i); 676 + cs_error(link, RequestIO, i); 674 677 goto failed; 675 678 } 676 679 677 - i = pcmcia_request_irq(link->handle, &link->irq); 680 + i = pcmcia_request_irq(link, &link->irq); 678 681 if (i != CS_SUCCESS) { 679 - cs_error(link->handle, RequestIRQ, i); 682 + cs_error(link, RequestIRQ, i); 680 683 link->irq.AssignedIRQ = 0; 681 684 } 682 685 683 - i = pcmcia_request_configuration(link->handle, &link->conf); 686 + i = pcmcia_request_configuration(link, &link->conf); 684 687 if (i != CS_SUCCESS) { 685 - cs_error(link->handle, RequestConfiguration, i); 688 + cs_error(link, RequestConfiguration, i); 686 689 goto failed; 687 690 } 688 691 ··· 696 699 return; 697 700 698 701 cs_failed: 699 - cs_error(link->handle, last_fn, last_ret); 702 + cs_error(link, last_fn, last_ret); 700 703 701 704 failed: 702 705 dtl1_release(link); 703 706 } 704 707 705 708 706 - static void dtl1_release(dev_link_t *link) 709 + static void dtl1_release(struct pcmcia_device *link) 707 710 { 708 711 dtl1_info_t *info = link->priv; 709 712 710 713 if (link->state & DEV_PRESENT) 711 714 dtl1_close(info); 712 715 713 - pcmcia_disable_device(link->handle); 716 + pcmcia_disable_device(link); 714 717 } 715 718 716 719
+25 -30
drivers/char/pcmcia/cm4000_cs.c
··· 67 67 #define T_100MSEC msecs_to_jiffies(100) 68 68 #define T_500MSEC msecs_to_jiffies(500) 69 69 70 - static void cm4000_release(dev_link_t *link); 70 + static void cm4000_release(struct pcmcia_device *link); 71 71 72 72 static int major; /* major number we get from the kernel */ 73 73 ··· 149 149 #define ZERO_DEV(dev) \ 150 150 memset(&dev->atr_csum,0, \ 151 151 sizeof(struct cm4000_dev) - \ 152 - /*link*/ sizeof(dev_link_t) - \ 152 + /*link*/ sizeof(struct pcmcia_device) - \ 153 153 /*node*/ sizeof(dev_node_t) - \ 154 154 /*atr*/ MAX_ATR*sizeof(char) - \ 155 155 /*rbuf*/ 512*sizeof(char) - \ 156 156 /*sbuf*/ 512*sizeof(char) - \ 157 157 /*queue*/ 4*sizeof(wait_queue_head_t)) 158 158 159 - static dev_link_t *dev_table[CM4000_MAX_DEV]; 159 + static struct pcmcia_device *dev_table[CM4000_MAX_DEV]; 160 160 static struct class *cmm_class; 161 161 162 162 /* This table doesn't use spaces after the comma between fields and thus ··· 1441 1441 { 1442 1442 struct cm4000_dev *dev = filp->private_data; 1443 1443 ioaddr_t iobase = dev->p_dev->io.BasePort1; 1444 - dev_link_t *link; 1444 + struct pcmcia_device *link; 1445 1445 int size; 1446 1446 int rc; 1447 1447 void __user *argp = (void __user *)arg; ··· 1660 1660 static int cmm_open(struct inode *inode, struct file *filp) 1661 1661 { 1662 1662 struct cm4000_dev *dev; 1663 - dev_link_t *link; 1663 + struct pcmcia_device *link; 1664 1664 int rc, minor = iminor(inode); 1665 1665 1666 1666 if (minor >= CM4000_MAX_DEV) ··· 1709 1709 static int cmm_close(struct inode *inode, struct file *filp) 1710 1710 { 1711 1711 struct cm4000_dev *dev; 1712 - dev_link_t *link; 1712 + struct pcmcia_device *link; 1713 1713 int minor = iminor(inode); 1714 1714 1715 1715 if (minor >= CM4000_MAX_DEV) ··· 1735 1735 return 0; 1736 1736 } 1737 1737 1738 - static void cmm_cm4000_release(dev_link_t * link) 1738 + static void cmm_cm4000_release(struct pcmcia_device * link) 1739 1739 { 1740 1740 struct cm4000_dev *dev = link->priv; 1741 1741 ··· 1759 1759 1760 1760 /*==== Interface to PCMCIA Layer =======================================*/ 1761 1761 1762 - static void cm4000_config(dev_link_t * link, int devno) 1762 + static void cm4000_config(struct pcmcia_device * link, int devno) 1763 1763 { 1764 - client_handle_t handle = link->handle; 1765 1764 struct cm4000_dev *dev; 1766 1765 tuple_t tuple; 1767 1766 cisparse_t parse; ··· 1775 1776 tuple.TupleDataMax = sizeof(buf); 1776 1777 tuple.TupleOffset = 0; 1777 1778 1778 - if ((fail_rc = pcmcia_get_first_tuple(handle, &tuple)) != CS_SUCCESS) { 1779 + if ((fail_rc = pcmcia_get_first_tuple(link, &tuple)) != CS_SUCCESS) { 1779 1780 fail_fn = GetFirstTuple; 1780 1781 goto cs_failed; 1781 1782 } 1782 - if ((fail_rc = pcmcia_get_tuple_data(handle, &tuple)) != CS_SUCCESS) { 1783 + if ((fail_rc = pcmcia_get_tuple_data(link, &tuple)) != CS_SUCCESS) { 1783 1784 fail_fn = GetTupleData; 1784 1785 goto cs_failed; 1785 1786 } 1786 1787 if ((fail_rc = 1787 - pcmcia_parse_tuple(handle, &tuple, &parse)) != CS_SUCCESS) { 1788 + pcmcia_parse_tuple(link, &tuple, &parse)) != CS_SUCCESS) { 1788 1789 fail_fn = ParseTuple; 1789 1790 goto cs_failed; 1790 1791 } ··· 1797 1798 link->io.NumPorts2 = 0; 1798 1799 link->io.Attributes2 = 0; 1799 1800 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 1800 - for (rc = pcmcia_get_first_tuple(handle, &tuple); 1801 - rc == CS_SUCCESS; rc = pcmcia_get_next_tuple(handle, &tuple)) { 1801 + for (rc = pcmcia_get_first_tuple(link, &tuple); 1802 + rc == CS_SUCCESS; rc = pcmcia_get_next_tuple(link, &tuple)) { 1802 1803 1803 - rc = pcmcia_get_tuple_data(handle, &tuple); 1804 + rc = pcmcia_get_tuple_data(link, &tuple); 1804 1805 if (rc != CS_SUCCESS) 1805 1806 continue; 1806 - rc = pcmcia_parse_tuple(handle, &tuple, &parse); 1807 + rc = pcmcia_parse_tuple(link, &tuple, &parse); 1807 1808 if (rc != CS_SUCCESS) 1808 1809 continue; 1809 1810 ··· 1823 1824 link->io.IOAddrLines = parse.cftable_entry.io.flags 1824 1825 & CISTPL_IO_LINES_MASK; 1825 1826 1826 - rc = pcmcia_request_io(handle, &link->io); 1827 + rc = pcmcia_request_io(link, &link->io); 1827 1828 if (rc == CS_SUCCESS) 1828 1829 break; /* we are done */ 1829 1830 } ··· 1833 1834 link->conf.IntType = 00000002; 1834 1835 1835 1836 if ((fail_rc = 1836 - pcmcia_request_configuration(handle, &link->conf)) != CS_SUCCESS) { 1837 + pcmcia_request_configuration(link, &link->conf)) != CS_SUCCESS) { 1837 1838 fail_fn = RequestConfiguration; 1838 1839 goto cs_release; 1839 1840 } ··· 1849 1850 return; 1850 1851 1851 1852 cs_failed: 1852 - cs_error(handle, fail_fn, fail_rc); 1853 + cs_error(link, fail_fn, fail_rc); 1853 1854 cs_release: 1854 1855 cm4000_release(link); 1855 1856 1856 1857 link->state &= ~DEV_CONFIG_PENDING; 1857 1858 } 1858 1859 1859 - static int cm4000_suspend(struct pcmcia_device *p_dev) 1860 + static int cm4000_suspend(struct pcmcia_device *link) 1860 1861 { 1861 - dev_link_t *link = dev_to_instance(p_dev); 1862 1862 struct cm4000_dev *dev; 1863 1863 1864 1864 dev = link->priv; ··· 1866 1868 return 0; 1867 1869 } 1868 1870 1869 - static int cm4000_resume(struct pcmcia_device *p_dev) 1871 + static int cm4000_resume(struct pcmcia_device *link) 1870 1872 { 1871 - dev_link_t *link = dev_to_instance(p_dev); 1872 1873 struct cm4000_dev *dev; 1873 1874 1874 1875 dev = link->priv; ··· 1877 1880 return 0; 1878 1881 } 1879 1882 1880 - static void cm4000_release(dev_link_t *link) 1883 + static void cm4000_release(struct pcmcia_device *link) 1881 1884 { 1882 1885 cmm_cm4000_release(link->priv); /* delay release until device closed */ 1883 - pcmcia_disable_device(link->handle); 1886 + pcmcia_disable_device(link); 1884 1887 } 1885 1888 1886 - static int cm4000_attach(struct pcmcia_device *p_dev) 1889 + static int cm4000_attach(struct pcmcia_device *link) 1887 1890 { 1888 1891 struct cm4000_dev *dev; 1889 1892 int i; 1890 - dev_link_t *link = dev_to_instance(p_dev); 1891 1893 1892 1894 for (i = 0; i < CM4000_MAX_DEV; i++) 1893 1895 if (dev_table[i] == NULL) ··· 1902 1906 if (dev == NULL) 1903 1907 return -ENOMEM; 1904 1908 1905 - dev->p_dev = p_dev; 1909 + dev->p_dev = link; 1906 1910 link->priv = dev; 1907 1911 link->conf.IntType = INT_MEMORY_AND_IO; 1908 1912 dev_table[i] = link; ··· 1921 1925 return 0; 1922 1926 } 1923 1927 1924 - static void cm4000_detach(struct pcmcia_device *p_dev) 1928 + static void cm4000_detach(struct pcmcia_device *link) 1925 1929 { 1926 - dev_link_t *link = dev_to_instance(p_dev); 1927 1930 struct cm4000_dev *dev = link->priv; 1928 1931 int devno; 1929 1932
+24 -29
drivers/char/pcmcia/cm4040_cs.c
··· 65 65 /* how often to poll for fifo status change */ 66 66 #define POLL_PERIOD msecs_to_jiffies(10) 67 67 68 - static void reader_release(dev_link_t *link); 68 + static void reader_release(struct pcmcia_device *link); 69 69 70 70 static int major; 71 71 static struct class *cmx_class; ··· 87 87 struct timer_list poll_timer; 88 88 }; 89 89 90 - static dev_link_t *dev_table[CM_MAX_DEV]; 90 + static struct pcmcia_device *dev_table[CM_MAX_DEV]; 91 91 92 92 #ifndef PCMCIA_DEBUG 93 93 #define xoutb outb ··· 445 445 static int cm4040_open(struct inode *inode, struct file *filp) 446 446 { 447 447 struct reader_dev *dev; 448 - dev_link_t *link; 448 + struct pcmcia_device *link; 449 449 int minor = iminor(inode); 450 450 451 451 if (minor >= CM_MAX_DEV) ··· 478 478 static int cm4040_close(struct inode *inode, struct file *filp) 479 479 { 480 480 struct reader_dev *dev = filp->private_data; 481 - dev_link_t *link; 481 + struct pcmcia_device *link; 482 482 int minor = iminor(inode); 483 483 484 484 DEBUGP(2, dev, "-> cm4040_close(maj/min=%d.%d)\n", imajor(inode), ··· 500 500 return 0; 501 501 } 502 502 503 - static void cm4040_reader_release(dev_link_t *link) 503 + static void cm4040_reader_release(struct pcmcia_device *link) 504 504 { 505 505 struct reader_dev *dev = link->priv; 506 506 ··· 514 514 return; 515 515 } 516 516 517 - static void reader_config(dev_link_t *link, int devno) 517 + static void reader_config(struct pcmcia_device *link, int devno) 518 518 { 519 - client_handle_t handle; 520 519 struct reader_dev *dev; 521 520 tuple_t tuple; 522 521 cisparse_t parse; ··· 523 524 int fail_fn, fail_rc; 524 525 int rc; 525 526 526 - handle = link->handle; 527 - 528 527 tuple.DesiredTuple = CISTPL_CONFIG; 529 528 tuple.Attributes = 0; 530 529 tuple.TupleData = buf; 531 530 tuple.TupleDataMax = sizeof(buf); 532 531 tuple.TupleOffset = 0; 533 532 534 - if ((fail_rc = pcmcia_get_first_tuple(handle, &tuple)) != CS_SUCCESS) { 533 + if ((fail_rc = pcmcia_get_first_tuple(link, &tuple)) != CS_SUCCESS) { 535 534 fail_fn = GetFirstTuple; 536 535 goto cs_failed; 537 536 } 538 - if ((fail_rc = pcmcia_get_tuple_data(handle, &tuple)) != CS_SUCCESS) { 537 + if ((fail_rc = pcmcia_get_tuple_data(link, &tuple)) != CS_SUCCESS) { 539 538 fail_fn = GetTupleData; 540 539 goto cs_failed; 541 540 } 542 - if ((fail_rc = pcmcia_parse_tuple(handle, &tuple, &parse)) 541 + if ((fail_rc = pcmcia_parse_tuple(link, &tuple, &parse)) 543 542 != CS_SUCCESS) { 544 543 fail_fn = ParseTuple; 545 544 goto cs_failed; ··· 551 554 link->io.NumPorts2 = 0; 552 555 link->io.Attributes2 = 0; 553 556 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 554 - for (rc = pcmcia_get_first_tuple(handle, &tuple); 557 + for (rc = pcmcia_get_first_tuple(link, &tuple); 555 558 rc == CS_SUCCESS; 556 - rc = pcmcia_get_next_tuple(handle, &tuple)) { 557 - rc = pcmcia_get_tuple_data(handle, &tuple); 559 + rc = pcmcia_get_next_tuple(link, &tuple)) { 560 + rc = pcmcia_get_tuple_data(link, &tuple); 558 561 if (rc != CS_SUCCESS) 559 562 continue; 560 - rc = pcmcia_parse_tuple(handle, &tuple, &parse); 563 + rc = pcmcia_parse_tuple(link, &tuple, &parse); 561 564 if (rc != CS_SUCCESS) 562 565 continue; 563 566 ··· 575 578 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 576 579 link->io.IOAddrLines = parse.cftable_entry.io.flags 577 580 & CISTPL_IO_LINES_MASK; 578 - rc = pcmcia_request_io(handle, &link->io); 581 + rc = pcmcia_request_io(link, &link->io); 579 582 580 - dev_printk(KERN_INFO, &handle_to_dev(handle), "foo"); 583 + dev_printk(KERN_INFO, &handle_to_dev(link), "foo"); 581 584 if (rc == CS_SUCCESS) 582 585 break; 583 586 else 584 - dev_printk(KERN_INFO, &handle_to_dev(handle), 587 + dev_printk(KERN_INFO, &handle_to_dev(link), 585 588 "pcmcia_request_io failed 0x%x\n", rc); 586 589 } 587 590 if (rc != CS_SUCCESS) ··· 589 592 590 593 link->conf.IntType = 00000002; 591 594 592 - if ((fail_rc = pcmcia_request_configuration(handle,&link->conf)) 595 + if ((fail_rc = pcmcia_request_configuration(link,&link->conf)) 593 596 !=CS_SUCCESS) { 594 597 fail_fn = RequestConfiguration; 595 - dev_printk(KERN_INFO, &handle_to_dev(handle), 598 + dev_printk(KERN_INFO, &handle_to_dev(link), 596 599 "pcmcia_request_configuration failed 0x%x\n", 597 600 fail_rc); 598 601 goto cs_release; ··· 613 616 return; 614 617 615 618 cs_failed: 616 - cs_error(handle, fail_fn, fail_rc); 619 + cs_error(link, fail_fn, fail_rc); 617 620 cs_release: 618 621 reader_release(link); 619 622 link->state &= ~DEV_CONFIG_PENDING; 620 623 } 621 624 622 - static void reader_release(dev_link_t *link) 625 + static void reader_release(struct pcmcia_device *link) 623 626 { 624 627 cm4040_reader_release(link->priv); 625 - pcmcia_disable_device(link->handle); 628 + pcmcia_disable_device(link); 626 629 } 627 630 628 - static int reader_attach(struct pcmcia_device *p_dev) 631 + static int reader_attach(struct pcmcia_device *link) 629 632 { 630 633 struct reader_dev *dev; 631 634 int i; 632 - dev_link_t *link = dev_to_instance(p_dev); 633 635 634 636 for (i = 0; i < CM_MAX_DEV; i++) { 635 637 if (dev_table[i] == NULL) ··· 646 650 dev->buffer_status = 0; 647 651 648 652 link->priv = dev; 649 - dev->p_dev = p_dev; 653 + dev->p_dev = link; 650 654 651 655 link->conf.IntType = INT_MEMORY_AND_IO; 652 656 dev_table[i] = link; ··· 667 671 return 0; 668 672 } 669 673 670 - static void reader_detach(struct pcmcia_device *p_dev) 674 + static void reader_detach(struct pcmcia_device *link) 671 675 { 672 - dev_link_t *link = dev_to_instance(p_dev); 673 676 struct reader_dev *dev = link->priv; 674 677 int devno; 675 678
+28 -32
drivers/ide/legacy/ide-cs.c
··· 87 87 int hd; 88 88 } ide_info_t; 89 89 90 - static void ide_release(dev_link_t *); 91 - static void ide_config(dev_link_t *); 90 + static void ide_release(struct pcmcia_device *); 91 + static void ide_config(struct pcmcia_device *); 92 92 93 93 static void ide_detach(struct pcmcia_device *p_dev); 94 94 ··· 103 103 104 104 ======================================================================*/ 105 105 106 - static int ide_attach(struct pcmcia_device *p_dev) 106 + static int ide_attach(struct pcmcia_device *link) 107 107 { 108 108 ide_info_t *info; 109 - dev_link_t *link = dev_to_instance(p_dev); 110 109 111 110 DEBUG(0, "ide_attach()\n"); 112 111 ··· 114 115 if (!info) 115 116 return -ENOMEM; 116 117 117 - info->p_dev = p_dev; 118 + info->p_dev = link; 118 119 link->priv = info; 119 120 120 121 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; ··· 140 141 141 142 ======================================================================*/ 142 143 143 - static void ide_detach(struct pcmcia_device *p_dev) 144 + static void ide_detach(struct pcmcia_device *link) 144 145 { 145 - dev_link_t *link = dev_to_instance(p_dev); 146 - 147 146 DEBUG(0, "ide_detach(0x%p)\n", link); 148 147 149 148 if (link->state & DEV_CONFIG) ··· 172 175 #define CS_CHECK(fn, ret) \ 173 176 do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 174 177 175 - static void ide_config(dev_link_t *link) 178 + static void ide_config(struct pcmcia_device *link) 176 179 { 177 - client_handle_t handle = link->handle; 178 180 ide_info_t *info = link->priv; 179 181 tuple_t tuple; 180 182 struct { ··· 197 201 tuple.TupleDataMax = 255; 198 202 tuple.Attributes = 0; 199 203 tuple.DesiredTuple = CISTPL_CONFIG; 200 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 201 - CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 202 - CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &stk->parse)); 204 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 205 + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 206 + CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &stk->parse)); 203 207 link->conf.ConfigBase = stk->parse.config.base; 204 208 link->conf.Present = stk->parse.config.rmask[0]; 205 209 206 210 tuple.DesiredTuple = CISTPL_MANFID; 207 - if (!pcmcia_get_first_tuple(handle, &tuple) && 208 - !pcmcia_get_tuple_data(handle, &tuple) && 209 - !pcmcia_parse_tuple(handle, &tuple, &stk->parse)) 211 + if (!pcmcia_get_first_tuple(link, &tuple) && 212 + !pcmcia_get_tuple_data(link, &tuple) && 213 + !pcmcia_parse_tuple(link, &tuple, &stk->parse)) 210 214 is_kme = ((stk->parse.manfid.manf == MANFID_KME) && 211 215 ((stk->parse.manfid.card == PRODID_KME_KXLC005_A) || 212 216 (stk->parse.manfid.card == PRODID_KME_KXLC005_B))); ··· 215 219 link->state |= DEV_CONFIG; 216 220 217 221 /* Not sure if this is right... look up the current Vcc */ 218 - CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(handle, &stk->conf)); 222 + CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(link, &stk->conf)); 219 223 220 224 pass = io_base = ctl_base = 0; 221 225 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 222 226 tuple.Attributes = 0; 223 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 227 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 224 228 while (1) { 225 - if (pcmcia_get_tuple_data(handle, &tuple) != 0) goto next_entry; 226 - if (pcmcia_parse_tuple(handle, &tuple, &stk->parse) != 0) goto next_entry; 229 + if (pcmcia_get_tuple_data(link, &tuple) != 0) goto next_entry; 230 + if (pcmcia_parse_tuple(link, &tuple, &stk->parse) != 0) goto next_entry; 227 231 228 232 /* Check for matching Vcc, unless we're desperate */ 229 233 if (!pass) { ··· 254 258 link->io.NumPorts1 = 8; 255 259 link->io.BasePort2 = io->win[1].base; 256 260 link->io.NumPorts2 = (is_kme) ? 2 : 1; 257 - if (pcmcia_request_io(link->handle, &link->io) != 0) 261 + if (pcmcia_request_io(link, &link->io) != 0) 258 262 goto next_entry; 259 263 io_base = link->io.BasePort1; 260 264 ctl_base = link->io.BasePort2; 261 265 } else if ((io->nwin == 1) && (io->win[0].len >= 16)) { 262 266 link->io.NumPorts1 = io->win[0].len; 263 267 link->io.NumPorts2 = 0; 264 - if (pcmcia_request_io(link->handle, &link->io) != 0) 268 + if (pcmcia_request_io(link, &link->io) != 0) 265 269 goto next_entry; 266 270 io_base = link->io.BasePort1; 267 271 ctl_base = link->io.BasePort1 + 0x0e; ··· 274 278 if (cfg->flags & CISTPL_CFTABLE_DEFAULT) 275 279 memcpy(&stk->dflt, cfg, sizeof(stk->dflt)); 276 280 if (pass) { 277 - CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(handle, &tuple)); 278 - } else if (pcmcia_get_next_tuple(handle, &tuple) != 0) { 279 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 281 + CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(link, &tuple)); 282 + } else if (pcmcia_get_next_tuple(link, &tuple) != 0) { 283 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 280 284 memset(&stk->dflt, 0, sizeof(stk->dflt)); 281 285 pass++; 282 286 } 283 287 } 284 288 285 - CS_CHECK(RequestIRQ, pcmcia_request_irq(handle, &link->irq)); 286 - CS_CHECK(RequestConfiguration, pcmcia_request_configuration(handle, &link->conf)); 289 + CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 290 + CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 287 291 288 292 /* disable drive interrupts during IDE probe */ 289 293 outb(0x02, ctl_base); ··· 294 298 295 299 /* retry registration in case device is still spinning up */ 296 300 for (hd = -1, i = 0; i < 10; i++) { 297 - hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ, handle); 301 + hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ, link); 298 302 if (hd >= 0) break; 299 303 if (link->io.NumPorts1 == 0x20) { 300 304 outb(0x02, ctl_base + 0x10); 301 305 hd = idecs_register(io_base + 0x10, ctl_base + 0x10, 302 - link->irq.AssignedIRQ, handle); 306 + link->irq.AssignedIRQ, link); 303 307 if (hd >= 0) { 304 308 io_base += 0x10; 305 309 ctl_base += 0x10; ··· 334 338 goto failed; 335 339 336 340 cs_failed: 337 - cs_error(link->handle, last_fn, last_ret); 341 + cs_error(link, last_fn, last_ret); 338 342 failed: 339 343 kfree(stk); 340 344 ide_release(link); ··· 349 353 350 354 ======================================================================*/ 351 355 352 - void ide_release(dev_link_t *link) 356 + void ide_release(struct pcmcia_device *link) 353 357 { 354 358 ide_info_t *info = link->priv; 355 359 ··· 362 366 } 363 367 info->ndev = 0; 364 368 365 - pcmcia_disable_device(link->handle); 369 + pcmcia_disable_device(link); 366 370 } /* ide_release */ 367 371 368 372
+28 -32
drivers/isdn/hardware/avm/avm_cs.c
··· 51 51 handler. 52 52 */ 53 53 54 - static void avmcs_config(dev_link_t *link); 55 - static void avmcs_release(dev_link_t *link); 54 + static void avmcs_config(struct pcmcia_device *link); 55 + static void avmcs_release(struct pcmcia_device *link); 56 56 57 57 /* 58 58 The attach() and detach() entry points are used to create and destroy ··· 65 65 /* 66 66 A linked list of "instances" of the skeleton device. Each actual 67 67 PCMCIA card corresponds to one device instance, and is described 68 - by one dev_link_t structure (defined in ds.h). 68 + by one struct pcmcia_device structure (defined in ds.h). 69 69 70 70 You may not want to use a linked list for this -- for example, the 71 - memory card driver uses an array of dev_link_t pointers, where minor 71 + memory card driver uses an array of struct pcmcia_device pointers, where minor 72 72 device numbers are used to derive the corresponding array index. 73 73 */ 74 74 ··· 78 78 example, ethernet cards, modems). In other cases, there may be 79 79 many actual or logical devices (SCSI adapters, memory cards with 80 80 multiple partitions). The dev_node_t structures need to be kept 81 - in a linked list starting at the 'dev' field of a dev_link_t 81 + in a linked list starting at the 'dev' field of a struct pcmcia_device 82 82 structure. We allocate them in the card's private data structure, 83 83 because they generally can't be allocated dynamically. 84 84 */ ··· 145 145 146 146 ======================================================================*/ 147 147 148 - static void avmcs_detach(struct pcmcia_device *p_dev) 148 + static void avmcs_detach(struct pcmcia_device *link) 149 149 { 150 - dev_link_t *link = dev_to_instance(p_dev); 151 - 152 150 if (link->state & DEV_CONFIG) 153 151 avmcs_release(link); 154 152 ··· 161 163 162 164 ======================================================================*/ 163 165 164 - static int get_tuple(client_handle_t handle, tuple_t *tuple, 166 + static int get_tuple(struct pcmcia_device *handle, tuple_t *tuple, 165 167 cisparse_t *parse) 166 168 { 167 169 int i = pcmcia_get_tuple_data(handle, tuple); ··· 169 171 return pcmcia_parse_tuple(handle, tuple, parse); 170 172 } 171 173 172 - static int first_tuple(client_handle_t handle, tuple_t *tuple, 174 + static int first_tuple(struct pcmcia_device *handle, tuple_t *tuple, 173 175 cisparse_t *parse) 174 176 { 175 177 int i = pcmcia_get_first_tuple(handle, tuple); ··· 177 179 return get_tuple(handle, tuple, parse); 178 180 } 179 181 180 - static int next_tuple(client_handle_t handle, tuple_t *tuple, 182 + static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple, 181 183 cisparse_t *parse) 182 184 { 183 185 int i = pcmcia_get_next_tuple(handle, tuple); ··· 185 187 return get_tuple(handle, tuple, parse); 186 188 } 187 189 188 - static void avmcs_config(dev_link_t *link) 190 + static void avmcs_config(struct pcmcia_device *link) 189 191 { 190 - client_handle_t handle; 191 192 tuple_t tuple; 192 193 cisparse_t parse; 193 194 cistpl_cftable_entry_t *cf = &parse.cftable_entry; ··· 196 199 char devname[128]; 197 200 int cardtype; 198 201 int (*addcard)(unsigned int port, unsigned irq); 199 - 200 - handle = link->handle; 202 + 201 203 dev = link->priv; 202 204 203 205 /* ··· 205 209 */ 206 210 do { 207 211 tuple.DesiredTuple = CISTPL_CONFIG; 208 - i = pcmcia_get_first_tuple(handle, &tuple); 212 + i = pcmcia_get_first_tuple(link, &tuple); 209 213 if (i != CS_SUCCESS) break; 210 214 tuple.TupleData = buf; 211 215 tuple.TupleDataMax = 64; 212 216 tuple.TupleOffset = 0; 213 - i = pcmcia_get_tuple_data(handle, &tuple); 217 + i = pcmcia_get_tuple_data(link, &tuple); 214 218 if (i != CS_SUCCESS) break; 215 - i = pcmcia_parse_tuple(handle, &tuple, &parse); 219 + i = pcmcia_parse_tuple(link, &tuple, &parse); 216 220 if (i != CS_SUCCESS) break; 217 221 link->conf.ConfigBase = parse.config.base; 218 222 } while (0); 219 223 if (i != CS_SUCCESS) { 220 - cs_error(link->handle, ParseTuple, i); 224 + cs_error(link, ParseTuple, i); 221 225 link->state &= ~DEV_CONFIG_PENDING; 222 226 return; 223 227 } ··· 234 238 tuple.DesiredTuple = CISTPL_VERS_1; 235 239 236 240 devname[0] = 0; 237 - if( !first_tuple(handle, &tuple, &parse) && parse.version_1.ns > 1 ) { 241 + if( !first_tuple(link, &tuple, &parse) && parse.version_1.ns > 1 ) { 238 242 strlcpy(devname,parse.version_1.str + parse.version_1.ofs[1], 239 243 sizeof(devname)); 240 244 } ··· 245 249 tuple.TupleOffset = 0; tuple.TupleDataMax = 255; 246 250 tuple.Attributes = 0; 247 251 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 248 - i = first_tuple(handle, &tuple, &parse); 252 + i = first_tuple(link, &tuple, &parse); 249 253 while (i == CS_SUCCESS) { 250 254 if (cf->io.nwin > 0) { 251 255 link->conf.ConfigIndex = cf->index; ··· 255 259 printk(KERN_INFO "avm_cs: testing i/o %#x-%#x\n", 256 260 link->io.BasePort1, 257 261 link->io.BasePort1+link->io.NumPorts1-1); 258 - i = pcmcia_request_io(link->handle, &link->io); 262 + i = pcmcia_request_io(link, &link->io); 259 263 if (i == CS_SUCCESS) goto found_port; 260 264 } 261 - i = next_tuple(handle, &tuple, &parse); 265 + i = next_tuple(link, &tuple, &parse); 262 266 } 263 267 264 268 found_port: 265 269 if (i != CS_SUCCESS) { 266 - cs_error(link->handle, RequestIO, i); 270 + cs_error(link, RequestIO, i); 267 271 break; 268 272 } 269 273 270 274 /* 271 275 * allocate an interrupt line 272 276 */ 273 - i = pcmcia_request_irq(link->handle, &link->irq); 277 + i = pcmcia_request_irq(link, &link->irq); 274 278 if (i != CS_SUCCESS) { 275 - cs_error(link->handle, RequestIRQ, i); 279 + cs_error(link, RequestIRQ, i); 276 280 /* undo */ 277 - pcmcia_disable_device(link->handle); 281 + pcmcia_disable_device(link); 278 282 break; 279 283 } 280 284 281 285 /* 282 286 * configure the PCMCIA socket 283 287 */ 284 - i = pcmcia_request_configuration(link->handle, &link->conf); 288 + i = pcmcia_request_configuration(link, &link->conf); 285 289 if (i != CS_SUCCESS) { 286 - cs_error(link->handle, RequestConfiguration, i); 287 - pcmcia_disable_device(link->handle); 290 + cs_error(link, RequestConfiguration, i); 291 + pcmcia_disable_device(link); 288 292 break; 289 293 } 290 294 ··· 347 351 348 352 ======================================================================*/ 349 353 350 - static void avmcs_release(dev_link_t *link) 354 + static void avmcs_release(struct pcmcia_device *link) 351 355 { 352 356 b1pcmcia_delcard(link->io.BasePort1, link->irq.AssignedIRQ); 353 - pcmcia_disable_device(link->handle); 357 + pcmcia_disable_device(link); 354 358 } /* avmcs_release */ 355 359 356 360
+28 -32
drivers/isdn/hisax/avma1_cs.c
··· 67 67 handler. 68 68 */ 69 69 70 - static void avma1cs_config(dev_link_t *link); 71 - static void avma1cs_release(dev_link_t *link); 70 + static void avma1cs_config(struct pcmcia_device *link); 71 + static void avma1cs_release(struct pcmcia_device *link); 72 72 73 73 /* 74 74 The attach() and detach() entry points are used to create and destroy ··· 82 82 /* 83 83 A linked list of "instances" of the skeleton device. Each actual 84 84 PCMCIA card corresponds to one device instance, and is described 85 - by one dev_link_t structure (defined in ds.h). 85 + by one struct pcmcia_device structure (defined in ds.h). 86 86 87 87 You may not want to use a linked list for this -- for example, the 88 - memory card driver uses an array of dev_link_t pointers, where minor 88 + memory card driver uses an array of struct pcmcia_device pointers, where minor 89 89 device numbers are used to derive the corresponding array index. 90 90 */ 91 91 ··· 95 95 example, ethernet cards, modems). In other cases, there may be 96 96 many actual or logical devices (SCSI adapters, memory cards with 97 97 multiple partitions). The dev_node_t structures need to be kept 98 - in a linked list starting at the 'dev' field of a dev_link_t 98 + in a linked list starting at the 'dev' field of a struct pcmcia_device 99 99 structure. We allocate them in the card's private data structure, 100 100 because they generally can't be allocated dynamically. 101 101 */ ··· 164 164 165 165 ======================================================================*/ 166 166 167 - static void avma1cs_detach(struct pcmcia_device *p_dev) 167 + static void avma1cs_detach(struct pcmcia_device *link) 168 168 { 169 - dev_link_t *link = dev_to_instance(p_dev); 170 - 171 169 DEBUG(0, "avma1cs_detach(0x%p)\n", link); 172 170 173 171 if (link->state & DEV_CONFIG) ··· 182 184 183 185 ======================================================================*/ 184 186 185 - static int get_tuple(client_handle_t handle, tuple_t *tuple, 187 + static int get_tuple(struct pcmcia_device *handle, tuple_t *tuple, 186 188 cisparse_t *parse) 187 189 { 188 190 int i = pcmcia_get_tuple_data(handle, tuple); ··· 190 192 return pcmcia_parse_tuple(handle, tuple, parse); 191 193 } 192 194 193 - static int first_tuple(client_handle_t handle, tuple_t *tuple, 195 + static int first_tuple(struct pcmcia_device *handle, tuple_t *tuple, 194 196 cisparse_t *parse) 195 197 { 196 198 int i = pcmcia_get_first_tuple(handle, tuple); ··· 198 200 return get_tuple(handle, tuple, parse); 199 201 } 200 202 201 - static int next_tuple(client_handle_t handle, tuple_t *tuple, 203 + static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple, 202 204 cisparse_t *parse) 203 205 { 204 206 int i = pcmcia_get_next_tuple(handle, tuple); ··· 206 208 return get_tuple(handle, tuple, parse); 207 209 } 208 210 209 - static void avma1cs_config(dev_link_t *link) 211 + static void avma1cs_config(struct pcmcia_device *link) 210 212 { 211 - client_handle_t handle; 212 213 tuple_t tuple; 213 214 cisparse_t parse; 214 215 cistpl_cftable_entry_t *cf = &parse.cftable_entry; ··· 217 220 char devname[128]; 218 221 IsdnCard_t icard; 219 222 int busy = 0; 220 - 221 - handle = link->handle; 223 + 222 224 dev = link->priv; 223 225 224 226 DEBUG(0, "avma1cs_config(0x%p)\n", link); ··· 228 232 */ 229 233 do { 230 234 tuple.DesiredTuple = CISTPL_CONFIG; 231 - i = pcmcia_get_first_tuple(handle, &tuple); 235 + i = pcmcia_get_first_tuple(link, &tuple); 232 236 if (i != CS_SUCCESS) break; 233 237 tuple.TupleData = buf; 234 238 tuple.TupleDataMax = 64; 235 239 tuple.TupleOffset = 0; 236 - i = pcmcia_get_tuple_data(handle, &tuple); 240 + i = pcmcia_get_tuple_data(link, &tuple); 237 241 if (i != CS_SUCCESS) break; 238 - i = pcmcia_parse_tuple(handle, &tuple, &parse); 242 + i = pcmcia_parse_tuple(link, &tuple, &parse); 239 243 if (i != CS_SUCCESS) break; 240 244 link->conf.ConfigBase = parse.config.base; 241 245 } while (0); 242 246 if (i != CS_SUCCESS) { 243 - cs_error(link->handle, ParseTuple, i); 247 + cs_error(link, ParseTuple, i); 244 248 link->state &= ~DEV_CONFIG_PENDING; 245 249 return; 246 250 } ··· 257 261 tuple.DesiredTuple = CISTPL_VERS_1; 258 262 259 263 devname[0] = 0; 260 - if( !first_tuple(handle, &tuple, &parse) && parse.version_1.ns > 1 ) { 264 + if( !first_tuple(link, &tuple, &parse) && parse.version_1.ns > 1 ) { 261 265 strlcpy(devname,parse.version_1.str + parse.version_1.ofs[1], 262 266 sizeof(devname)); 263 267 } ··· 268 272 tuple.TupleOffset = 0; tuple.TupleDataMax = 255; 269 273 tuple.Attributes = 0; 270 274 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 271 - i = first_tuple(handle, &tuple, &parse); 275 + i = first_tuple(link, &tuple, &parse); 272 276 while (i == CS_SUCCESS) { 273 277 if (cf->io.nwin > 0) { 274 278 link->conf.ConfigIndex = cf->index; ··· 278 282 printk(KERN_INFO "avma1_cs: testing i/o %#x-%#x\n", 279 283 link->io.BasePort1, 280 284 link->io.BasePort1+link->io.NumPorts1 - 1); 281 - i = pcmcia_request_io(link->handle, &link->io); 285 + i = pcmcia_request_io(link, &link->io); 282 286 if (i == CS_SUCCESS) goto found_port; 283 287 } 284 - i = next_tuple(handle, &tuple, &parse); 288 + i = next_tuple(link, &tuple, &parse); 285 289 } 286 290 287 291 found_port: 288 292 if (i != CS_SUCCESS) { 289 - cs_error(link->handle, RequestIO, i); 293 + cs_error(link, RequestIO, i); 290 294 break; 291 295 } 292 296 293 297 /* 294 298 * allocate an interrupt line 295 299 */ 296 - i = pcmcia_request_irq(link->handle, &link->irq); 300 + i = pcmcia_request_irq(link, &link->irq); 297 301 if (i != CS_SUCCESS) { 298 - cs_error(link->handle, RequestIRQ, i); 302 + cs_error(link, RequestIRQ, i); 299 303 /* undo */ 300 - pcmcia_disable_device(link->handle); 304 + pcmcia_disable_device(link); 301 305 break; 302 306 } 303 307 304 308 /* 305 309 * configure the PCMCIA socket 306 310 */ 307 - i = pcmcia_request_configuration(link->handle, &link->conf); 311 + i = pcmcia_request_configuration(link, &link->conf); 308 312 if (i != CS_SUCCESS) { 309 - cs_error(link->handle, RequestConfiguration, i); 310 - pcmcia_disable_device(link->handle); 313 + cs_error(link, RequestConfiguration, i); 314 + pcmcia_disable_device(link); 311 315 break; 312 316 } 313 317 ··· 354 358 355 359 ======================================================================*/ 356 360 357 - static void avma1cs_release(dev_link_t *link) 361 + static void avma1cs_release(struct pcmcia_device *link) 358 362 { 359 363 local_info_t *local = link->priv; 360 364 ··· 363 367 /* now unregister function with hisax */ 364 368 HiSax_closecard(local->node.minor); 365 369 366 - pcmcia_disable_device(link->handle); 370 + pcmcia_disable_device(link); 367 371 } /* avma1cs_release */ 368 372 369 373
+22 -28
drivers/isdn/hisax/elsa_cs.c
··· 94 94 handler. 95 95 */ 96 96 97 - static void elsa_cs_config(dev_link_t *link); 98 - static void elsa_cs_release(dev_link_t *link); 97 + static void elsa_cs_config(struct pcmcia_device *link); 98 + static void elsa_cs_release(struct pcmcia_device *link); 99 99 100 100 /* 101 101 The attach() and detach() entry points are used to create and destroy ··· 111 111 example, ethernet cards, modems). In other cases, there may be 112 112 many actual or logical devices (SCSI adapters, memory cards with 113 113 multiple partitions). The dev_node_t structures need to be kept 114 - in a linked list starting at the 'dev' field of a dev_link_t 114 + in a linked list starting at the 'dev' field of a struct pcmcia_device 115 115 structure. We allocate them in the card's private data structure, 116 116 because they generally shouldn't be allocated dynamically. 117 117 In this case, we also provide a flag to indicate if a device is ··· 139 139 140 140 ======================================================================*/ 141 141 142 - static int elsa_cs_attach(struct pcmcia_device *p_dev) 142 + static int elsa_cs_attach(struct pcmcia_device *link) 143 143 { 144 144 local_info_t *local; 145 - dev_link_t *link = dev_to_instance(p_dev); 146 145 147 146 DEBUG(0, "elsa_cs_attach()\n"); 148 147 ··· 150 151 if (!local) return -ENOMEM; 151 152 memset(local, 0, sizeof(local_info_t)); 152 153 153 - local->p_dev = p_dev; 154 + local->p_dev = link; 154 155 link->priv = local; 155 156 156 157 local->cardnr = -1; ··· 189 190 190 191 ======================================================================*/ 191 192 192 - static void elsa_cs_detach(struct pcmcia_device *p_dev) 193 + static void elsa_cs_detach(struct pcmcia_device *link) 193 194 { 194 - dev_link_t *link = dev_to_instance(p_dev); 195 195 local_info_t *info = link->priv; 196 196 197 197 DEBUG(0, "elsa_cs_detach(0x%p)\n", link); ··· 211 213 device available to the system. 212 214 213 215 ======================================================================*/ 214 - static int get_tuple(client_handle_t handle, tuple_t *tuple, 216 + static int get_tuple(struct pcmcia_device *handle, tuple_t *tuple, 215 217 cisparse_t *parse) 216 218 { 217 219 int i = pcmcia_get_tuple_data(handle, tuple); ··· 219 221 return pcmcia_parse_tuple(handle, tuple, parse); 220 222 } 221 223 222 - static int first_tuple(client_handle_t handle, tuple_t *tuple, 224 + static int first_tuple(struct pcmcia_device *handle, tuple_t *tuple, 223 225 cisparse_t *parse) 224 226 { 225 227 int i = pcmcia_get_first_tuple(handle, tuple); ··· 227 229 return get_tuple(handle, tuple, parse); 228 230 } 229 231 230 - static int next_tuple(client_handle_t handle, tuple_t *tuple, 232 + static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple, 231 233 cisparse_t *parse) 232 234 { 233 235 int i = pcmcia_get_next_tuple(handle, tuple); ··· 235 237 return get_tuple(handle, tuple, parse); 236 238 } 237 239 238 - static void elsa_cs_config(dev_link_t *link) 240 + static void elsa_cs_config(struct pcmcia_device *link) 239 241 { 240 - client_handle_t handle; 241 242 tuple_t tuple; 242 243 cisparse_t parse; 243 244 local_info_t *dev; ··· 246 249 IsdnCard_t icard; 247 250 248 251 DEBUG(0, "elsa_config(0x%p)\n", link); 249 - handle = link->handle; 250 252 dev = link->priv; 251 253 252 254 /* ··· 257 261 tuple.TupleDataMax = 255; 258 262 tuple.TupleOffset = 0; 259 263 tuple.Attributes = 0; 260 - i = first_tuple(handle, &tuple, &parse); 264 + i = first_tuple(link, &tuple, &parse); 261 265 if (i != CS_SUCCESS) { 262 266 last_fn = ParseTuple; 263 267 goto cs_failed; ··· 272 276 tuple.TupleOffset = 0; tuple.TupleDataMax = 255; 273 277 tuple.Attributes = 0; 274 278 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 275 - i = first_tuple(handle, &tuple, &parse); 279 + i = first_tuple(link, &tuple, &parse); 276 280 while (i == CS_SUCCESS) { 277 281 if ( (cf->io.nwin > 0) && cf->io.win[0].base) { 278 282 printk(KERN_INFO "(elsa_cs: looks like the 96 model)\n"); 279 283 link->conf.ConfigIndex = cf->index; 280 284 link->io.BasePort1 = cf->io.win[0].base; 281 - i = pcmcia_request_io(link->handle, &link->io); 285 + i = pcmcia_request_io(link, &link->io); 282 286 if (i == CS_SUCCESS) break; 283 287 } else { 284 288 printk(KERN_INFO "(elsa_cs: looks like the 97 model)\n"); 285 289 link->conf.ConfigIndex = cf->index; 286 290 for (i = 0, j = 0x2f0; j > 0x100; j -= 0x10) { 287 291 link->io.BasePort1 = j; 288 - i = pcmcia_request_io(link->handle, &link->io); 292 + i = pcmcia_request_io(link, &link->io); 289 293 if (i == CS_SUCCESS) break; 290 294 } 291 295 break; 292 296 } 293 - i = next_tuple(handle, &tuple, &parse); 297 + i = next_tuple(link, &tuple, &parse); 294 298 } 295 299 296 300 if (i != CS_SUCCESS) { ··· 298 302 goto cs_failed; 299 303 } 300 304 301 - i = pcmcia_request_irq(link->handle, &link->irq); 305 + i = pcmcia_request_irq(link, &link->irq); 302 306 if (i != CS_SUCCESS) { 303 307 link->irq.AssignedIRQ = 0; 304 308 last_fn = RequestIRQ; 305 309 goto cs_failed; 306 310 } 307 311 308 - i = pcmcia_request_configuration(link->handle, &link->conf); 312 + i = pcmcia_request_configuration(link, &link->conf); 309 313 if (i != CS_SUCCESS) { 310 314 last_fn = RequestConfiguration; 311 315 goto cs_failed; ··· 348 352 349 353 return; 350 354 cs_failed: 351 - cs_error(link->handle, last_fn, i); 355 + cs_error(link, last_fn, i); 352 356 elsa_cs_release(link); 353 357 } /* elsa_cs_config */ 354 358 ··· 360 364 361 365 ======================================================================*/ 362 366 363 - static void elsa_cs_release(dev_link_t *link) 367 + static void elsa_cs_release(struct pcmcia_device *link) 364 368 { 365 369 local_info_t *local = link->priv; 366 370 ··· 373 377 } 374 378 } 375 379 376 - pcmcia_disable_device(link->handle); 380 + pcmcia_disable_device(link); 377 381 } /* elsa_cs_release */ 378 382 379 - static int elsa_suspend(struct pcmcia_device *p_dev) 383 + static int elsa_suspend(struct pcmcia_device *link) 380 384 { 381 - dev_link_t *link = dev_to_instance(p_dev); 382 385 local_info_t *dev = link->priv; 383 386 384 387 dev->busy = 1; ··· 385 390 return 0; 386 391 } 387 392 388 - static int elsa_resume(struct pcmcia_device *p_dev) 393 + static int elsa_resume(struct pcmcia_device *link) 389 394 { 390 - dev_link_t *link = dev_to_instance(p_dev); 391 395 local_info_t *dev = link->priv; 392 396 393 397 dev->busy = 0;
+26 -32
drivers/isdn/hisax/sedlbauer_cs.c
··· 95 95 event handler. 96 96 */ 97 97 98 - static void sedlbauer_config(dev_link_t *link); 99 - static void sedlbauer_release(dev_link_t *link); 98 + static void sedlbauer_config(struct pcmcia_device *link); 99 + static void sedlbauer_release(struct pcmcia_device *link); 100 100 101 101 /* 102 102 The attach() and detach() entry points are used to create and destroy ··· 119 119 example, ethernet cards, modems). In other cases, there may be 120 120 many actual or logical devices (SCSI adapters, memory cards with 121 121 multiple partitions). The dev_node_t structures need to be kept 122 - in a linked list starting at the 'dev' field of a dev_link_t 122 + in a linked list starting at the 'dev' field of a struct pcmcia_device 123 123 structure. We allocate them in the card's private data structure, 124 124 because they generally shouldn't be allocated dynamically. 125 125 ··· 148 148 149 149 ======================================================================*/ 150 150 151 - static int sedlbauer_attach(struct pcmcia_device *p_dev) 151 + static int sedlbauer_attach(struct pcmcia_device *link) 152 152 { 153 153 local_info_t *local; 154 - dev_link_t *link = dev_to_instance(p_dev); 155 - 154 + 156 155 DEBUG(0, "sedlbauer_attach()\n"); 157 156 158 157 /* Allocate space for private device-specific data */ ··· 160 161 memset(local, 0, sizeof(local_info_t)); 161 162 local->cardnr = -1; 162 163 163 - local->p_dev = p_dev; 164 + local->p_dev = link; 164 165 link->priv = local; 165 166 166 167 /* Interrupt setup */ ··· 201 202 202 203 ======================================================================*/ 203 204 204 - static void sedlbauer_detach(struct pcmcia_device *p_dev) 205 + static void sedlbauer_detach(struct pcmcia_device *link) 205 206 { 206 - dev_link_t *link = dev_to_instance(p_dev); 207 - 208 207 DEBUG(0, "sedlbauer_detach(0x%p)\n", link); 209 208 210 209 if (link->state & DEV_CONFIG) { ··· 224 227 #define CS_CHECK(fn, ret) \ 225 228 do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 226 229 227 - static void sedlbauer_config(dev_link_t *link) 230 + static void sedlbauer_config(struct pcmcia_device *link) 228 231 { 229 - client_handle_t handle = link->handle; 230 232 local_info_t *dev = link->priv; 231 233 tuple_t tuple; 232 234 cisparse_t parse; ··· 247 251 tuple.TupleData = buf; 248 252 tuple.TupleDataMax = sizeof(buf); 249 253 tuple.TupleOffset = 0; 250 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 251 - CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 252 - CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse)); 254 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 255 + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 256 + CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); 253 257 link->conf.ConfigBase = parse.config.base; 254 258 link->conf.Present = parse.config.rmask[0]; 255 259 256 260 /* Configure card */ 257 261 link->state |= DEV_CONFIG; 258 262 259 - CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(handle, &conf)); 263 + CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(link, &conf)); 260 264 261 265 /* 262 266 In this loop, we scan the CIS for configuration table entries, ··· 271 275 will only use the CIS to fill in implementation-defined details. 272 276 */ 273 277 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 274 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 278 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 275 279 while (1) { 276 280 cistpl_cftable_entry_t dflt = { 0 }; 277 281 cistpl_cftable_entry_t *cfg = &(parse.cftable_entry); 278 - if (pcmcia_get_tuple_data(handle, &tuple) != 0 || 279 - pcmcia_parse_tuple(handle, &tuple, &parse) != 0) 282 + if (pcmcia_get_tuple_data(link, &tuple) != 0 || 283 + pcmcia_parse_tuple(link, &tuple, &parse) != 0) 280 284 goto next_entry; 281 285 282 286 if (cfg->flags & CISTPL_CFTABLE_DEFAULT) dflt = *cfg; ··· 330 334 link->io.NumPorts2 = io->win[1].len; 331 335 } 332 336 /* This reserves IO space but doesn't actually enable it */ 333 - if (pcmcia_request_io(link->handle, &link->io) != 0) 337 + if (pcmcia_request_io(link, &link->io) != 0) 334 338 goto next_entry; 335 339 } 336 340 337 341 /* 338 342 Now set up a common memory window, if needed. There is room 339 - in the dev_link_t structure for one memory window handle, 343 + in the struct pcmcia_device structure for one memory window handle, 340 344 but if the base addresses need to be saved, or if multiple 341 345 windows are needed, the info should go in the private data 342 346 structure for this device. ··· 357 361 req.Size = 0x1000; 358 362 */ 359 363 req.AccessSpeed = 0; 360 - if (pcmcia_request_window(&link->handle, &req, &link->win) != 0) 364 + if (pcmcia_request_window(&link, &req, &link->win) != 0) 361 365 goto next_entry; 362 366 map.Page = 0; map.CardOffset = mem->win[0].card_addr; 363 367 if (pcmcia_map_mem_page(link->win, &map) != 0) ··· 367 371 break; 368 372 369 373 next_entry: 370 - CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(handle, &tuple)); 374 + CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(link, &tuple)); 371 375 } 372 376 373 377 /* ··· 376 380 irq structure is initialized. 377 381 */ 378 382 if (link->conf.Attributes & CONF_ENABLE_IRQ) 379 - CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq)); 383 + CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 380 384 381 385 /* 382 386 This actually configures the PCMCIA socket -- setting up 383 387 the I/O windows and the interrupt mapping, and putting the 384 388 card and host interface into "Memory and IO" mode. 385 389 */ 386 - CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf)); 390 + CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 387 391 388 392 /* 389 393 At this point, the dev_node_t structure(s) need to be ··· 429 433 return; 430 434 431 435 cs_failed: 432 - cs_error(link->handle, last_fn, last_ret); 436 + cs_error(link, last_fn, last_ret); 433 437 sedlbauer_release(link); 434 438 435 439 } /* sedlbauer_config */ ··· 442 446 443 447 ======================================================================*/ 444 448 445 - static void sedlbauer_release(dev_link_t *link) 449 + static void sedlbauer_release(struct pcmcia_device *link) 446 450 { 447 451 local_info_t *local = link->priv; 448 452 DEBUG(0, "sedlbauer_release(0x%p)\n", link); ··· 454 458 } 455 459 } 456 460 457 - pcmcia_disable_device(link->handle); 461 + pcmcia_disable_device(link); 458 462 } /* sedlbauer_release */ 459 463 460 - static int sedlbauer_suspend(struct pcmcia_device *p_dev) 464 + static int sedlbauer_suspend(struct pcmcia_device *link) 461 465 { 462 - dev_link_t *link = dev_to_instance(p_dev); 463 466 local_info_t *dev = link->priv; 464 467 465 468 dev->stop = 1; ··· 466 471 return 0; 467 472 } 468 473 469 - static int sedlbauer_resume(struct pcmcia_device *p_dev) 474 + static int sedlbauer_resume(struct pcmcia_device *link) 470 475 { 471 - dev_link_t *link = dev_to_instance(p_dev); 472 476 local_info_t *dev = link->priv; 473 477 474 478 dev->stop = 0;
+24 -30
drivers/isdn/hisax/teles_cs.c
··· 75 75 handler. 76 76 */ 77 77 78 - static void teles_cs_config(dev_link_t *link); 79 - static void teles_cs_release(dev_link_t *link); 78 + static void teles_cs_config(struct pcmcia_device *link); 79 + static void teles_cs_release(struct pcmcia_device *link); 80 80 81 81 /* 82 82 The attach() and detach() entry points are used to create and destroy ··· 89 89 /* 90 90 A linked list of "instances" of the teles_cs device. Each actual 91 91 PCMCIA card corresponds to one device instance, and is described 92 - by one dev_link_t structure (defined in ds.h). 92 + by one struct pcmcia_device structure (defined in ds.h). 93 93 94 94 You may not want to use a linked list for this -- for example, the 95 - memory card driver uses an array of dev_link_t pointers, where minor 95 + memory card driver uses an array of struct pcmcia_device pointers, where minor 96 96 device numbers are used to derive the corresponding array index. 97 97 */ 98 98 ··· 102 102 example, ethernet cards, modems). In other cases, there may be 103 103 many actual or logical devices (SCSI adapters, memory cards with 104 104 multiple partitions). The dev_node_t structures need to be kept 105 - in a linked list starting at the 'dev' field of a dev_link_t 105 + in a linked list starting at the 'dev' field of a struct pcmcia_device 106 106 structure. We allocate them in the card's private data structure, 107 107 because they generally shouldn't be allocated dynamically. 108 108 In this case, we also provide a flag to indicate if a device is ··· 130 130 131 131 ======================================================================*/ 132 132 133 - static int teles_attach(struct pcmcia_device *p_dev) 133 + static int teles_attach(struct pcmcia_device *link) 134 134 { 135 135 local_info_t *local; 136 - dev_link_t *link = dev_to_instance(p_dev); 137 136 138 137 DEBUG(0, "teles_attach()\n"); 139 138 ··· 142 143 memset(local, 0, sizeof(local_info_t)); 143 144 local->cardnr = -1; 144 145 145 - local->p_dev = p_dev; 146 + local->p_dev = link; 146 147 link->priv = local; 147 148 148 149 /* Interrupt setup */ ··· 179 180 180 181 ======================================================================*/ 181 182 182 - static void teles_detach(struct pcmcia_device *p_dev) 183 + static void teles_detach(struct pcmcia_device *link) 183 184 { 184 - dev_link_t *link = dev_to_instance(p_dev); 185 185 local_info_t *info = link->priv; 186 186 187 187 DEBUG(0, "teles_detach(0x%p)\n", link); ··· 201 203 device available to the system. 202 204 203 205 ======================================================================*/ 204 - static int get_tuple(client_handle_t handle, tuple_t *tuple, 206 + static int get_tuple(struct pcmcia_device *handle, tuple_t *tuple, 205 207 cisparse_t *parse) 206 208 { 207 209 int i = pcmcia_get_tuple_data(handle, tuple); ··· 209 211 return pcmcia_parse_tuple(handle, tuple, parse); 210 212 } 211 213 212 - static int first_tuple(client_handle_t handle, tuple_t *tuple, 214 + static int first_tuple(struct pcmcia_device *handle, tuple_t *tuple, 213 215 cisparse_t *parse) 214 216 { 215 217 int i = pcmcia_get_first_tuple(handle, tuple); ··· 217 219 return get_tuple(handle, tuple, parse); 218 220 } 219 221 220 - static int next_tuple(client_handle_t handle, tuple_t *tuple, 222 + static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple, 221 223 cisparse_t *parse) 222 224 { 223 225 int i = pcmcia_get_next_tuple(handle, tuple); ··· 225 227 return get_tuple(handle, tuple, parse); 226 228 } 227 229 228 - static void teles_cs_config(dev_link_t *link) 230 + static void teles_cs_config(struct pcmcia_device *link) 229 231 { 230 - client_handle_t handle; 231 232 tuple_t tuple; 232 233 cisparse_t parse; 233 234 local_info_t *dev; ··· 236 239 IsdnCard_t icard; 237 240 238 241 DEBUG(0, "teles_config(0x%p)\n", link); 239 - handle = link->handle; 240 242 dev = link->priv; 241 243 242 244 /* ··· 247 251 tuple.TupleDataMax = 255; 248 252 tuple.TupleOffset = 0; 249 253 tuple.Attributes = 0; 250 - i = first_tuple(handle, &tuple, &parse); 254 + i = first_tuple(link, &tuple, &parse); 251 255 if (i != CS_SUCCESS) { 252 256 last_fn = ParseTuple; 253 257 goto cs_failed; ··· 262 266 tuple.TupleOffset = 0; tuple.TupleDataMax = 255; 263 267 tuple.Attributes = 0; 264 268 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 265 - i = first_tuple(handle, &tuple, &parse); 269 + i = first_tuple(link, &tuple, &parse); 266 270 while (i == CS_SUCCESS) { 267 271 if ( (cf->io.nwin > 0) && cf->io.win[0].base) { 268 272 printk(KERN_INFO "(teles_cs: looks like the 96 model)\n"); 269 273 link->conf.ConfigIndex = cf->index; 270 274 link->io.BasePort1 = cf->io.win[0].base; 271 - i = pcmcia_request_io(link->handle, &link->io); 275 + i = pcmcia_request_io(link, &link->io); 272 276 if (i == CS_SUCCESS) break; 273 277 } else { 274 278 printk(KERN_INFO "(teles_cs: looks like the 97 model)\n"); 275 279 link->conf.ConfigIndex = cf->index; 276 280 for (i = 0, j = 0x2f0; j > 0x100; j -= 0x10) { 277 281 link->io.BasePort1 = j; 278 - i = pcmcia_request_io(link->handle, &link->io); 282 + i = pcmcia_request_io(link, &link->io); 279 283 if (i == CS_SUCCESS) break; 280 284 } 281 285 break; 282 286 } 283 - i = next_tuple(handle, &tuple, &parse); 287 + i = next_tuple(link, &tuple, &parse); 284 288 } 285 289 286 290 if (i != CS_SUCCESS) { ··· 288 292 goto cs_failed; 289 293 } 290 294 291 - i = pcmcia_request_irq(link->handle, &link->irq); 295 + i = pcmcia_request_irq(link, &link->irq); 292 296 if (i != CS_SUCCESS) { 293 297 link->irq.AssignedIRQ = 0; 294 298 last_fn = RequestIRQ; 295 299 goto cs_failed; 296 300 } 297 301 298 - i = pcmcia_request_configuration(link->handle, &link->conf); 302 + i = pcmcia_request_configuration(link, &link->conf); 299 303 if (i != CS_SUCCESS) { 300 304 last_fn = RequestConfiguration; 301 305 goto cs_failed; ··· 338 342 339 343 return; 340 344 cs_failed: 341 - cs_error(link->handle, last_fn, i); 345 + cs_error(link, last_fn, i); 342 346 teles_cs_release(link); 343 347 } /* teles_cs_config */ 344 348 ··· 350 354 351 355 ======================================================================*/ 352 356 353 - static void teles_cs_release(dev_link_t *link) 357 + static void teles_cs_release(struct pcmcia_device *link) 354 358 { 355 359 local_info_t *local = link->priv; 356 360 ··· 363 367 } 364 368 } 365 369 366 - pcmcia_disable_device(link->handle); 370 + pcmcia_disable_device(link); 367 371 } /* teles_cs_release */ 368 372 369 - static int teles_suspend(struct pcmcia_device *p_dev) 373 + static int teles_suspend(struct pcmcia_device *link) 370 374 { 371 - dev_link_t *link = dev_to_instance(p_dev); 372 375 local_info_t *dev = link->priv; 373 376 374 377 dev->busy = 1; ··· 375 380 return 0; 376 381 } 377 382 378 - static int teles_resume(struct pcmcia_device *p_dev) 383 + static int teles_resume(struct pcmcia_device *link) 379 384 { 380 - dev_link_t *link = dev_to_instance(p_dev); 381 385 local_info_t *dev = link->priv; 382 386 383 387 dev->busy = 0;
+26 -29
drivers/mtd/maps/pcmciamtd.c
··· 122 122 dev->offset, mrq.CardOffset); 123 123 mrq.Page = 0; 124 124 if( (ret = pcmcia_map_mem_page(win, &mrq)) != CS_SUCCESS) { 125 - cs_error(dev->p_dev->handle, MapMemPage, ret); 125 + cs_error(dev->p_dev, MapMemPage, ret); 126 126 return NULL; 127 127 } 128 128 dev->offset = mrq.CardOffset; ··· 319 319 static void pcmciamtd_set_vpp(struct map_info *map, int on) 320 320 { 321 321 struct pcmciamtd_dev *dev = (struct pcmciamtd_dev *)map->map_priv_1; 322 - dev_link_t *link = dev->p_dev; 322 + struct pcmcia_device *link = dev->p_dev; 323 323 modconf_t mod; 324 324 int ret; 325 325 ··· 328 328 mod.Vpp1 = mod.Vpp2 = on ? dev->vpp : 0; 329 329 330 330 DEBUG(2, "dev = %p on = %d vpp = %d\n", dev, on, dev->vpp); 331 - ret = pcmcia_modify_configuration(link->handle, &mod); 331 + ret = pcmcia_modify_configuration(link, &mod); 332 332 if(ret != CS_SUCCESS) { 333 - cs_error(link->handle, ModifyConfiguration, ret); 333 + cs_error(link, ModifyConfiguration, ret); 334 334 } 335 335 } 336 336 ··· 340 340 * still open, this will be postponed until it is closed. 341 341 */ 342 342 343 - static void pcmciamtd_release(dev_link_t *link) 343 + static void pcmciamtd_release(struct pcmcia_device *link) 344 344 { 345 345 struct pcmciamtd_dev *dev = link->priv; 346 346 ··· 353 353 } 354 354 pcmcia_release_window(link->win); 355 355 } 356 - pcmcia_disable_device(link->handle); 356 + pcmcia_disable_device(link); 357 357 } 358 358 359 359 360 - static void card_settings(struct pcmciamtd_dev *dev, dev_link_t *link, int *new_name) 360 + static void card_settings(struct pcmciamtd_dev *dev, struct pcmcia_device *link, int *new_name) 361 361 { 362 362 int rc; 363 363 tuple_t tuple; ··· 370 370 tuple.TupleOffset = 0; 371 371 tuple.DesiredTuple = RETURN_FIRST_TUPLE; 372 372 373 - rc = pcmcia_get_first_tuple(link->handle, &tuple); 373 + rc = pcmcia_get_first_tuple(link, &tuple); 374 374 while(rc == CS_SUCCESS) { 375 - rc = pcmcia_get_tuple_data(link->handle, &tuple); 375 + rc = pcmcia_get_tuple_data(link, &tuple); 376 376 if(rc != CS_SUCCESS) { 377 - cs_error(link->handle, GetTupleData, rc); 377 + cs_error(link, GetTupleData, rc); 378 378 break; 379 379 } 380 - rc = pcmcia_parse_tuple(link->handle, &tuple, &parse); 380 + rc = pcmcia_parse_tuple(link, &tuple, &parse); 381 381 if(rc != CS_SUCCESS) { 382 - cs_error(link->handle, ParseTuple, rc); 382 + cs_error(link, ParseTuple, rc); 383 383 break; 384 384 } 385 385 ··· 450 450 DEBUG(2, "Unknown tuple code %d", tuple.TupleCode); 451 451 } 452 452 453 - rc = pcmcia_get_next_tuple(link->handle, &tuple); 453 + rc = pcmcia_get_next_tuple(link, &tuple); 454 454 } 455 455 if(!dev->pcmcia_map.size) 456 456 dev->pcmcia_map.size = MAX_PCMCIA_ADDR; ··· 487 487 #define CS_CHECK(fn, ret) \ 488 488 do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 489 489 490 - static void pcmciamtd_config(dev_link_t *link) 490 + static void pcmciamtd_config(struct pcmcia_device *link) 491 491 { 492 492 struct pcmciamtd_dev *dev = link->priv; 493 493 struct mtd_info *mtd = NULL; ··· 507 507 link->state |= DEV_CONFIG; 508 508 509 509 DEBUG(2, "Validating CIS"); 510 - ret = pcmcia_validate_cis(link->handle, &cisinfo); 510 + ret = pcmcia_validate_cis(link, &cisinfo); 511 511 if(ret != CS_SUCCESS) { 512 - cs_error(link->handle, GetTupleData, ret); 512 + cs_error(link, GetTupleData, ret); 513 513 } else { 514 514 DEBUG(2, "ValidateCIS found %d chains", cisinfo.Chains); 515 515 } ··· 537 537 req.Attributes |= (dev->pcmcia_map.bankwidth == 1) ? WIN_DATA_WIDTH_8 : WIN_DATA_WIDTH_16; 538 538 req.Base = 0; 539 539 req.AccessSpeed = mem_speed; 540 - link->win = (window_handle_t)link->handle; 540 + link->win = (window_handle_t)link; 541 541 req.Size = (force_size) ? force_size << 20 : MAX_PCMCIA_ADDR; 542 542 dev->win_size = 0; 543 543 ··· 545 545 int ret; 546 546 DEBUG(2, "requesting window with size = %dKiB memspeed = %d", 547 547 req.Size >> 10, req.AccessSpeed); 548 - ret = pcmcia_request_window(&link->handle, &req, &link->win); 548 + ret = pcmcia_request_window(&link, &req, &link->win); 549 549 DEBUG(2, "ret = %d dev->win_size = %d", ret, dev->win_size); 550 550 if(ret) { 551 551 req.Size >>= 1; ··· 566 566 DEBUG(1, "Allocated a window of %dKiB", dev->win_size >> 10); 567 567 568 568 /* Get write protect status */ 569 - CS_CHECK(GetStatus, pcmcia_get_status(link->handle, &status)); 569 + CS_CHECK(GetStatus, pcmcia_get_status(link, &status)); 570 570 DEBUG(2, "status value: 0x%x window handle = 0x%8.8lx", 571 571 status.CardState, (unsigned long)link->win); 572 572 dev->win_base = ioremap(req.Base, req.Size); ··· 583 583 dev->pcmcia_map.map_priv_2 = (unsigned long)link->win; 584 584 585 585 DEBUG(2, "Getting configuration"); 586 - CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(link->handle, &t)); 586 + CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(link, &t)); 587 587 DEBUG(2, "Vcc = %d Vpp1 = %d Vpp2 = %d", t.Vcc, t.Vpp1, t.Vpp2); 588 588 dev->vpp = (vpp) ? vpp : t.Vpp1; 589 589 link->conf.Attributes = 0; ··· 602 602 link->conf.ConfigIndex = 0; 603 603 link->conf.Present = t.Present; 604 604 DEBUG(2, "Setting Configuration"); 605 - ret = pcmcia_request_configuration(link->handle, &link->conf); 605 + ret = pcmcia_request_configuration(link, &link->conf); 606 606 if(ret != CS_SUCCESS) { 607 - cs_error(link->handle, RequestConfiguration, ret); 607 + cs_error(link, RequestConfiguration, ret); 608 608 } 609 609 610 610 if(mem_type == 1) { ··· 677 677 return; 678 678 679 679 cs_failed: 680 - cs_error(link->handle, last_fn, last_ret); 680 + cs_error(link, last_fn, last_ret); 681 681 err("CS Error, exiting"); 682 682 pcmciamtd_release(link); 683 683 return; ··· 709 709 * when the device is released. 710 710 */ 711 711 712 - static void pcmciamtd_detach(struct pcmcia_device *p_dev) 712 + static void pcmciamtd_detach(struct pcmcia_device *link) 713 713 { 714 - dev_link_t *link = dev_to_instance(p_dev); 715 - 716 714 DEBUG(3, "link=0x%p", link); 717 715 718 716 if(link->state & DEV_CONFIG) { ··· 730 732 * with Card Services. 731 733 */ 732 734 733 - static int pcmciamtd_attach(struct pcmcia_device *p_dev) 735 + static int pcmciamtd_attach(struct pcmcia_device *link) 734 736 { 735 737 struct pcmciamtd_dev *dev; 736 - dev_link_t *link = dev_to_instance(p_dev); 737 738 738 739 /* Create new memory card device */ 739 740 dev = kmalloc(sizeof(*dev), GFP_KERNEL); ··· 740 743 DEBUG(1, "dev=0x%p", dev); 741 744 742 745 memset(dev, 0, sizeof(*dev)); 743 - dev->p_dev = p_dev; 746 + dev->p_dev = link; 744 747 link->priv = dev; 745 748 746 749 link->conf.Attributes = 0;
+26 -31
drivers/net/pcmcia/3c574_cs.c
··· 225 225 226 226 /* Index of functions. */ 227 227 228 - static void tc574_config(dev_link_t *link); 229 - static void tc574_release(dev_link_t *link); 228 + static void tc574_config(struct pcmcia_device *link); 229 + static void tc574_release(struct pcmcia_device *link); 230 230 231 231 static void mdio_sync(kio_addr_t ioaddr, int bits); 232 232 static int mdio_read(kio_addr_t ioaddr, int phy_id, int location); ··· 256 256 with Card Services. 257 257 */ 258 258 259 - static int tc574_attach(struct pcmcia_device *p_dev) 259 + static int tc574_attach(struct pcmcia_device *link) 260 260 { 261 261 struct el3_private *lp; 262 262 struct net_device *dev; 263 - dev_link_t *link = dev_to_instance(p_dev); 264 263 265 264 DEBUG(0, "3c574_attach()\n"); 266 265 ··· 269 270 return -ENOMEM; 270 271 lp = netdev_priv(dev); 271 272 link->priv = dev; 272 - lp->p_dev = p_dev; 273 + lp->p_dev = link; 273 274 274 275 spin_lock_init(&lp->window_lock); 275 276 link->io.NumPorts1 = 32; ··· 311 312 312 313 */ 313 314 314 - static void tc574_detach(struct pcmcia_device *p_dev) 315 + static void tc574_detach(struct pcmcia_device *link) 315 316 { 316 - dev_link_t *link = dev_to_instance(p_dev); 317 317 struct net_device *dev = link->priv; 318 318 319 319 DEBUG(0, "3c574_detach(0x%p)\n", link); ··· 337 339 338 340 static const char *ram_split[] = {"5:3", "3:1", "1:1", "3:5"}; 339 341 340 - static void tc574_config(dev_link_t *link) 342 + static void tc574_config(struct pcmcia_device *link) 341 343 { 342 - client_handle_t handle = link->handle; 343 344 struct net_device *dev = link->priv; 344 345 struct el3_private *lp = netdev_priv(dev); 345 346 tuple_t tuple; ··· 356 359 357 360 tuple.Attributes = 0; 358 361 tuple.DesiredTuple = CISTPL_CONFIG; 359 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 362 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 360 363 tuple.TupleData = (cisdata_t *)buf; 361 364 tuple.TupleDataMax = 64; 362 365 tuple.TupleOffset = 0; 363 - CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 364 - CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse)); 366 + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 367 + CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); 365 368 link->conf.ConfigBase = parse.config.base; 366 369 link->conf.Present = parse.config.rmask[0]; 367 370 ··· 371 374 link->io.IOAddrLines = 16; 372 375 for (i = j = 0; j < 0x400; j += 0x20) { 373 376 link->io.BasePort1 = j ^ 0x300; 374 - i = pcmcia_request_io(link->handle, &link->io); 377 + i = pcmcia_request_io(link, &link->io); 375 378 if (i == CS_SUCCESS) break; 376 379 } 377 380 if (i != CS_SUCCESS) { 378 - cs_error(link->handle, RequestIO, i); 381 + cs_error(link, RequestIO, i); 379 382 goto failed; 380 383 } 381 - CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq)); 382 - CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf)); 384 + CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 385 + CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 383 386 384 387 dev->irq = link->irq.AssignedIRQ; 385 388 dev->base_addr = link->io.BasePort1; ··· 390 393 the hardware address. The future products may include a modem chip 391 394 and put the address in the CIS. */ 392 395 tuple.DesiredTuple = 0x88; 393 - if (pcmcia_get_first_tuple(handle, &tuple) == CS_SUCCESS) { 394 - pcmcia_get_tuple_data(handle, &tuple); 396 + if (pcmcia_get_first_tuple(link, &tuple) == CS_SUCCESS) { 397 + pcmcia_get_tuple_data(link, &tuple); 395 398 for (i = 0; i < 3; i++) 396 399 phys_addr[i] = htons(buf[i]); 397 400 } else { ··· 405 408 } 406 409 } 407 410 tuple.DesiredTuple = CISTPL_VERS_1; 408 - if (pcmcia_get_first_tuple(handle, &tuple) == CS_SUCCESS && 409 - pcmcia_get_tuple_data(handle, &tuple) == CS_SUCCESS && 410 - pcmcia_parse_tuple(handle, &tuple, &parse) == CS_SUCCESS) { 411 + if (pcmcia_get_first_tuple(link, &tuple) == CS_SUCCESS && 412 + pcmcia_get_tuple_data(link, &tuple) == CS_SUCCESS && 413 + pcmcia_parse_tuple(link, &tuple, &parse) == CS_SUCCESS) { 411 414 cardname = parse.version_1.str + parse.version_1.ofs[1]; 412 415 } else 413 416 cardname = "3Com 3c574"; ··· 468 471 469 472 link->state &= ~DEV_CONFIG_PENDING; 470 473 link->dev_node = &lp->node; 471 - SET_NETDEV_DEV(dev, &handle_to_dev(handle)); 474 + SET_NETDEV_DEV(dev, &handle_to_dev(link)); 472 475 473 476 if (register_netdev(dev) != 0) { 474 477 printk(KERN_NOTICE "3c574_cs: register_netdev() failed\n"); ··· 489 492 return; 490 493 491 494 cs_failed: 492 - cs_error(link->handle, last_fn, last_ret); 495 + cs_error(link, last_fn, last_ret); 493 496 failed: 494 497 tc574_release(link); 495 498 return; ··· 502 505 still open, this will be postponed until it is closed. 503 506 */ 504 507 505 - static void tc574_release(dev_link_t *link) 508 + static void tc574_release(struct pcmcia_device *link) 506 509 { 507 - pcmcia_disable_device(link->handle); 510 + pcmcia_disable_device(link); 508 511 } 509 512 510 - static int tc574_suspend(struct pcmcia_device *p_dev) 513 + static int tc574_suspend(struct pcmcia_device *link) 511 514 { 512 - dev_link_t *link = dev_to_instance(p_dev); 513 515 struct net_device *dev = link->priv; 514 516 515 517 if ((link->state & DEV_CONFIG) && (link->open)) ··· 517 521 return 0; 518 522 } 519 523 520 - static int tc574_resume(struct pcmcia_device *p_dev) 524 + static int tc574_resume(struct pcmcia_device *link) 521 525 { 522 - dev_link_t *link = dev_to_instance(p_dev); 523 526 struct net_device *dev = link->priv; 524 527 525 528 if ((link->state & DEV_CONFIG) && (link->open)) { ··· 734 739 static int el3_open(struct net_device *dev) 735 740 { 736 741 struct el3_private *lp = netdev_priv(dev); 737 - dev_link_t *link = lp->p_dev; 742 + struct pcmcia_device *link = lp->p_dev; 738 743 739 744 if (!DEV_OK(link)) 740 745 return -ENODEV; ··· 1180 1185 { 1181 1186 kio_addr_t ioaddr = dev->base_addr; 1182 1187 struct el3_private *lp = netdev_priv(dev); 1183 - dev_link_t *link = lp->p_dev; 1188 + struct pcmcia_device *link = lp->p_dev; 1184 1189 1185 1190 DEBUG(2, "%s: shutting down ethercard.\n", dev->name); 1186 1191
+27 -32
drivers/net/pcmcia/3c589_cs.c
··· 142 142 143 143 /*====================================================================*/ 144 144 145 - static void tc589_config(dev_link_t *link); 146 - static void tc589_release(dev_link_t *link); 145 + static void tc589_config(struct pcmcia_device *link); 146 + static void tc589_release(struct pcmcia_device *link); 147 147 148 148 static u16 read_eeprom(kio_addr_t ioaddr, int index); 149 149 static void tc589_reset(struct net_device *dev); ··· 170 170 171 171 ======================================================================*/ 172 172 173 - static int tc589_attach(struct pcmcia_device *p_dev) 173 + static int tc589_attach(struct pcmcia_device *link) 174 174 { 175 175 struct el3_private *lp; 176 176 struct net_device *dev; 177 - dev_link_t *link = dev_to_instance(p_dev); 178 177 179 178 DEBUG(0, "3c589_attach()\n"); 180 179 ··· 183 184 return -ENOMEM; 184 185 lp = netdev_priv(dev); 185 186 link->priv = dev; 186 - lp->p_dev = p_dev; 187 + lp->p_dev = link; 187 188 188 189 spin_lock_init(&lp->lock); 189 190 link->io.NumPorts1 = 16; ··· 226 227 227 228 ======================================================================*/ 228 229 229 - static void tc589_detach(struct pcmcia_device *p_dev) 230 + static void tc589_detach(struct pcmcia_device *link) 230 231 { 231 - dev_link_t *link = dev_to_instance(p_dev); 232 232 struct net_device *dev = link->priv; 233 233 234 234 DEBUG(0, "3c589_detach(0x%p)\n", link); ··· 252 254 #define CS_CHECK(fn, ret) \ 253 255 do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 254 256 255 - static void tc589_config(dev_link_t *link) 257 + static void tc589_config(struct pcmcia_device *link) 256 258 { 257 - client_handle_t handle = link->handle; 258 259 struct net_device *dev = link->priv; 259 260 struct el3_private *lp = netdev_priv(dev); 260 261 tuple_t tuple; ··· 268 271 phys_addr = (u16 *)dev->dev_addr; 269 272 tuple.Attributes = 0; 270 273 tuple.DesiredTuple = CISTPL_CONFIG; 271 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 274 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 272 275 tuple.TupleData = (cisdata_t *)buf; 273 276 tuple.TupleDataMax = sizeof(buf); 274 277 tuple.TupleOffset = 0; 275 - CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 276 - CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse)); 278 + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 279 + CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); 277 280 link->conf.ConfigBase = parse.config.base; 278 281 link->conf.Present = parse.config.rmask[0]; 279 282 280 283 /* Is this a 3c562? */ 281 284 tuple.DesiredTuple = CISTPL_MANFID; 282 285 tuple.Attributes = TUPLE_RETURN_COMMON; 283 - if ((pcmcia_get_first_tuple(handle, &tuple) == CS_SUCCESS) && 284 - (pcmcia_get_tuple_data(handle, &tuple) == CS_SUCCESS)) { 286 + if ((pcmcia_get_first_tuple(link, &tuple) == CS_SUCCESS) && 287 + (pcmcia_get_tuple_data(link, &tuple) == CS_SUCCESS)) { 285 288 if (le16_to_cpu(buf[0]) != MANFID_3COM) 286 289 printk(KERN_INFO "3c589_cs: hmmm, is this really a " 287 290 "3Com card??\n"); ··· 296 299 for (i = j = 0; j < 0x400; j += 0x10) { 297 300 if (multi && (j & 0x80)) continue; 298 301 link->io.BasePort1 = j ^ 0x300; 299 - i = pcmcia_request_io(link->handle, &link->io); 302 + i = pcmcia_request_io(link, &link->io); 300 303 if (i == CS_SUCCESS) break; 301 304 } 302 305 if (i != CS_SUCCESS) { 303 - cs_error(link->handle, RequestIO, i); 306 + cs_error(link, RequestIO, i); 304 307 goto failed; 305 308 } 306 - CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq)); 307 - CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf)); 309 + CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 310 + CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 308 311 309 312 dev->irq = link->irq.AssignedIRQ; 310 313 dev->base_addr = link->io.BasePort1; ··· 314 317 /* The 3c589 has an extra EEPROM for configuration info, including 315 318 the hardware address. The 3c562 puts the address in the CIS. */ 316 319 tuple.DesiredTuple = 0x88; 317 - if (pcmcia_get_first_tuple(handle, &tuple) == CS_SUCCESS) { 318 - pcmcia_get_tuple_data(handle, &tuple); 320 + if (pcmcia_get_first_tuple(link, &tuple) == CS_SUCCESS) { 321 + pcmcia_get_tuple_data(link, &tuple); 319 322 for (i = 0; i < 3; i++) 320 323 phys_addr[i] = htons(buf[i]); 321 324 } else { ··· 341 344 342 345 link->dev_node = &lp->node; 343 346 link->state &= ~DEV_CONFIG_PENDING; 344 - SET_NETDEV_DEV(dev, &handle_to_dev(handle)); 347 + SET_NETDEV_DEV(dev, &handle_to_dev(link)); 345 348 346 349 if (register_netdev(dev) != 0) { 347 350 printk(KERN_ERR "3c589_cs: register_netdev() failed\n"); ··· 362 365 return; 363 366 364 367 cs_failed: 365 - cs_error(link->handle, last_fn, last_ret); 368 + cs_error(link, last_fn, last_ret); 366 369 failed: 367 370 tc589_release(link); 368 371 return; ··· 377 380 378 381 ======================================================================*/ 379 382 380 - static void tc589_release(dev_link_t *link) 383 + static void tc589_release(struct pcmcia_device *link) 381 384 { 382 - pcmcia_disable_device(link->handle); 385 + pcmcia_disable_device(link); 383 386 } 384 387 385 - static int tc589_suspend(struct pcmcia_device *p_dev) 388 + static int tc589_suspend(struct pcmcia_device *link) 386 389 { 387 - dev_link_t *link = dev_to_instance(p_dev); 388 390 struct net_device *dev = link->priv; 389 391 390 392 if ((link->state & DEV_CONFIG) && (link->open)) ··· 392 396 return 0; 393 397 } 394 398 395 - static int tc589_resume(struct pcmcia_device *p_dev) 399 + static int tc589_resume(struct pcmcia_device *link) 396 400 { 397 - dev_link_t *link = dev_to_instance(p_dev); 398 401 struct net_device *dev = link->priv; 399 402 400 403 if ((link->state & DEV_CONFIG) && (link->open)) { ··· 564 569 static int el3_open(struct net_device *dev) 565 570 { 566 571 struct el3_private *lp = netdev_priv(dev); 567 - dev_link_t *link = lp->p_dev; 572 + struct pcmcia_device *link = lp->p_dev; 568 573 569 574 if (!DEV_OK(link)) 570 575 return -ENODEV; ··· 825 830 { 826 831 struct el3_private *lp = netdev_priv(dev); 827 832 unsigned long flags; 828 - dev_link_t *link = lp->p_dev; 833 + struct pcmcia_device *link = lp->p_dev; 829 834 830 835 if (DEV_OK(link)) { 831 836 spin_lock_irqsave(&lp->lock, flags); ··· 927 932 static void set_multicast_list(struct net_device *dev) 928 933 { 929 934 struct el3_private *lp = netdev_priv(dev); 930 - dev_link_t *link = lp->p_dev; 935 + struct pcmcia_device *link = lp->p_dev; 931 936 kio_addr_t ioaddr = dev->base_addr; 932 937 u16 opts = SetRxFilter | RxStation | RxBroadcast; 933 938 ··· 942 947 static int el3_close(struct net_device *dev) 943 948 { 944 949 struct el3_private *lp = netdev_priv(dev); 945 - dev_link_t *link = lp->p_dev; 950 + struct pcmcia_device *link = lp->p_dev; 946 951 kio_addr_t ioaddr = dev->base_addr; 947 952 948 953 DEBUG(1, "%s: shutting down ethercard.\n", dev->name);
+29 -34
drivers/net/pcmcia/axnet_cs.c
··· 86 86 87 87 /*====================================================================*/ 88 88 89 - static void axnet_config(dev_link_t *link); 90 - static void axnet_release(dev_link_t *link); 89 + static void axnet_config(struct pcmcia_device *link); 90 + static void axnet_release(struct pcmcia_device *link); 91 91 static int axnet_open(struct net_device *dev); 92 92 static int axnet_close(struct net_device *dev); 93 93 static int axnet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); ··· 142 142 143 143 ======================================================================*/ 144 144 145 - static int axnet_attach(struct pcmcia_device *p_dev) 145 + static int axnet_attach(struct pcmcia_device *link) 146 146 { 147 147 axnet_dev_t *info; 148 148 struct net_device *dev; 149 - dev_link_t *link = dev_to_instance(p_dev); 150 149 151 150 DEBUG(0, "axnet_attach()\n"); 152 151 ··· 156 157 return -ENOMEM; 157 158 158 159 info = PRIV(dev); 159 - info->p_dev = p_dev; 160 + info->p_dev = link; 160 161 link->priv = dev; 161 162 link->irq.Attributes = IRQ_TYPE_EXCLUSIVE; 162 163 link->irq.IRQInfo1 = IRQ_LEVEL_ID; ··· 183 184 184 185 ======================================================================*/ 185 186 186 - static void axnet_detach(struct pcmcia_device *p_dev) 187 + static void axnet_detach(struct pcmcia_device *link) 187 188 { 188 - dev_link_t *link = dev_to_instance(p_dev); 189 189 struct net_device *dev = link->priv; 190 190 191 191 DEBUG(0, "axnet_detach(0x%p)\n", link); ··· 204 206 205 207 ======================================================================*/ 206 208 207 - static int get_prom(dev_link_t *link) 209 + static int get_prom(struct pcmcia_device *link) 208 210 { 209 211 struct net_device *dev = link->priv; 210 212 kio_addr_t ioaddr = dev->base_addr; ··· 258 260 #define CS_CHECK(fn, ret) \ 259 261 do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 260 262 261 - static int try_io_port(dev_link_t *link) 263 + static int try_io_port(struct pcmcia_device *link) 262 264 { 263 265 int j, ret; 264 266 if (link->io.NumPorts1 == 32) { ··· 279 281 for (j = 0; j < 0x400; j += 0x20) { 280 282 link->io.BasePort1 = j ^ 0x300; 281 283 link->io.BasePort2 = (j ^ 0x300) + 0x10; 282 - ret = pcmcia_request_io(link->handle, &link->io); 284 + ret = pcmcia_request_io(link, &link->io); 283 285 if (ret == CS_SUCCESS) return ret; 284 286 } 285 287 return ret; 286 288 } else { 287 - return pcmcia_request_io(link->handle, &link->io); 289 + return pcmcia_request_io(link, &link->io); 288 290 } 289 291 } 290 292 291 - static void axnet_config(dev_link_t *link) 293 + static void axnet_config(struct pcmcia_device *link) 292 294 { 293 - client_handle_t handle = link->handle; 294 295 struct net_device *dev = link->priv; 295 296 axnet_dev_t *info = PRIV(dev); 296 297 tuple_t tuple; ··· 304 307 tuple.TupleDataMax = sizeof(buf); 305 308 tuple.TupleOffset = 0; 306 309 tuple.DesiredTuple = CISTPL_CONFIG; 307 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 308 - CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 309 - CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse)); 310 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 311 + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 312 + CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); 310 313 link->conf.ConfigBase = parse.config.base; 311 314 /* don't trust the CIS on this; Linksys got it wrong */ 312 315 link->conf.Present = 0x63; ··· 316 319 317 320 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 318 321 tuple.Attributes = 0; 319 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 322 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 320 323 while (last_ret == CS_SUCCESS) { 321 324 cistpl_cftable_entry_t *cfg = &(parse.cftable_entry); 322 325 cistpl_io_t *io = &(parse.cftable_entry.io); 323 326 324 - if (pcmcia_get_tuple_data(handle, &tuple) != 0 || 325 - pcmcia_parse_tuple(handle, &tuple, &parse) != 0 || 327 + if (pcmcia_get_tuple_data(link, &tuple) != 0 || 328 + pcmcia_parse_tuple(link, &tuple, &parse) != 0 || 326 329 cfg->index == 0 || cfg->io.nwin == 0) 327 330 goto next_entry; 328 331 ··· 344 347 if (last_ret == CS_SUCCESS) break; 345 348 } 346 349 next_entry: 347 - last_ret = pcmcia_get_next_tuple(handle, &tuple); 350 + last_ret = pcmcia_get_next_tuple(link, &tuple); 348 351 } 349 352 if (last_ret != CS_SUCCESS) { 350 - cs_error(handle, RequestIO, last_ret); 353 + cs_error(link, RequestIO, last_ret); 351 354 goto failed; 352 355 } 353 356 354 - CS_CHECK(RequestIRQ, pcmcia_request_irq(handle, &link->irq)); 357 + CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 355 358 356 359 if (link->io.NumPorts2 == 8) { 357 360 link->conf.Attributes |= CONF_ENABLE_SPKR; 358 361 link->conf.Status = CCSR_AUDIO_ENA; 359 362 } 360 363 361 - CS_CHECK(RequestConfiguration, pcmcia_request_configuration(handle, &link->conf)); 364 + CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 362 365 dev->irq = link->irq.AssignedIRQ; 363 366 dev->base_addr = link->io.BasePort1; 364 367 ··· 395 398 Bit 2 of CCSR is active low. */ 396 399 if (i == 32) { 397 400 conf_reg_t reg = { 0, CS_WRITE, CISREG_CCSR, 0x04 }; 398 - pcmcia_access_configuration_register(link->handle, &reg); 401 + pcmcia_access_configuration_register(link, &reg); 399 402 for (i = 0; i < 32; i++) { 400 403 j = mdio_read(dev->base_addr + AXNET_MII_EEP, i, 1); 401 404 if ((j != 0) && (j != 0xffff)) break; ··· 405 408 info->phy_id = (i < 32) ? i : -1; 406 409 link->dev_node = &info->node; 407 410 link->state &= ~DEV_CONFIG_PENDING; 408 - SET_NETDEV_DEV(dev, &handle_to_dev(handle)); 411 + SET_NETDEV_DEV(dev, &handle_to_dev(link)); 409 412 410 413 if (register_netdev(dev) != 0) { 411 414 printk(KERN_NOTICE "axnet_cs: register_netdev() failed\n"); ··· 428 431 return; 429 432 430 433 cs_failed: 431 - cs_error(link->handle, last_fn, last_ret); 434 + cs_error(link, last_fn, last_ret); 432 435 failed: 433 436 axnet_release(link); 434 437 link->state &= ~DEV_CONFIG_PENDING; ··· 443 446 444 447 ======================================================================*/ 445 448 446 - static void axnet_release(dev_link_t *link) 449 + static void axnet_release(struct pcmcia_device *link) 447 450 { 448 - pcmcia_disable_device(link->handle); 451 + pcmcia_disable_device(link); 449 452 } 450 453 451 - static int axnet_suspend(struct pcmcia_device *p_dev) 454 + static int axnet_suspend(struct pcmcia_device *link) 452 455 { 453 - dev_link_t *link = dev_to_instance(p_dev); 454 456 struct net_device *dev = link->priv; 455 457 456 458 if ((link->state & DEV_CONFIG) && (link->open)) ··· 458 462 return 0; 459 463 } 460 464 461 - static int axnet_resume(struct pcmcia_device *p_dev) 465 + static int axnet_resume(struct pcmcia_device *link) 462 466 { 463 - dev_link_t *link = dev_to_instance(p_dev); 464 467 struct net_device *dev = link->priv; 465 468 466 469 if ((link->state & DEV_CONFIG) && (link->open)) { ··· 535 540 static int axnet_open(struct net_device *dev) 536 541 { 537 542 axnet_dev_t *info = PRIV(dev); 538 - dev_link_t *link = info->p_dev; 543 + struct pcmcia_device *link = info->p_dev; 539 544 540 545 DEBUG(2, "axnet_open('%s')\n", dev->name); 541 546 ··· 561 566 static int axnet_close(struct net_device *dev) 562 567 { 563 568 axnet_dev_t *info = PRIV(dev); 564 - dev_link_t *link = info->p_dev; 569 + struct pcmcia_device *link = info->p_dev; 565 570 566 571 DEBUG(2, "axnet_close('%s')\n", dev->name); 567 572
+17 -22
drivers/net/pcmcia/com20020_cs.c
··· 118 118 119 119 /*====================================================================*/ 120 120 121 - static void com20020_config(dev_link_t *link); 122 - static void com20020_release(dev_link_t *link); 121 + static void com20020_config(struct pcmcia_device *link); 122 + static void com20020_release(struct pcmcia_device *link); 123 123 124 124 static void com20020_detach(struct pcmcia_device *p_dev); 125 125 ··· 198 198 199 199 ======================================================================*/ 200 200 201 - static void com20020_detach(struct pcmcia_device *p_dev) 201 + static void com20020_detach(struct pcmcia_device *link) 202 202 { 203 - dev_link_t *link = dev_to_instance(p_dev); 204 203 struct com20020_dev_t *info = link->priv; 205 204 struct net_device *dev = info->dev; 206 205 ··· 250 251 #define CS_CHECK(fn, ret) \ 251 252 do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 252 253 253 - static void com20020_config(dev_link_t *link) 254 + static void com20020_config(struct pcmcia_device *link) 254 255 { 255 256 struct arcnet_local *lp; 256 - client_handle_t handle; 257 257 tuple_t tuple; 258 258 cisparse_t parse; 259 259 com20020_dev_t *info; ··· 261 263 u_char buf[64]; 262 264 int ioaddr; 263 265 264 - handle = link->handle; 265 266 info = link->priv; 266 267 dev = info->dev; 267 268 ··· 273 276 tuple.TupleDataMax = 64; 274 277 tuple.TupleOffset = 0; 275 278 tuple.DesiredTuple = CISTPL_CONFIG; 276 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 277 - CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 278 - CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse)); 279 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 280 + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 281 + CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); 279 282 link->conf.ConfigBase = parse.config.base; 280 283 281 284 /* Configure card */ ··· 288 291 for (ioaddr = 0x100; ioaddr < 0x400; ioaddr += 0x10) 289 292 { 290 293 link->io.BasePort1 = ioaddr; 291 - i = pcmcia_request_io(link->handle, &link->io); 294 + i = pcmcia_request_io(link, &link->io); 292 295 if (i == CS_SUCCESS) 293 296 break; 294 297 } 295 298 } 296 299 else 297 - i = pcmcia_request_io(link->handle, &link->io); 300 + i = pcmcia_request_io(link, &link->io); 298 301 299 302 if (i != CS_SUCCESS) 300 303 { ··· 308 311 DEBUG(1,"arcnet: request IRQ %d (%Xh/%Xh)\n", 309 312 link->irq.AssignedIRQ, 310 313 link->irq.IRQInfo1, link->irq.IRQInfo2); 311 - i = pcmcia_request_irq(link->handle, &link->irq); 314 + i = pcmcia_request_irq(link, &link->irq); 312 315 if (i != CS_SUCCESS) 313 316 { 314 317 DEBUG(1,"arcnet: requestIRQ failed totally!\n"); ··· 317 320 318 321 dev->irq = link->irq.AssignedIRQ; 319 322 320 - CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf)); 323 + CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 321 324 322 325 if (com20020_check(dev)) 323 326 { ··· 331 334 332 335 link->dev_node = &info->node; 333 336 link->state &= ~DEV_CONFIG_PENDING; 334 - SET_NETDEV_DEV(dev, &handle_to_dev(handle)); 337 + SET_NETDEV_DEV(dev, &handle_to_dev(link)); 335 338 336 339 i = com20020_found(dev, 0); /* calls register_netdev */ 337 340 ··· 348 351 return; 349 352 350 353 cs_failed: 351 - cs_error(link->handle, last_fn, last_ret); 354 + cs_error(link, last_fn, last_ret); 352 355 failed: 353 356 DEBUG(1,"com20020_config failed...\n"); 354 357 com20020_release(link); ··· 362 365 363 366 ======================================================================*/ 364 367 365 - static void com20020_release(dev_link_t *link) 368 + static void com20020_release(struct pcmcia_device *link) 366 369 { 367 370 DEBUG(0, "com20020_release(0x%p)\n", link); 368 - pcmcia_disable_device(link->handle); 371 + pcmcia_disable_device(link); 369 372 } 370 373 371 - static int com20020_suspend(struct pcmcia_device *p_dev) 374 + static int com20020_suspend(struct pcmcia_device *link) 372 375 { 373 - dev_link_t *link = dev_to_instance(p_dev); 374 376 com20020_dev_t *info = link->priv; 375 377 struct net_device *dev = info->dev; 376 378 ··· 379 383 return 0; 380 384 } 381 385 382 - static int com20020_resume(struct pcmcia_device *p_dev) 386 + static int com20020_resume(struct pcmcia_device *link) 383 387 { 384 - dev_link_t *link = dev_to_instance(p_dev); 385 388 com20020_dev_t *info = link->priv; 386 389 struct net_device *dev = info->dev; 387 390
+46 -51
drivers/net/pcmcia/fmvj18x_cs.c
··· 84 84 /* 85 85 PCMCIA event handlers 86 86 */ 87 - static void fmvj18x_config(dev_link_t *link); 88 - static int fmvj18x_get_hwinfo(dev_link_t *link, u_char *node_id); 89 - static int fmvj18x_setup_mfc(dev_link_t *link); 90 - static void fmvj18x_release(dev_link_t *link); 87 + static void fmvj18x_config(struct pcmcia_device *link); 88 + static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id); 89 + static int fmvj18x_setup_mfc(struct pcmcia_device *link); 90 + static void fmvj18x_release(struct pcmcia_device *link); 91 91 static void fmvj18x_detach(struct pcmcia_device *p_dev); 92 92 93 93 /* ··· 228 228 #define BANK_1U 0x24 /* bank 1 (CONFIG_1) */ 229 229 #define BANK_2U 0x28 /* bank 2 (CONFIG_1) */ 230 230 231 - static int fmvj18x_attach(struct pcmcia_device *p_dev) 231 + static int fmvj18x_attach(struct pcmcia_device *link) 232 232 { 233 233 local_info_t *lp; 234 234 struct net_device *dev; 235 - dev_link_t *link = dev_to_instance(p_dev); 236 235 237 236 DEBUG(0, "fmvj18x_attach()\n"); 238 237 ··· 241 242 return -ENOMEM; 242 243 lp = netdev_priv(dev); 243 244 link->priv = dev; 244 - lp->p_dev = p_dev; 245 + lp->p_dev = link; 245 246 246 247 /* The io structure describes IO port mapping */ 247 248 link->io.NumPorts1 = 32; ··· 280 281 281 282 /*====================================================================*/ 282 283 283 - static void fmvj18x_detach(struct pcmcia_device *p_dev) 284 + static void fmvj18x_detach(struct pcmcia_device *link) 284 285 { 285 - dev_link_t *link = dev_to_instance(p_dev); 286 286 struct net_device *dev = link->priv; 287 287 288 288 DEBUG(0, "fmvj18x_detach(0x%p)\n", link); ··· 300 302 #define CS_CHECK(fn, ret) \ 301 303 do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 302 304 303 - static int mfc_try_io_port(dev_link_t *link) 305 + static int mfc_try_io_port(struct pcmcia_device *link) 304 306 { 305 307 int i, ret; 306 308 static const kio_addr_t serial_base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; ··· 312 314 link->io.NumPorts2 = 0; 313 315 printk(KERN_NOTICE "fmvj18x_cs: out of resource for serial\n"); 314 316 } 315 - ret = pcmcia_request_io(link->handle, &link->io); 317 + ret = pcmcia_request_io(link, &link->io); 316 318 if (ret == CS_SUCCESS) return ret; 317 319 } 318 320 return ret; 319 321 } 320 322 321 - static int ungermann_try_io_port(dev_link_t *link) 323 + static int ungermann_try_io_port(struct pcmcia_device *link) 322 324 { 323 325 int ret; 324 326 kio_addr_t ioaddr; ··· 328 330 */ 329 331 for (ioaddr = 0x300; ioaddr < 0x3e0; ioaddr += 0x20) { 330 332 link->io.BasePort1 = ioaddr; 331 - ret = pcmcia_request_io(link->handle, &link->io); 333 + ret = pcmcia_request_io(link, &link->io); 332 334 if (ret == CS_SUCCESS) { 333 335 /* calculate ConfigIndex value */ 334 336 link->conf.ConfigIndex = ··· 339 341 return ret; /* RequestIO failed */ 340 342 } 341 343 342 - static void fmvj18x_config(dev_link_t *link) 344 + static void fmvj18x_config(struct pcmcia_device *link) 343 345 { 344 - client_handle_t handle = link->handle; 345 346 struct net_device *dev = link->priv; 346 347 local_info_t *lp = netdev_priv(dev); 347 348 tuple_t tuple; ··· 359 362 registers. 360 363 */ 361 364 tuple.DesiredTuple = CISTPL_CONFIG; 362 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 365 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 363 366 tuple.TupleData = (u_char *)buf; 364 367 tuple.TupleDataMax = 64; 365 368 tuple.TupleOffset = 0; 366 - CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 367 - CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse)); 369 + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 370 + CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); 368 371 369 372 /* Configure card */ 370 373 link->state |= DEV_CONFIG; ··· 374 377 375 378 tuple.DesiredTuple = CISTPL_FUNCE; 376 379 tuple.TupleOffset = 0; 377 - if (pcmcia_get_first_tuple(handle, &tuple) == CS_SUCCESS) { 380 + if (pcmcia_get_first_tuple(link, &tuple) == CS_SUCCESS) { 378 381 /* Yes, I have CISTPL_FUNCE. Let's check CISTPL_MANFID */ 379 382 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 380 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 381 - CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 382 - CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse)); 383 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 384 + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 385 + CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); 383 386 link->conf.ConfigIndex = parse.cftable_entry.index; 384 387 tuple.DesiredTuple = CISTPL_MANFID; 385 - if (pcmcia_get_first_tuple(handle, &tuple) == CS_SUCCESS) 386 - CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 388 + if (pcmcia_get_first_tuple(link, &tuple) == CS_SUCCESS) 389 + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 387 390 else 388 391 buf[0] = 0xffff; 389 392 switch (le16_to_cpu(buf[0])) { ··· 417 420 } else { 418 421 /* old type card */ 419 422 tuple.DesiredTuple = CISTPL_MANFID; 420 - if (pcmcia_get_first_tuple(handle, &tuple) == CS_SUCCESS) 421 - CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 423 + if (pcmcia_get_first_tuple(link, &tuple) == CS_SUCCESS) 424 + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 422 425 else 423 426 buf[0] = 0xffff; 424 427 switch (le16_to_cpu(buf[0])) { ··· 449 452 ret = ungermann_try_io_port(link); 450 453 if (ret != CS_SUCCESS) goto cs_failed; 451 454 } else { 452 - CS_CHECK(RequestIO, pcmcia_request_io(link->handle, &link->io)); 455 + CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io)); 453 456 } 454 - CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq)); 455 - CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf)); 457 + CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 458 + CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 456 459 dev->irq = link->irq.AssignedIRQ; 457 460 dev->base_addr = link->io.BasePort1; 458 461 ··· 481 484 case CONTEC: 482 485 tuple.DesiredTuple = CISTPL_FUNCE; 483 486 tuple.TupleOffset = 0; 484 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 487 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 485 488 tuple.TupleOffset = 0; 486 - CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 489 + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 487 490 if (cardtype == MBH10304) { 488 491 /* MBH10304's CIS_FUNCE is corrupted */ 489 492 node_id = &(tuple.TupleData[5]); 490 493 card_name = "FMV-J182"; 491 494 } else { 492 495 while (tuple.TupleData[0] != CISTPL_FUNCE_LAN_NODE_ID ) { 493 - CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(handle, &tuple)); 494 - CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 496 + CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(link, &tuple)); 497 + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 495 498 } 496 499 node_id = &(tuple.TupleData[2]); 497 500 if( cardtype == TDK ) { ··· 535 538 lp->cardtype = cardtype; 536 539 link->dev_node = &lp->node; 537 540 link->state &= ~DEV_CONFIG_PENDING; 538 - SET_NETDEV_DEV(dev, &handle_to_dev(handle)); 541 + SET_NETDEV_DEV(dev, &handle_to_dev(link)); 539 542 540 543 if (register_netdev(dev) != 0) { 541 544 printk(KERN_NOTICE "fmvj18x_cs: register_netdev() failed\n"); ··· 556 559 557 560 cs_failed: 558 561 /* All Card Services errors end up here */ 559 - cs_error(link->handle, last_fn, last_ret); 562 + cs_error(link, last_fn, last_ret); 560 563 failed: 561 564 fmvj18x_release(link); 562 565 link->state &= ~DEV_CONFIG_PENDING; ··· 564 567 } /* fmvj18x_config */ 565 568 /*====================================================================*/ 566 569 567 - static int fmvj18x_get_hwinfo(dev_link_t *link, u_char *node_id) 570 + static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id) 568 571 { 569 572 win_req_t req; 570 573 memreq_t mem; ··· 575 578 req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; 576 579 req.Base = 0; req.Size = 0; 577 580 req.AccessSpeed = 0; 578 - i = pcmcia_request_window(&link->handle, &req, &link->win); 581 + i = pcmcia_request_window(&link, &req, &link->win); 579 582 if (i != CS_SUCCESS) { 580 - cs_error(link->handle, RequestWindow, i); 583 + cs_error(link, RequestWindow, i); 581 584 return -1; 582 585 } 583 586 ··· 611 614 iounmap(base); 612 615 j = pcmcia_release_window(link->win); 613 616 if (j != CS_SUCCESS) 614 - cs_error(link->handle, ReleaseWindow, j); 617 + cs_error(link, ReleaseWindow, j); 615 618 return (i != 0x200) ? 0 : -1; 616 619 617 620 } /* fmvj18x_get_hwinfo */ 618 621 /*====================================================================*/ 619 622 620 - static int fmvj18x_setup_mfc(dev_link_t *link) 623 + static int fmvj18x_setup_mfc(struct pcmcia_device *link) 621 624 { 622 625 win_req_t req; 623 626 memreq_t mem; ··· 630 633 req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; 631 634 req.Base = 0; req.Size = 0; 632 635 req.AccessSpeed = 0; 633 - i = pcmcia_request_window(&link->handle, &req, &link->win); 636 + i = pcmcia_request_window(&link, &req, &link->win); 634 637 if (i != CS_SUCCESS) { 635 - cs_error(link->handle, RequestWindow, i); 638 + cs_error(link, RequestWindow, i); 636 639 return -1; 637 640 } 638 641 ··· 654 657 iounmap(base); 655 658 j = pcmcia_release_window(link->win); 656 659 if (j != CS_SUCCESS) 657 - cs_error(link->handle, ReleaseWindow, j); 660 + cs_error(link, ReleaseWindow, j); 658 661 return 0; 659 662 660 663 } 661 664 /*====================================================================*/ 662 665 663 - static void fmvj18x_release(dev_link_t *link) 666 + static void fmvj18x_release(struct pcmcia_device *link) 664 667 { 665 668 DEBUG(0, "fmvj18x_release(0x%p)\n", link); 666 - pcmcia_disable_device(link->handle); 669 + pcmcia_disable_device(link); 667 670 } 668 671 669 - static int fmvj18x_suspend(struct pcmcia_device *p_dev) 672 + static int fmvj18x_suspend(struct pcmcia_device *link) 670 673 { 671 - dev_link_t *link = dev_to_instance(p_dev); 672 674 struct net_device *dev = link->priv; 673 675 674 676 if ((link->state & DEV_CONFIG) && (link->open)) ··· 676 680 return 0; 677 681 } 678 682 679 - static int fmvj18x_resume(struct pcmcia_device *p_dev) 683 + static int fmvj18x_resume(struct pcmcia_device *link) 680 684 { 681 - dev_link_t *link = dev_to_instance(p_dev); 682 685 struct net_device *dev = link->priv; 683 686 684 687 if ((link->state & DEV_CONFIG) && (link->open)) { ··· 1117 1122 static int fjn_open(struct net_device *dev) 1118 1123 { 1119 1124 struct local_info_t *lp = netdev_priv(dev); 1120 - dev_link_t *link = lp->p_dev; 1125 + struct pcmcia_device *link = lp->p_dev; 1121 1126 1122 1127 DEBUG(4, "fjn_open('%s').\n", dev->name); 1123 1128 ··· 1142 1147 static int fjn_close(struct net_device *dev) 1143 1148 { 1144 1149 struct local_info_t *lp = netdev_priv(dev); 1145 - dev_link_t *link = lp->p_dev; 1150 + struct pcmcia_device *link = lp->p_dev; 1146 1151 kio_addr_t ioaddr = dev->base_addr; 1147 1152 1148 1153 DEBUG(4, "fjn_close('%s').\n", dev->name);
+22 -27
drivers/net/pcmcia/ibmtr_cs.c
··· 105 105 106 106 /*====================================================================*/ 107 107 108 - static void ibmtr_config(dev_link_t *link); 108 + static void ibmtr_config(struct pcmcia_device *link); 109 109 static void ibmtr_hw_setup(struct net_device *dev, u_int mmiobase); 110 - static void ibmtr_release(dev_link_t *link); 110 + static void ibmtr_release(struct pcmcia_device *link); 111 111 static void ibmtr_detach(struct pcmcia_device *p_dev); 112 112 113 113 /*====================================================================*/ ··· 138 138 139 139 ======================================================================*/ 140 140 141 - static int ibmtr_attach(struct pcmcia_device *p_dev) 141 + static int ibmtr_attach(struct pcmcia_device *link) 142 142 { 143 143 ibmtr_dev_t *info; 144 144 struct net_device *dev; 145 - dev_link_t *link = dev_to_instance(p_dev); 146 - 145 + 147 146 DEBUG(0, "ibmtr_attach()\n"); 148 147 149 148 /* Create new token-ring device */ ··· 155 156 return -ENOMEM; 156 157 } 157 158 158 - info->p_dev = p_dev; 159 + info->p_dev = link; 159 160 link->priv = info; 160 161 info->ti = netdev_priv(dev); 161 162 ··· 188 189 189 190 ======================================================================*/ 190 191 191 - static void ibmtr_detach(struct pcmcia_device *p_dev) 192 + static void ibmtr_detach(struct pcmcia_device *link) 192 193 { 193 - dev_link_t *link = dev_to_instance(p_dev); 194 194 struct ibmtr_dev_t *info = link->priv; 195 195 struct net_device *dev = info->dev; 196 196 ··· 220 222 #define CS_CHECK(fn, ret) \ 221 223 do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 222 224 223 - static void ibmtr_config(dev_link_t *link) 225 + static void ibmtr_config(struct pcmcia_device *link) 224 226 { 225 - client_handle_t handle = link->handle; 226 227 ibmtr_dev_t *info = link->priv; 227 228 struct net_device *dev = info->dev; 228 229 struct tok_info *ti = netdev_priv(dev); ··· 239 242 tuple.TupleDataMax = 64; 240 243 tuple.TupleOffset = 0; 241 244 tuple.DesiredTuple = CISTPL_CONFIG; 242 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 243 - CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 244 - CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse)); 245 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 246 + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 247 + CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); 245 248 link->conf.ConfigBase = parse.config.base; 246 249 247 250 /* Configure card */ ··· 253 256 254 257 /* Try PRIMARY card at 0xA20-0xA23 */ 255 258 link->io.BasePort1 = 0xA20; 256 - i = pcmcia_request_io(link->handle, &link->io); 259 + i = pcmcia_request_io(link, &link->io); 257 260 if (i != CS_SUCCESS) { 258 261 /* Couldn't get 0xA20-0xA23. Try ALTERNATE at 0xA24-0xA27. */ 259 262 link->io.BasePort1 = 0xA24; 260 - CS_CHECK(RequestIO, pcmcia_request_io(link->handle, &link->io)); 263 + CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io)); 261 264 } 262 265 dev->base_addr = link->io.BasePort1; 263 266 264 - CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq)); 267 + CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 265 268 dev->irq = link->irq.AssignedIRQ; 266 269 ti->irq = link->irq.AssignedIRQ; 267 270 ti->global_int_enable=GLOBAL_INT_ENABLE+((dev->irq==9) ? 2 : dev->irq); ··· 272 275 req.Base = 0; 273 276 req.Size = 0x2000; 274 277 req.AccessSpeed = 250; 275 - CS_CHECK(RequestWindow, pcmcia_request_window(&link->handle, &req, &link->win)); 278 + CS_CHECK(RequestWindow, pcmcia_request_window(&link, &req, &link->win)); 276 279 277 280 mem.CardOffset = mmiobase; 278 281 mem.Page = 0; ··· 285 288 req.Base = 0; 286 289 req.Size = sramsize * 1024; 287 290 req.AccessSpeed = 250; 288 - CS_CHECK(RequestWindow, pcmcia_request_window(&link->handle, &req, &info->sram_win_handle)); 291 + CS_CHECK(RequestWindow, pcmcia_request_window(&link, &req, &info->sram_win_handle)); 289 292 290 293 mem.CardOffset = srambase; 291 294 mem.Page = 0; ··· 295 298 ti->sram_virt = ioremap(req.Base, req.Size); 296 299 ti->sram_phys = req.Base; 297 300 298 - CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf)); 301 + CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 299 302 300 303 /* Set up the Token-Ring Controller Configuration Register and 301 304 turn on the card. Check the "Local Area Network Credit Card ··· 304 307 305 308 link->dev_node = &info->node; 306 309 link->state &= ~DEV_CONFIG_PENDING; 307 - SET_NETDEV_DEV(dev, &handle_to_dev(handle)); 310 + SET_NETDEV_DEV(dev, &handle_to_dev(link)); 308 311 309 312 i = ibmtr_probe_card(dev); 310 313 if (i != 0) { ··· 326 329 return; 327 330 328 331 cs_failed: 329 - cs_error(link->handle, last_fn, last_ret); 332 + cs_error(link, last_fn, last_ret); 330 333 failed: 331 334 ibmtr_release(link); 332 335 } /* ibmtr_config */ ··· 339 342 340 343 ======================================================================*/ 341 344 342 - static void ibmtr_release(dev_link_t *link) 345 + static void ibmtr_release(struct pcmcia_device *link) 343 346 { 344 347 ibmtr_dev_t *info = link->priv; 345 348 struct net_device *dev = info->dev; ··· 351 354 iounmap(ti->mmio); 352 355 pcmcia_release_window(info->sram_win_handle); 353 356 } 354 - pcmcia_disable_device(link->handle); 357 + pcmcia_disable_device(link); 355 358 } 356 359 357 - static int ibmtr_suspend(struct pcmcia_device *p_dev) 360 + static int ibmtr_suspend(struct pcmcia_device *link) 358 361 { 359 - dev_link_t *link = dev_to_instance(p_dev); 360 362 ibmtr_dev_t *info = link->priv; 361 363 struct net_device *dev = info->dev; 362 364 ··· 365 369 return 0; 366 370 } 367 371 368 - static int ibmtr_resume(struct pcmcia_device *p_dev) 372 + static int ibmtr_resume(struct pcmcia_device *link) 369 373 { 370 - dev_link_t *link = dev_to_instance(p_dev); 371 374 ibmtr_dev_t *info = link->priv; 372 375 struct net_device *dev = info->dev; 373 376
+28 -33
drivers/net/pcmcia/nmclan_cs.c
··· 417 417 Function Prototypes 418 418 ---------------------------------------------------------------------------- */ 419 419 420 - static void nmclan_config(dev_link_t *link); 421 - static void nmclan_release(dev_link_t *link); 420 + static void nmclan_config(struct pcmcia_device *link); 421 + static void nmclan_release(struct pcmcia_device *link); 422 422 423 423 static void nmclan_reset(struct net_device *dev); 424 424 static int mace_config(struct net_device *dev, struct ifmap *map); ··· 443 443 Services. 444 444 ---------------------------------------------------------------------------- */ 445 445 446 - static int nmclan_attach(struct pcmcia_device *p_dev) 446 + static int nmclan_attach(struct pcmcia_device *link) 447 447 { 448 448 mace_private *lp; 449 449 struct net_device *dev; 450 - dev_link_t *link = dev_to_instance(p_dev); 451 450 452 451 DEBUG(0, "nmclan_attach()\n"); 453 452 DEBUG(1, "%s\n", rcsid); ··· 456 457 if (!dev) 457 458 return -ENOMEM; 458 459 lp = netdev_priv(dev); 459 - lp->p_dev = p_dev; 460 + lp->p_dev = link; 460 461 link->priv = dev; 461 462 462 463 spin_lock_init(&lp->bank_lock); ··· 501 502 when the device is released. 502 503 ---------------------------------------------------------------------------- */ 503 504 504 - static void nmclan_detach(struct pcmcia_device *p_dev) 505 + static void nmclan_detach(struct pcmcia_device *link) 505 506 { 506 - dev_link_t *link = dev_to_instance(p_dev); 507 507 struct net_device *dev = link->priv; 508 508 509 509 DEBUG(0, "nmclan_detach(0x%p)\n", link); ··· 655 657 #define CS_CHECK(fn, ret) \ 656 658 do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 657 659 658 - static void nmclan_config(dev_link_t *link) 660 + static void nmclan_config(struct pcmcia_device *link) 659 661 { 660 - client_handle_t handle = link->handle; 661 662 struct net_device *dev = link->priv; 662 663 mace_private *lp = netdev_priv(dev); 663 664 tuple_t tuple; ··· 672 675 tuple.TupleDataMax = 64; 673 676 tuple.TupleOffset = 0; 674 677 tuple.DesiredTuple = CISTPL_CONFIG; 675 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 676 - CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 677 - CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse)); 678 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 679 + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 680 + CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); 678 681 link->conf.ConfigBase = parse.config.base; 679 682 680 683 /* Configure card */ 681 684 link->state |= DEV_CONFIG; 682 685 683 - CS_CHECK(RequestIO, pcmcia_request_io(handle, &link->io)); 684 - CS_CHECK(RequestIRQ, pcmcia_request_irq(handle, &link->irq)); 685 - CS_CHECK(RequestConfiguration, pcmcia_request_configuration(handle, &link->conf)); 686 + CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io)); 687 + CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 688 + CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 686 689 dev->irq = link->irq.AssignedIRQ; 687 690 dev->base_addr = link->io.BasePort1; 688 691 ··· 693 696 tuple.TupleData = buf; 694 697 tuple.TupleDataMax = 64; 695 698 tuple.TupleOffset = 0; 696 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 697 - CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 699 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 700 + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 698 701 memcpy(dev->dev_addr, tuple.TupleData, ETHER_ADDR_LEN); 699 702 700 703 /* Verify configuration by reading the MACE ID. */ ··· 725 728 726 729 link->dev_node = &lp->node; 727 730 link->state &= ~DEV_CONFIG_PENDING; 728 - SET_NETDEV_DEV(dev, &handle_to_dev(handle)); 731 + SET_NETDEV_DEV(dev, &handle_to_dev(link)); 729 732 730 733 i = register_netdev(dev); 731 734 if (i != 0) { ··· 743 746 return; 744 747 745 748 cs_failed: 746 - cs_error(link->handle, last_fn, last_ret); 749 + cs_error(link, last_fn, last_ret); 747 750 failed: 748 751 nmclan_release(link); 749 752 return; ··· 756 759 net device, and release the PCMCIA configuration. If the device 757 760 is still open, this will be postponed until it is closed. 758 761 ---------------------------------------------------------------------------- */ 759 - static void nmclan_release(dev_link_t *link) 762 + static void nmclan_release(struct pcmcia_device *link) 760 763 { 761 764 DEBUG(0, "nmclan_release(0x%p)\n", link); 762 - pcmcia_disable_device(link->handle); 765 + pcmcia_disable_device(link); 763 766 } 764 767 765 - static int nmclan_suspend(struct pcmcia_device *p_dev) 768 + static int nmclan_suspend(struct pcmcia_device *link) 766 769 { 767 - dev_link_t *link = dev_to_instance(p_dev); 768 770 struct net_device *dev = link->priv; 769 771 770 772 if ((link->state & DEV_CONFIG) && (link->open)) ··· 772 776 return 0; 773 777 } 774 778 775 - static int nmclan_resume(struct pcmcia_device *p_dev) 779 + static int nmclan_resume(struct pcmcia_device *link) 776 780 { 777 - dev_link_t *link = dev_to_instance(p_dev); 778 781 struct net_device *dev = link->priv; 779 782 780 783 if ((link->state & DEV_CONFIG) && (link->open)) { ··· 794 799 mace_private *lp = netdev_priv(dev); 795 800 796 801 #if RESET_XILINX 797 - dev_link_t *link = &lp->link; 802 + struct pcmcia_device *link = &lp->link; 798 803 conf_reg_t reg; 799 804 u_long OrigCorValue; 800 805 ··· 803 808 reg.Action = CS_READ; 804 809 reg.Offset = CISREG_COR; 805 810 reg.Value = 0; 806 - pcmcia_access_configuration_register(link->handle, &reg); 811 + pcmcia_access_configuration_register(link, &reg); 807 812 OrigCorValue = reg.Value; 808 813 809 814 /* Reset Xilinx */ ··· 812 817 DEBUG(1, "nmclan_reset: OrigCorValue=0x%lX, resetting...\n", 813 818 OrigCorValue); 814 819 reg.Value = COR_SOFT_RESET; 815 - pcmcia_access_configuration_register(link->handle, &reg); 820 + pcmcia_access_configuration_register(link, &reg); 816 821 /* Need to wait for 20 ms for PCMCIA to finish reset. */ 817 822 818 823 /* Restore original COR configuration index */ 819 824 reg.Value = COR_LEVEL_REQ | (OrigCorValue & COR_CONFIG_MASK); 820 - pcmcia_access_configuration_register(link->handle, &reg); 825 + pcmcia_access_configuration_register(link, &reg); 821 826 /* Xilinx is now completely reset along with the MACE chip. */ 822 827 lp->tx_free_frames=AM2150_MAX_TX_FRAMES; 823 828 ··· 861 866 { 862 867 kio_addr_t ioaddr = dev->base_addr; 863 868 mace_private *lp = netdev_priv(dev); 864 - dev_link_t *link = lp->p_dev; 869 + struct pcmcia_device *link = lp->p_dev; 865 870 866 871 if (!DEV_OK(link)) 867 872 return -ENODEV; ··· 884 889 { 885 890 kio_addr_t ioaddr = dev->base_addr; 886 891 mace_private *lp = netdev_priv(dev); 887 - dev_link_t *link = lp->p_dev; 892 + struct pcmcia_device *link = lp->p_dev; 888 893 889 894 DEBUG(2, "%s: shutting down ethercard.\n", dev->name); 890 895 ··· 939 944 static void mace_tx_timeout(struct net_device *dev) 940 945 { 941 946 mace_private *lp = netdev_priv(dev); 942 - dev_link_t *link = lp->p_dev; 947 + struct pcmcia_device *link = lp->p_dev; 943 948 944 949 printk(KERN_NOTICE "%s: transmit timed out -- ", dev->name); 945 950 #if RESET_ON_TIMEOUT 946 951 printk("resetting card\n"); 947 - pcmcia_reset_card(link->handle, NULL); 952 + pcmcia_reset_card(link, NULL); 948 953 #else /* #if RESET_ON_TIMEOUT */ 949 954 printk("NOT resetting card\n"); 950 955 #endif /* #if RESET_ON_TIMEOUT */
+43 -48
drivers/net/pcmcia/pcnet_cs.c
··· 103 103 /*====================================================================*/ 104 104 105 105 static void mii_phy_probe(struct net_device *dev); 106 - static void pcnet_config(dev_link_t *link); 107 - static void pcnet_release(dev_link_t *link); 106 + static void pcnet_config(struct pcmcia_device *link); 107 + static void pcnet_release(struct pcmcia_device *link); 108 108 static int pcnet_open(struct net_device *dev); 109 109 static int pcnet_close(struct net_device *dev); 110 110 static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); ··· 113 113 static void ei_watchdog(u_long arg); 114 114 static void pcnet_reset_8390(struct net_device *dev); 115 115 static int set_config(struct net_device *dev, struct ifmap *map); 116 - static int setup_shmem_window(dev_link_t *link, int start_pg, 116 + static int setup_shmem_window(struct pcmcia_device *link, int start_pg, 117 117 int stop_pg, int cm_offset); 118 - static int setup_dma_config(dev_link_t *link, int start_pg, 118 + static int setup_dma_config(struct pcmcia_device *link, int start_pg, 119 119 int stop_pg); 120 120 121 121 static void pcnet_detach(struct pcmcia_device *p_dev); ··· 240 240 241 241 ======================================================================*/ 242 242 243 - static int pcnet_probe(struct pcmcia_device *p_dev) 243 + static int pcnet_probe(struct pcmcia_device *link) 244 244 { 245 245 pcnet_dev_t *info; 246 246 struct net_device *dev; 247 - dev_link_t *link = dev_to_instance(p_dev); 248 247 249 248 DEBUG(0, "pcnet_attach()\n"); 250 249 ··· 251 252 dev = __alloc_ei_netdev(sizeof(pcnet_dev_t)); 252 253 if (!dev) return -ENOMEM; 253 254 info = PRIV(dev); 254 - info->p_dev = p_dev; 255 + info->p_dev = link; 255 256 link->priv = dev; 256 257 257 258 link->irq.Attributes = IRQ_TYPE_EXCLUSIVE; ··· 279 280 280 281 ======================================================================*/ 281 282 282 - static void pcnet_detach(struct pcmcia_device *p_dev) 283 + static void pcnet_detach(struct pcmcia_device *link) 283 284 { 284 - dev_link_t *link = dev_to_instance(p_dev); 285 285 struct net_device *dev = link->priv; 286 286 287 287 DEBUG(0, "pcnet_detach(0x%p)\n", link); ··· 301 303 302 304 ======================================================================*/ 303 305 304 - static hw_info_t *get_hwinfo(dev_link_t *link) 306 + static hw_info_t *get_hwinfo(struct pcmcia_device *link) 305 307 { 306 308 struct net_device *dev = link->priv; 307 309 win_req_t req; ··· 313 315 req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; 314 316 req.Base = 0; req.Size = 0; 315 317 req.AccessSpeed = 0; 316 - i = pcmcia_request_window(&link->handle, &req, &link->win); 318 + i = pcmcia_request_window(&link, &req, &link->win); 317 319 if (i != CS_SUCCESS) { 318 - cs_error(link->handle, RequestWindow, i); 320 + cs_error(link, RequestWindow, i); 319 321 return NULL; 320 322 } 321 323 ··· 338 340 iounmap(virt); 339 341 j = pcmcia_release_window(link->win); 340 342 if (j != CS_SUCCESS) 341 - cs_error(link->handle, ReleaseWindow, j); 343 + cs_error(link, ReleaseWindow, j); 342 344 return (i < NR_INFO) ? hw_info+i : NULL; 343 345 } /* get_hwinfo */ 344 346 ··· 350 352 351 353 ======================================================================*/ 352 354 353 - static hw_info_t *get_prom(dev_link_t *link) 355 + static hw_info_t *get_prom(struct pcmcia_device *link) 354 356 { 355 357 struct net_device *dev = link->priv; 356 358 kio_addr_t ioaddr = dev->base_addr; ··· 404 406 405 407 ======================================================================*/ 406 408 407 - static hw_info_t *get_dl10019(dev_link_t *link) 409 + static hw_info_t *get_dl10019(struct pcmcia_device *link) 408 410 { 409 411 struct net_device *dev = link->priv; 410 412 int i; ··· 426 428 427 429 ======================================================================*/ 428 430 429 - static hw_info_t *get_ax88190(dev_link_t *link) 431 + static hw_info_t *get_ax88190(struct pcmcia_device *link) 430 432 { 431 433 struct net_device *dev = link->priv; 432 434 kio_addr_t ioaddr = dev->base_addr; ··· 459 461 460 462 ======================================================================*/ 461 463 462 - static hw_info_t *get_hwired(dev_link_t *link) 464 + static hw_info_t *get_hwired(struct pcmcia_device *link) 463 465 { 464 466 struct net_device *dev = link->priv; 465 467 int i; ··· 486 488 #define CS_CHECK(fn, ret) \ 487 489 do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 488 490 489 - static int try_io_port(dev_link_t *link) 491 + static int try_io_port(struct pcmcia_device *link) 490 492 { 491 493 int j, ret; 492 494 if (link->io.NumPorts1 == 32) { ··· 507 509 for (j = 0; j < 0x400; j += 0x20) { 508 510 link->io.BasePort1 = j ^ 0x300; 509 511 link->io.BasePort2 = (j ^ 0x300) + 0x10; 510 - ret = pcmcia_request_io(link->handle, &link->io); 512 + ret = pcmcia_request_io(link, &link->io); 511 513 if (ret == CS_SUCCESS) return ret; 512 514 } 513 515 return ret; 514 516 } else { 515 - return pcmcia_request_io(link->handle, &link->io); 517 + return pcmcia_request_io(link, &link->io); 516 518 } 517 519 } 518 520 519 - static void pcnet_config(dev_link_t *link) 521 + static void pcnet_config(struct pcmcia_device *link) 520 522 { 521 - client_handle_t handle = link->handle; 522 523 struct net_device *dev = link->priv; 523 524 pcnet_dev_t *info = PRIV(dev); 524 525 tuple_t tuple; ··· 534 537 tuple.TupleDataMax = sizeof(buf); 535 538 tuple.TupleOffset = 0; 536 539 tuple.DesiredTuple = CISTPL_CONFIG; 537 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 538 - CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 539 - CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse)); 540 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 541 + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 542 + CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); 540 543 link->conf.ConfigBase = parse.config.base; 541 544 link->conf.Present = parse.config.rmask[0]; 542 545 ··· 545 548 546 549 tuple.DesiredTuple = CISTPL_MANFID; 547 550 tuple.Attributes = TUPLE_RETURN_COMMON; 548 - if ((pcmcia_get_first_tuple(handle, &tuple) == CS_SUCCESS) && 549 - (pcmcia_get_tuple_data(handle, &tuple) == CS_SUCCESS)) { 551 + if ((pcmcia_get_first_tuple(link, &tuple) == CS_SUCCESS) && 552 + (pcmcia_get_tuple_data(link, &tuple) == CS_SUCCESS)) { 550 553 manfid = le16_to_cpu(buf[0]); 551 554 prodid = le16_to_cpu(buf[1]); 552 555 } 553 556 554 557 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 555 558 tuple.Attributes = 0; 556 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 559 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 557 560 while (last_ret == CS_SUCCESS) { 558 561 cistpl_cftable_entry_t *cfg = &(parse.cftable_entry); 559 562 cistpl_io_t *io = &(parse.cftable_entry.io); 560 563 561 - if (pcmcia_get_tuple_data(handle, &tuple) != 0 || 562 - pcmcia_parse_tuple(handle, &tuple, &parse) != 0 || 564 + if (pcmcia_get_tuple_data(link, &tuple) != 0 || 565 + pcmcia_parse_tuple(link, &tuple, &parse) != 0 || 563 566 cfg->index == 0 || cfg->io.nwin == 0) 564 567 goto next_entry; 565 568 ··· 583 586 if (last_ret == CS_SUCCESS) break; 584 587 } 585 588 next_entry: 586 - last_ret = pcmcia_get_next_tuple(handle, &tuple); 589 + last_ret = pcmcia_get_next_tuple(link, &tuple); 587 590 } 588 591 if (last_ret != CS_SUCCESS) { 589 - cs_error(handle, RequestIO, last_ret); 592 + cs_error(link, RequestIO, last_ret); 590 593 goto failed; 591 594 } 592 595 593 - CS_CHECK(RequestIRQ, pcmcia_request_irq(handle, &link->irq)); 596 + CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 594 597 595 598 if (link->io.NumPorts2 == 8) { 596 599 link->conf.Attributes |= CONF_ENABLE_SPKR; ··· 600 603 (prodid == PRODID_IBM_HOME_AND_AWAY)) 601 604 link->conf.ConfigIndex |= 0x10; 602 605 603 - CS_CHECK(RequestConfiguration, pcmcia_request_configuration(handle, &link->conf)); 606 + CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 604 607 dev->irq = link->irq.AssignedIRQ; 605 608 dev->base_addr = link->io.BasePort1; 606 609 if (info->flags & HAS_MISC_REG) { ··· 670 673 671 674 link->dev_node = &info->node; 672 675 link->state &= ~DEV_CONFIG_PENDING; 673 - SET_NETDEV_DEV(dev, &handle_to_dev(handle)); 676 + SET_NETDEV_DEV(dev, &handle_to_dev(link)); 674 677 675 678 #ifdef CONFIG_NET_POLL_CONTROLLER 676 679 dev->poll_controller = ei_poll; ··· 704 707 return; 705 708 706 709 cs_failed: 707 - cs_error(link->handle, last_fn, last_ret); 710 + cs_error(link, last_fn, last_ret); 708 711 failed: 709 712 pcnet_release(link); 710 713 link->state &= ~DEV_CONFIG_PENDING; ··· 719 722 720 723 ======================================================================*/ 721 724 722 - static void pcnet_release(dev_link_t *link) 725 + static void pcnet_release(struct pcmcia_device *link) 723 726 { 724 727 pcnet_dev_t *info = PRIV(link->priv); 725 728 ··· 728 731 if (info->flags & USE_SHMEM) 729 732 iounmap(info->base); 730 733 731 - pcmcia_disable_device(link->handle); 734 + pcmcia_disable_device(link); 732 735 } 733 736 734 737 /*====================================================================== ··· 740 743 741 744 ======================================================================*/ 742 745 743 - static int pcnet_suspend(struct pcmcia_device *p_dev) 746 + static int pcnet_suspend(struct pcmcia_device *link) 744 747 { 745 - dev_link_t *link = dev_to_instance(p_dev); 746 748 struct net_device *dev = link->priv; 747 749 748 750 if ((link->state & DEV_CONFIG) && (link->open)) ··· 750 754 return 0; 751 755 } 752 756 753 - static int pcnet_resume(struct pcmcia_device *p_dev) 757 + static int pcnet_resume(struct pcmcia_device *link) 754 758 { 755 - dev_link_t *link = dev_to_instance(p_dev); 756 759 struct net_device *dev = link->priv; 757 760 758 761 if ((link->state & DEV_CONFIG) && (link->open)) { ··· 997 1002 static int pcnet_open(struct net_device *dev) 998 1003 { 999 1004 pcnet_dev_t *info = PRIV(dev); 1000 - dev_link_t *link = info->p_dev; 1005 + struct pcmcia_device *link = info->p_dev; 1001 1006 1002 1007 DEBUG(2, "pcnet_open('%s')\n", dev->name); 1003 1008 ··· 1025 1030 static int pcnet_close(struct net_device *dev) 1026 1031 { 1027 1032 pcnet_dev_t *info = PRIV(dev); 1028 - dev_link_t *link = info->p_dev; 1033 + struct pcmcia_device *link = info->p_dev; 1029 1034 1030 1035 DEBUG(2, "pcnet_close('%s')\n", dev->name); 1031 1036 ··· 1403 1408 1404 1409 /*====================================================================*/ 1405 1410 1406 - static int setup_dma_config(dev_link_t *link, int start_pg, 1411 + static int setup_dma_config(struct pcmcia_device *link, int start_pg, 1407 1412 int stop_pg) 1408 1413 { 1409 1414 struct net_device *dev = link->priv; ··· 1506 1511 1507 1512 /*====================================================================*/ 1508 1513 1509 - static int setup_shmem_window(dev_link_t *link, int start_pg, 1514 + static int setup_shmem_window(struct pcmcia_device *link, int start_pg, 1510 1515 int stop_pg, int cm_offset) 1511 1516 { 1512 1517 struct net_device *dev = link->priv; ··· 1528 1533 req.Attributes |= WIN_USE_WAIT; 1529 1534 req.Base = 0; req.Size = window_size; 1530 1535 req.AccessSpeed = mem_speed; 1531 - CS_CHECK(RequestWindow, pcmcia_request_window(&link->handle, &req, &link->win)); 1536 + CS_CHECK(RequestWindow, pcmcia_request_window(&link, &req, &link->win)); 1532 1537 1533 1538 mem.CardOffset = (start_pg << 8) + cm_offset; 1534 1539 offset = mem.CardOffset % window_size; ··· 1569 1574 return 0; 1570 1575 1571 1576 cs_failed: 1572 - cs_error(link->handle, last_fn, last_ret); 1577 + cs_error(link, last_fn, last_ret); 1573 1578 failed: 1574 1579 return 1; 1575 1580 }
+53 -61
drivers/net/pcmcia/smc91c92_cs.c
··· 279 279 /*====================================================================*/ 280 280 281 281 static void smc91c92_detach(struct pcmcia_device *p_dev); 282 - static void smc91c92_config(dev_link_t *link); 283 - static void smc91c92_release(dev_link_t *link); 282 + static void smc91c92_config(struct pcmcia_device *link); 283 + static void smc91c92_release(struct pcmcia_device *link); 284 284 285 285 static int smc_open(struct net_device *dev); 286 286 static int smc_close(struct net_device *dev); ··· 309 309 310 310 ======================================================================*/ 311 311 312 - static int smc91c92_attach(struct pcmcia_device *p_dev) 312 + static int smc91c92_attach(struct pcmcia_device *link) 313 313 { 314 314 struct smc_private *smc; 315 315 struct net_device *dev; 316 - dev_link_t *link = dev_to_instance(p_dev); 317 316 318 317 DEBUG(0, "smc91c92_attach()\n"); 319 318 ··· 321 322 if (!dev) 322 323 return -ENOMEM; 323 324 smc = netdev_priv(dev); 324 - smc->p_dev = p_dev; 325 + smc->p_dev = link; 325 326 link->priv = dev; 326 327 327 328 spin_lock_init(&smc->lock); ··· 371 372 372 373 ======================================================================*/ 373 374 374 - static void smc91c92_detach(struct pcmcia_device *p_dev) 375 + static void smc91c92_detach(struct pcmcia_device *link) 375 376 { 376 - dev_link_t *link = dev_to_instance(p_dev); 377 377 struct net_device *dev = link->priv; 378 378 379 379 DEBUG(0, "smc91c92_detach(0x%p)\n", link); ··· 409 411 410 412 /*====================================================================*/ 411 413 412 - static int first_tuple(client_handle_t handle, tuple_t *tuple, 414 + static int first_tuple(struct pcmcia_device *handle, tuple_t *tuple, 413 415 cisparse_t *parse) 414 416 { 415 417 int i; ··· 420 422 return pcmcia_parse_tuple(handle, tuple, parse); 421 423 } 422 424 423 - static int next_tuple(client_handle_t handle, tuple_t *tuple, 425 + static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple, 424 426 cisparse_t *parse) 425 427 { 426 428 int i; ··· 442 444 443 445 ======================================================================*/ 444 446 445 - static int mhz_3288_power(dev_link_t *link) 447 + static int mhz_3288_power(struct pcmcia_device *link) 446 448 { 447 449 struct net_device *dev = link->priv; 448 450 struct smc_private *smc = netdev_priv(dev); ··· 464 466 return 0; 465 467 } 466 468 467 - static int mhz_mfc_config(dev_link_t *link) 469 + static int mhz_mfc_config(struct pcmcia_device *link) 468 470 { 469 471 struct net_device *dev = link->priv; 470 472 struct smc_private *smc = netdev_priv(dev); ··· 499 501 tuple->TupleDataMax = 255; 500 502 tuple->DesiredTuple = CISTPL_CFTABLE_ENTRY; 501 503 502 - i = first_tuple(link->handle, tuple, parse); 504 + i = first_tuple(link, tuple, parse); 503 505 /* The Megahertz combo cards have modem-like CIS entries, so 504 506 we have to explicitly try a bunch of port combinations. */ 505 507 while (i == CS_SUCCESS) { ··· 508 510 for (k = 0; k < 0x400; k += 0x10) { 509 511 if (k & 0x80) continue; 510 512 link->io.BasePort1 = k ^ 0x300; 511 - i = pcmcia_request_io(link->handle, &link->io); 513 + i = pcmcia_request_io(link, &link->io); 512 514 if (i == CS_SUCCESS) break; 513 515 } 514 516 if (i == CS_SUCCESS) break; 515 - i = next_tuple(link->handle, tuple, parse); 517 + i = next_tuple(link, tuple, parse); 516 518 } 517 519 if (i != CS_SUCCESS) 518 520 goto free_cfg_mem; ··· 522 524 req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; 523 525 req.Base = req.Size = 0; 524 526 req.AccessSpeed = 0; 525 - i = pcmcia_request_window(&link->handle, &req, &link->win); 527 + i = pcmcia_request_window(&link, &req, &link->win); 526 528 if (i != CS_SUCCESS) 527 529 goto free_cfg_mem; 528 530 smc->base = ioremap(req.Base, req.Size); ··· 541 543 return i; 542 544 } 543 545 544 - static int mhz_setup(dev_link_t *link) 546 + static int mhz_setup(struct pcmcia_device *link) 545 547 { 546 - client_handle_t handle = link->handle; 547 548 struct net_device *dev = link->priv; 548 549 struct smc_cfg_mem *cfg_mem; 549 550 tuple_t *tuple; ··· 565 568 /* Read the station address from the CIS. It is stored as the last 566 569 (fourth) string in the Version 1 Version/ID tuple. */ 567 570 tuple->DesiredTuple = CISTPL_VERS_1; 568 - if (first_tuple(handle, tuple, parse) != CS_SUCCESS) { 571 + if (first_tuple(link, tuple, parse) != CS_SUCCESS) { 569 572 rc = -1; 570 573 goto free_cfg_mem; 571 574 } 572 575 /* Ugh -- the EM1144 card has two VERS_1 tuples!?! */ 573 - if (next_tuple(handle, tuple, parse) != CS_SUCCESS) 574 - first_tuple(handle, tuple, parse); 576 + if (next_tuple(link, tuple, parse) != CS_SUCCESS) 577 + first_tuple(link, tuple, parse); 575 578 if (parse->version_1.ns > 3) { 576 579 station_addr = parse->version_1.str + parse->version_1.ofs[3]; 577 580 if (cvt_ascii_address(dev, station_addr) == 0) { ··· 582 585 583 586 /* Another possibility: for the EM3288, in a special tuple */ 584 587 tuple->DesiredTuple = 0x81; 585 - if (pcmcia_get_first_tuple(handle, tuple) != CS_SUCCESS) { 588 + if (pcmcia_get_first_tuple(link, tuple) != CS_SUCCESS) { 586 589 rc = -1; 587 590 goto free_cfg_mem; 588 591 } 589 - if (pcmcia_get_tuple_data(handle, tuple) != CS_SUCCESS) { 592 + if (pcmcia_get_tuple_data(link, tuple) != CS_SUCCESS) { 590 593 rc = -1; 591 594 goto free_cfg_mem; 592 595 } ··· 610 613 611 614 ======================================================================*/ 612 615 613 - static void mot_config(dev_link_t *link) 616 + static void mot_config(struct pcmcia_device *link) 614 617 { 615 618 struct net_device *dev = link->priv; 616 619 struct smc_private *smc = netdev_priv(dev); ··· 631 634 mdelay(100); 632 635 } 633 636 634 - static int mot_setup(dev_link_t *link) 637 + static int mot_setup(struct pcmcia_device *link) 635 638 { 636 639 struct net_device *dev = link->priv; 637 640 kio_addr_t ioaddr = dev->base_addr; ··· 665 668 666 669 /*====================================================================*/ 667 670 668 - static int smc_config(dev_link_t *link) 671 + static int smc_config(struct pcmcia_device *link) 669 672 { 670 673 struct net_device *dev = link->priv; 671 674 struct smc_cfg_mem *cfg_mem; ··· 690 693 tuple->DesiredTuple = CISTPL_CFTABLE_ENTRY; 691 694 692 695 link->io.NumPorts1 = 16; 693 - i = first_tuple(link->handle, tuple, parse); 696 + i = first_tuple(link, tuple, parse); 694 697 while (i != CS_NO_MORE_ITEMS) { 695 698 if (i == CS_SUCCESS) { 696 699 link->conf.ConfigIndex = cf->index; 697 700 link->io.BasePort1 = cf->io.win[0].base; 698 701 link->io.IOAddrLines = cf->io.flags & CISTPL_IO_LINES_MASK; 699 - i = pcmcia_request_io(link->handle, &link->io); 702 + i = pcmcia_request_io(link, &link->io); 700 703 if (i == CS_SUCCESS) break; 701 704 } 702 - i = next_tuple(link->handle, tuple, parse); 705 + i = next_tuple(link, tuple, parse); 703 706 } 704 707 if (i == CS_SUCCESS) 705 708 dev->base_addr = link->io.BasePort1; ··· 708 711 return i; 709 712 } 710 713 711 - static int smc_setup(dev_link_t *link) 714 + static int smc_setup(struct pcmcia_device *link) 712 715 { 713 - client_handle_t handle = link->handle; 714 716 struct net_device *dev = link->priv; 715 717 struct smc_cfg_mem *cfg_mem; 716 718 tuple_t *tuple; ··· 732 736 733 737 /* Check for a LAN function extension tuple */ 734 738 tuple->DesiredTuple = CISTPL_FUNCE; 735 - i = first_tuple(handle, tuple, parse); 739 + i = first_tuple(link, tuple, parse); 736 740 while (i == CS_SUCCESS) { 737 741 if (parse->funce.type == CISTPL_FUNCE_LAN_NODE_ID) 738 742 break; 739 - i = next_tuple(handle, tuple, parse); 743 + i = next_tuple(link, tuple, parse); 740 744 } 741 745 if (i == CS_SUCCESS) { 742 746 node_id = (cistpl_lan_node_id_t *)parse->funce.data; ··· 749 753 } 750 754 /* Try the third string in the Version 1 Version/ID tuple. */ 751 755 tuple->DesiredTuple = CISTPL_VERS_1; 752 - if (first_tuple(handle, tuple, parse) != CS_SUCCESS) { 756 + if (first_tuple(link, tuple, parse) != CS_SUCCESS) { 753 757 rc = -1; 754 758 goto free_cfg_mem; 755 759 } ··· 767 771 768 772 /*====================================================================*/ 769 773 770 - static int osi_config(dev_link_t *link) 774 + static int osi_config(struct pcmcia_device *link) 771 775 { 772 776 struct net_device *dev = link->priv; 773 777 static const kio_addr_t com[4] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8 }; ··· 787 791 788 792 for (i = j = 0; j < 4; j++) { 789 793 link->io.BasePort2 = com[j]; 790 - i = pcmcia_request_io(link->handle, &link->io); 794 + i = pcmcia_request_io(link, &link->io); 791 795 if (i == CS_SUCCESS) break; 792 796 } 793 797 if (i != CS_SUCCESS) { 794 798 /* Fallback: turn off hard decode */ 795 799 link->conf.ConfigIndex = 0x03; 796 800 link->io.NumPorts2 = 0; 797 - i = pcmcia_request_io(link->handle, &link->io); 801 + i = pcmcia_request_io(link, &link->io); 798 802 } 799 803 dev->base_addr = link->io.BasePort1 + 0x10; 800 804 return i; 801 805 } 802 806 803 - static int osi_setup(dev_link_t *link, u_short manfid, u_short cardid) 807 + static int osi_setup(struct pcmcia_device *link, u_short manfid, u_short cardid) 804 808 { 805 - client_handle_t handle = link->handle; 806 809 struct net_device *dev = link->priv; 807 810 struct smc_cfg_mem *cfg_mem; 808 811 tuple_t *tuple; ··· 822 827 823 828 /* Read the station address from tuple 0x90, subtuple 0x04 */ 824 829 tuple->DesiredTuple = 0x90; 825 - i = pcmcia_get_first_tuple(handle, tuple); 830 + i = pcmcia_get_first_tuple(link, tuple); 826 831 while (i == CS_SUCCESS) { 827 - i = pcmcia_get_tuple_data(handle, tuple); 832 + i = pcmcia_get_tuple_data(link, tuple); 828 833 if ((i != CS_SUCCESS) || (buf[0] == 0x04)) 829 834 break; 830 - i = pcmcia_get_next_tuple(handle, tuple); 835 + i = pcmcia_get_next_tuple(link, tuple); 831 836 } 832 837 if (i != CS_SUCCESS) { 833 838 rc = -1; ··· 860 865 return rc; 861 866 } 862 867 863 - static int smc91c92_suspend(struct pcmcia_device *p_dev) 868 + static int smc91c92_suspend(struct pcmcia_device *link) 864 869 { 865 - dev_link_t *link = dev_to_instance(p_dev); 866 870 struct net_device *dev = link->priv; 867 871 868 872 if ((link->state & DEV_CONFIG) && (link->open)) ··· 870 876 return 0; 871 877 } 872 878 873 - static int smc91c92_resume(struct pcmcia_device *p_dev) 879 + static int smc91c92_resume(struct pcmcia_device *link) 874 880 { 875 - dev_link_t *link = dev_to_instance(p_dev); 876 881 struct net_device *dev = link->priv; 877 882 struct smc_private *smc = netdev_priv(dev); 878 883 int i; ··· 915 922 916 923 ======================================================================*/ 917 924 918 - static int check_sig(dev_link_t *link) 925 + static int check_sig(struct pcmcia_device *link) 919 926 { 920 927 struct net_device *dev = link->priv; 921 928 kio_addr_t ioaddr = dev->base_addr; ··· 953 960 }; 954 961 printk(KERN_INFO "smc91c92_cs: using 8-bit IO window.\n"); 955 962 956 - smc91c92_suspend(link->handle); 957 - pcmcia_modify_configuration(link->handle, &mod); 958 - smc91c92_resume(link->handle); 963 + smc91c92_suspend(link); 964 + pcmcia_modify_configuration(link, &mod); 965 + smc91c92_resume(link); 959 966 return check_sig(link); 960 967 } 961 968 return -ENODEV; ··· 970 977 ======================================================================*/ 971 978 972 979 #define CS_EXIT_TEST(ret, svc, label) \ 973 - if (ret != CS_SUCCESS) { cs_error(link->handle, svc, ret); goto label; } 980 + if (ret != CS_SUCCESS) { cs_error(link, svc, ret); goto label; } 974 981 975 - static void smc91c92_config(dev_link_t *link) 982 + static void smc91c92_config(struct pcmcia_device *link) 976 983 { 977 - client_handle_t handle = link->handle; 978 984 struct net_device *dev = link->priv; 979 985 struct smc_private *smc = netdev_priv(dev); 980 986 struct smc_cfg_mem *cfg_mem; ··· 1000 1008 tuple->TupleDataMax = 64; 1001 1009 1002 1010 tuple->DesiredTuple = CISTPL_CONFIG; 1003 - i = first_tuple(handle, tuple, parse); 1011 + i = first_tuple(link, tuple, parse); 1004 1012 CS_EXIT_TEST(i, ParseTuple, config_failed); 1005 1013 link->conf.ConfigBase = parse->config.base; 1006 1014 link->conf.Present = parse->config.rmask[0]; 1007 1015 1008 1016 tuple->DesiredTuple = CISTPL_MANFID; 1009 1017 tuple->Attributes = TUPLE_RETURN_COMMON; 1010 - if (first_tuple(handle, tuple, parse) == CS_SUCCESS) { 1018 + if (first_tuple(link, tuple, parse) == CS_SUCCESS) { 1011 1019 smc->manfid = parse->manfid.manf; 1012 1020 smc->cardid = parse->manfid.card; 1013 1021 } ··· 1028 1036 } 1029 1037 CS_EXIT_TEST(i, RequestIO, config_failed); 1030 1038 1031 - i = pcmcia_request_irq(link->handle, &link->irq); 1039 + i = pcmcia_request_irq(link, &link->irq); 1032 1040 CS_EXIT_TEST(i, RequestIRQ, config_failed); 1033 - i = pcmcia_request_configuration(link->handle, &link->conf); 1041 + i = pcmcia_request_configuration(link, &link->conf); 1034 1042 CS_EXIT_TEST(i, RequestConfiguration, config_failed); 1035 1043 1036 1044 if (smc->manfid == MANFID_MOTOROLA) ··· 1111 1119 1112 1120 link->dev_node = &smc->node; 1113 1121 link->state &= ~DEV_CONFIG_PENDING; 1114 - SET_NETDEV_DEV(dev, &handle_to_dev(handle)); 1122 + SET_NETDEV_DEV(dev, &handle_to_dev(link)); 1115 1123 1116 1124 if (register_netdev(dev) != 0) { 1117 1125 printk(KERN_ERR "smc91c92_cs: register_netdev() failed\n"); ··· 1164 1172 1165 1173 ======================================================================*/ 1166 1174 1167 - static void smc91c92_release(dev_link_t *link) 1175 + static void smc91c92_release(struct pcmcia_device *link) 1168 1176 { 1169 1177 DEBUG(0, "smc91c92_release(0x%p)\n", link); 1170 1178 if (link->win) { ··· 1172 1180 struct smc_private *smc = netdev_priv(dev); 1173 1181 iounmap(smc->base); 1174 1182 } 1175 - pcmcia_disable_device(link->handle); 1183 + pcmcia_disable_device(link); 1176 1184 } 1177 1185 1178 1186 /*====================================================================== ··· 1261 1269 static int smc_open(struct net_device *dev) 1262 1270 { 1263 1271 struct smc_private *smc = netdev_priv(dev); 1264 - dev_link_t *link = smc->p_dev; 1272 + struct pcmcia_device *link = smc->p_dev; 1265 1273 1266 1274 #ifdef PCMCIA_DEBUG 1267 1275 DEBUG(0, "%s: smc_open(%p), ID/Window %4.4x.\n", ··· 1298 1306 static int smc_close(struct net_device *dev) 1299 1307 { 1300 1308 struct smc_private *smc = netdev_priv(dev); 1301 - dev_link_t *link = smc->p_dev; 1309 + struct pcmcia_device *link = smc->p_dev; 1302 1310 kio_addr_t ioaddr = dev->base_addr; 1303 1311 1304 1312 DEBUG(0, "%s: smc_close(), status %4.4x.\n",
+51 -57
drivers/net/pcmcia/xirc2ps_cs.c
··· 289 289 * and ejection events. They are invoked from the event handler. 290 290 */ 291 291 292 - static int has_ce2_string(dev_link_t * link); 293 - static void xirc2ps_config(dev_link_t * link); 294 - static void xirc2ps_release(dev_link_t * link); 292 + static int has_ce2_string(struct pcmcia_device * link); 293 + static void xirc2ps_config(struct pcmcia_device * link); 294 + static void xirc2ps_release(struct pcmcia_device * link); 295 295 296 296 /**************** 297 297 * The attach() and detach() entry points are used to create and destroy ··· 313 313 /**************** 314 314 * A linked list of "instances" of the device. Each actual 315 315 * PCMCIA card corresponds to one device instance, and is described 316 - * by one dev_link_t structure (defined in ds.h). 316 + * by one struct pcmcia_device structure (defined in ds.h). 317 317 * 318 318 * You may not want to use a linked list for this -- for example, the 319 - * memory card driver uses an array of dev_link_t pointers, where minor 319 + * memory card driver uses an array of struct pcmcia_device pointers, where minor 320 320 * device numbers are used to derive the corresponding array index. 321 321 */ 322 322 ··· 326 326 * example, ethernet cards, modems). In other cases, there may be 327 327 * many actual or logical devices (SCSI adapters, memory cards with 328 328 * multiple partitions). The dev_node_t structures need to be kept 329 - * in a linked list starting at the 'dev' field of a dev_link_t 329 + * in a linked list starting at the 'dev' field of a struct pcmcia_device 330 330 * structure. We allocate them in the card's private data structure, 331 331 * because they generally can't be allocated dynamically. 332 332 */ ··· 355 355 static struct net_device_stats *do_get_stats(struct net_device *dev); 356 356 static void set_addresses(struct net_device *dev); 357 357 static void set_multicast_list(struct net_device *dev); 358 - static int set_card_type(dev_link_t *link, const void *s); 358 + static int set_card_type(struct pcmcia_device *link, const void *s); 359 359 static int do_config(struct net_device *dev, struct ifmap *map); 360 360 static int do_open(struct net_device *dev); 361 361 static int do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); ··· 368 368 369 369 /*=============== Helper functions =========================*/ 370 370 static int 371 - first_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse) 371 + first_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t *parse) 372 372 { 373 373 int err; 374 374 ··· 379 379 } 380 380 381 381 static int 382 - next_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse) 382 + next_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t *parse) 383 383 { 384 384 int err; 385 385 ··· 553 553 */ 554 554 555 555 static int 556 - xirc2ps_attach(struct pcmcia_device *p_dev) 556 + xirc2ps_attach(struct pcmcia_device *link) 557 557 { 558 558 struct net_device *dev; 559 559 local_info_t *local; 560 - dev_link_t *link = dev_to_instance(p_dev); 561 560 562 561 DEBUG(0, "attach()\n"); 563 562 ··· 565 566 if (!dev) 566 567 return -ENOMEM; 567 568 local = netdev_priv(dev); 568 - local->p_dev = p_dev; 569 + local->p_dev = link; 569 570 link->priv = dev; 570 571 571 572 /* General socket configuration */ ··· 605 606 */ 606 607 607 608 static void 608 - xirc2ps_detach(struct pcmcia_device *p_dev) 609 + xirc2ps_detach(struct pcmcia_device *link) 609 610 { 610 - dev_link_t *link = dev_to_instance(p_dev); 611 611 struct net_device *dev = link->priv; 612 612 613 613 DEBUG(0, "detach(0x%p)\n", link); ··· 639 641 * 640 642 */ 641 643 static int 642 - set_card_type(dev_link_t *link, const void *s) 644 + set_card_type(struct pcmcia_device *link, const void *s) 643 645 { 644 646 struct net_device *dev = link->priv; 645 647 local_info_t *local = netdev_priv(dev); ··· 708 710 * Returns: true if this is a CE2 709 711 */ 710 712 static int 711 - has_ce2_string(dev_link_t * link) 713 + has_ce2_string(struct pcmcia_device * link) 712 714 { 713 - client_handle_t handle = link->handle; 714 715 tuple_t tuple; 715 716 cisparse_t parse; 716 717 u_char buf[256]; ··· 719 722 tuple.TupleDataMax = 254; 720 723 tuple.TupleOffset = 0; 721 724 tuple.DesiredTuple = CISTPL_VERS_1; 722 - if (!first_tuple(handle, &tuple, &parse) && parse.version_1.ns > 2) { 725 + if (!first_tuple(link, &tuple, &parse) && parse.version_1.ns > 2) { 723 726 if (strstr(parse.version_1.str + parse.version_1.ofs[2], "CE2")) 724 727 return 1; 725 728 } ··· 732 735 * ethernet device available to the system. 733 736 */ 734 737 static void 735 - xirc2ps_config(dev_link_t * link) 738 + xirc2ps_config(struct pcmcia_device * link) 736 739 { 737 - client_handle_t handle = link->handle; 738 740 struct net_device *dev = link->priv; 739 741 local_info_t *local = netdev_priv(dev); 740 742 tuple_t tuple; ··· 759 763 760 764 /* Is this a valid card */ 761 765 tuple.DesiredTuple = CISTPL_MANFID; 762 - if ((err=first_tuple(handle, &tuple, &parse))) { 766 + if ((err=first_tuple(link, &tuple, &parse))) { 763 767 printk(KNOT_XIRC "manfid not found in CIS\n"); 764 768 goto failure; 765 769 } ··· 795 799 796 800 /* get configuration stuff */ 797 801 tuple.DesiredTuple = CISTPL_CONFIG; 798 - if ((err=first_tuple(handle, &tuple, &parse))) 802 + if ((err=first_tuple(link, &tuple, &parse))) 799 803 goto cis_error; 800 804 link->conf.ConfigBase = parse.config.base; 801 805 link->conf.Present = parse.config.rmask[0]; 802 806 803 807 /* get the ethernet address from the CIS */ 804 808 tuple.DesiredTuple = CISTPL_FUNCE; 805 - for (err = first_tuple(handle, &tuple, &parse); !err; 806 - err = next_tuple(handle, &tuple, &parse)) { 809 + for (err = first_tuple(link, &tuple, &parse); !err; 810 + err = next_tuple(link, &tuple, &parse)) { 807 811 /* Once I saw two CISTPL_FUNCE_LAN_NODE_ID entries: 808 812 * the first one with a length of zero the second correct - 809 813 * so I skip all entries with length 0 */ ··· 813 817 } 814 818 if (err) { /* not found: try to get the node-id from tuple 0x89 */ 815 819 tuple.DesiredTuple = 0x89; /* data layout looks like tuple 0x22 */ 816 - if ((err = pcmcia_get_first_tuple(handle, &tuple)) == 0 && 817 - (err = pcmcia_get_tuple_data(handle, &tuple)) == 0) { 820 + if ((err = pcmcia_get_first_tuple(link, &tuple)) == 0 && 821 + (err = pcmcia_get_tuple_data(link, &tuple)) == 0) { 818 822 if (tuple.TupleDataLen == 8 && *buf == CISTPL_FUNCE_LAN_NODE_ID) 819 823 memcpy(&parse, buf, 8); 820 824 else ··· 823 827 } 824 828 if (err) { /* another try (James Lehmer's CE2 version 4.1)*/ 825 829 tuple.DesiredTuple = CISTPL_FUNCE; 826 - for (err = first_tuple(handle, &tuple, &parse); !err; 827 - err = next_tuple(handle, &tuple, &parse)) { 830 + for (err = first_tuple(link, &tuple, &parse); !err; 831 + err = next_tuple(link, &tuple, &parse)) { 828 832 if (parse.funce.type == 0x02 && parse.funce.data[0] == 1 829 833 && parse.funce.data[1] == 6 && tuple.TupleDataLen == 13) { 830 834 buf[1] = 4; ··· 867 871 * Ethernet port */ 868 872 link->io.NumPorts1 = 16; /* no Mako stuff anymore */ 869 873 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 870 - for (err = first_tuple(handle, &tuple, &parse); !err; 871 - err = next_tuple(handle, &tuple, &parse)) { 874 + for (err = first_tuple(link, &tuple, &parse); !err; 875 + err = next_tuple(link, &tuple, &parse)) { 872 876 if (cf->io.nwin > 0 && (cf->io.win[0].base & 0xf) == 8) { 873 877 for (ioaddr = 0x300; ioaddr < 0x400; ioaddr += 0x10) { 874 878 link->conf.ConfigIndex = cf->index ; 875 879 link->io.BasePort2 = cf->io.win[0].base; 876 880 link->io.BasePort1 = ioaddr; 877 - if (!(err=pcmcia_request_io(link->handle, &link->io))) 881 + if (!(err=pcmcia_request_io(link, &link->io))) 878 882 goto port_found; 879 883 } 880 884 } ··· 888 892 */ 889 893 for (pass=0; pass < 2; pass++) { 890 894 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 891 - for (err = first_tuple(handle, &tuple, &parse); !err; 892 - err = next_tuple(handle, &tuple, &parse)){ 895 + for (err = first_tuple(link, &tuple, &parse); !err; 896 + err = next_tuple(link, &tuple, &parse)){ 893 897 if (cf->io.nwin > 0 && (cf->io.win[0].base & 0xf) == 8){ 894 898 link->conf.ConfigIndex = cf->index ; 895 899 link->io.BasePort2 = cf->io.win[0].base; 896 900 link->io.BasePort1 = link->io.BasePort2 897 901 + (pass ? (cf->index & 0x20 ? -24:8) 898 902 : (cf->index & 0x20 ? 8:-24)); 899 - if (!(err=pcmcia_request_io(link->handle, &link->io))) 903 + if (!(err=pcmcia_request_io(link, &link->io))) 900 904 goto port_found; 901 905 } 902 906 } ··· 911 915 link->io.NumPorts1 = 16; 912 916 for (ioaddr = 0x300; ioaddr < 0x400; ioaddr += 0x10) { 913 917 link->io.BasePort1 = ioaddr; 914 - if (!(err=pcmcia_request_io(link->handle, &link->io))) 918 + if (!(err=pcmcia_request_io(link, &link->io))) 915 919 goto port_found; 916 920 } 917 921 link->io.BasePort1 = 0; /* let CS decide */ 918 - if ((err=pcmcia_request_io(link->handle, &link->io))) { 919 - cs_error(link->handle, RequestIO, err); 922 + if ((err=pcmcia_request_io(link, &link->io))) { 923 + cs_error(link, RequestIO, err); 920 924 goto config_error; 921 925 } 922 926 } ··· 928 932 * Now allocate an interrupt line. Note that this does not 929 933 * actually assign a handler to the interrupt. 930 934 */ 931 - if ((err=pcmcia_request_irq(link->handle, &link->irq))) { 932 - cs_error(link->handle, RequestIRQ, err); 935 + if ((err=pcmcia_request_irq(link, &link->irq))) { 936 + cs_error(link, RequestIRQ, err); 933 937 goto config_error; 934 938 } 935 939 ··· 937 941 * This actually configures the PCMCIA socket -- setting up 938 942 * the I/O windows and the interrupt mapping. 939 943 */ 940 - if ((err=pcmcia_request_configuration(link->handle, &link->conf))) { 941 - cs_error(link->handle, RequestConfiguration, err); 944 + if ((err=pcmcia_request_configuration(link, &link->conf))) { 945 + cs_error(link, RequestConfiguration, err); 942 946 goto config_error; 943 947 } 944 948 ··· 955 959 reg.Action = CS_WRITE; 956 960 reg.Offset = CISREG_IOBASE_0; 957 961 reg.Value = link->io.BasePort2 & 0xff; 958 - if ((err = pcmcia_access_configuration_register(link->handle, &reg))) { 959 - cs_error(link->handle, AccessConfigurationRegister, err); 962 + if ((err = pcmcia_access_configuration_register(link, &reg))) { 963 + cs_error(link, AccessConfigurationRegister, err); 960 964 goto config_error; 961 965 } 962 966 reg.Action = CS_WRITE; 963 967 reg.Offset = CISREG_IOBASE_1; 964 968 reg.Value = (link->io.BasePort2 >> 8) & 0xff; 965 - if ((err = pcmcia_access_configuration_register(link->handle, &reg))) { 966 - cs_error(link->handle, AccessConfigurationRegister, err); 969 + if ((err = pcmcia_access_configuration_register(link, &reg))) { 970 + cs_error(link, AccessConfigurationRegister, err); 967 971 goto config_error; 968 972 } 969 973 ··· 974 978 req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; 975 979 req.Base = req.Size = 0; 976 980 req.AccessSpeed = 0; 977 - if ((err = pcmcia_request_window(&link->handle, &req, &link->win))) { 978 - cs_error(link->handle, RequestWindow, err); 981 + if ((err = pcmcia_request_window(&link, &req, &link->win))) { 982 + cs_error(link, RequestWindow, err); 979 983 goto config_error; 980 984 } 981 985 local->dingo_ccr = ioremap(req.Base,0x1000) + 0x0800; 982 986 mem.CardOffset = 0x0; 983 987 mem.Page = 0; 984 988 if ((err = pcmcia_map_mem_page(link->win, &mem))) { 985 - cs_error(link->handle, MapMemPage, err); 989 + cs_error(link, MapMemPage, err); 986 990 goto config_error; 987 991 } 988 992 ··· 1044 1048 1045 1049 link->dev_node = &local->node; 1046 1050 link->state &= ~DEV_CONFIG_PENDING; 1047 - SET_NETDEV_DEV(dev, &handle_to_dev(handle)); 1051 + SET_NETDEV_DEV(dev, &handle_to_dev(link)); 1048 1052 1049 1053 if ((err=register_netdev(dev))) { 1050 1054 printk(KNOT_XIRC "register_netdev() failed\n"); ··· 1080 1084 * still open, this will be postponed until it is closed. 1081 1085 */ 1082 1086 static void 1083 - xirc2ps_release(dev_link_t *link) 1087 + xirc2ps_release(struct pcmcia_device *link) 1084 1088 { 1085 1089 DEBUG(0, "release(0x%p)\n", link); 1086 1090 ··· 1090 1094 if (local->dingo) 1091 1095 iounmap(local->dingo_ccr - 0x0800); 1092 1096 } 1093 - pcmcia_disable_device(link->handle); 1097 + pcmcia_disable_device(link); 1094 1098 } /* xirc2ps_release */ 1095 1099 1096 1100 /*====================================================================*/ 1097 1101 1098 1102 1099 - static int xirc2ps_suspend(struct pcmcia_device *p_dev) 1103 + static int xirc2ps_suspend(struct pcmcia_device *link) 1100 1104 { 1101 - dev_link_t *link = dev_to_instance(p_dev); 1102 1105 struct net_device *dev = link->priv; 1103 1106 1104 1107 if ((link->state & DEV_CONFIG) && (link->open)) { ··· 1108 1113 return 0; 1109 1114 } 1110 1115 1111 - static int xirc2ps_resume(struct pcmcia_device *p_dev) 1116 + static int xirc2ps_resume(struct pcmcia_device *link) 1112 1117 { 1113 - dev_link_t *link = dev_to_instance(p_dev); 1114 1118 struct net_device *dev = link->priv; 1115 1119 1116 1120 if ((link->state & DEV_CONFIG) && (link->open)) { ··· 1528 1534 do_open(struct net_device *dev) 1529 1535 { 1530 1536 local_info_t *lp = netdev_priv(dev); 1531 - dev_link_t *link = lp->p_dev; 1537 + struct pcmcia_device *link = lp->p_dev; 1532 1538 1533 1539 DEBUG(0, "do_open(%p)\n", dev); 1534 1540 ··· 1858 1864 { 1859 1865 kio_addr_t ioaddr = dev->base_addr; 1860 1866 local_info_t *lp = netdev_priv(dev); 1861 - dev_link_t *link = lp->p_dev; 1867 + struct pcmcia_device *link = lp->p_dev; 1862 1868 1863 1869 DEBUG(0, "do_stop(%p)\n", dev); 1864 1870
+26 -32
drivers/net/wireless/airo_cs.c
··· 80 80 event handler. 81 81 */ 82 82 83 - static void airo_config(dev_link_t *link); 84 - static void airo_release(dev_link_t *link); 83 + static void airo_config(struct pcmcia_device *link); 84 + static void airo_release(struct pcmcia_device *link); 85 85 86 86 /* 87 87 The attach() and detach() entry points are used to create and destroy ··· 101 101 /* 102 102 A linked list of "instances" of the aironet device. Each actual 103 103 PCMCIA card corresponds to one device instance, and is described 104 - by one dev_link_t structure (defined in ds.h). 104 + by one struct pcmcia_device structure (defined in ds.h). 105 105 106 106 You may not want to use a linked list for this -- for example, the 107 - memory card driver uses an array of dev_link_t pointers, where minor 107 + memory card driver uses an array of struct pcmcia_device pointers, where minor 108 108 device numbers are used to derive the corresponding array index. 109 109 */ 110 110 ··· 114 114 example, ethernet cards, modems). In other cases, there may be 115 115 many actual or logical devices (SCSI adapters, memory cards with 116 116 multiple partitions). The dev_node_t structures need to be kept 117 - in a linked list starting at the 'dev' field of a dev_link_t 117 + in a linked list starting at the 'dev' field of a struct pcmcia_device 118 118 structure. We allocate them in the card's private data structure, 119 119 because they generally shouldn't be allocated dynamically. 120 120 ··· 185 185 186 186 ======================================================================*/ 187 187 188 - static void airo_detach(struct pcmcia_device *p_dev) 188 + static void airo_detach(struct pcmcia_device *link) 189 189 { 190 - dev_link_t *link = dev_to_instance(p_dev); 191 - 192 190 DEBUG(0, "airo_detach(0x%p)\n", link); 193 191 194 192 if (link->state & DEV_CONFIG) ··· 211 213 #define CS_CHECK(fn, ret) \ 212 214 do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 213 215 214 - static void airo_config(dev_link_t *link) 216 + static void airo_config(struct pcmcia_device *link) 215 217 { 216 - client_handle_t handle; 217 218 tuple_t tuple; 218 219 cisparse_t parse; 219 220 local_info_t *dev; ··· 220 223 u_char buf[64]; 221 224 win_req_t req; 222 225 memreq_t map; 223 - 224 - handle = link->handle; 226 + 225 227 dev = link->priv; 226 228 227 229 DEBUG(0, "airo_config(0x%p)\n", link); ··· 234 238 tuple.TupleData = buf; 235 239 tuple.TupleDataMax = sizeof(buf); 236 240 tuple.TupleOffset = 0; 237 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 238 - CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 239 - CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse)); 241 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 242 + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 243 + CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); 240 244 link->conf.ConfigBase = parse.config.base; 241 245 link->conf.Present = parse.config.rmask[0]; 242 246 ··· 256 260 will only use the CIS to fill in implementation-defined details. 257 261 */ 258 262 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 259 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 263 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 260 264 while (1) { 261 265 cistpl_cftable_entry_t dflt = { 0 }; 262 266 cistpl_cftable_entry_t *cfg = &(parse.cftable_entry); 263 - if (pcmcia_get_tuple_data(handle, &tuple) != 0 || 264 - pcmcia_parse_tuple(handle, &tuple, &parse) != 0) 267 + if (pcmcia_get_tuple_data(link, &tuple) != 0 || 268 + pcmcia_parse_tuple(link, &tuple, &parse) != 0) 265 269 goto next_entry; 266 270 267 271 if (cfg->flags & CISTPL_CFTABLE_DEFAULT) dflt = *cfg; ··· 306 310 } 307 311 308 312 /* This reserves IO space but doesn't actually enable it */ 309 - if (pcmcia_request_io(link->handle, &link->io) != 0) 313 + if (pcmcia_request_io(link, &link->io) != 0) 310 314 goto next_entry; 311 315 312 316 /* 313 317 Now set up a common memory window, if needed. There is room 314 - in the dev_link_t structure for one memory window handle, 318 + in the struct pcmcia_device structure for one memory window handle, 315 319 but if the base addresses need to be saved, or if multiple 316 320 windows are needed, the info should go in the private data 317 321 structure for this device. ··· 327 331 req.Base = mem->win[0].host_addr; 328 332 req.Size = mem->win[0].len; 329 333 req.AccessSpeed = 0; 330 - if (pcmcia_request_window(&link->handle, &req, &link->win) != 0) 334 + if (pcmcia_request_window(&link, &req, &link->win) != 0) 331 335 goto next_entry; 332 336 map.Page = 0; map.CardOffset = mem->win[0].card_addr; 333 337 if (pcmcia_map_mem_page(link->win, &map) != 0) ··· 337 341 break; 338 342 339 343 next_entry: 340 - CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(handle, &tuple)); 344 + CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(link, &tuple)); 341 345 } 342 346 343 347 /* ··· 346 350 irq structure is initialized. 347 351 */ 348 352 if (link->conf.Attributes & CONF_ENABLE_IRQ) 349 - CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq)); 353 + CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 350 354 351 355 /* 352 356 This actually configures the PCMCIA socket -- setting up 353 357 the I/O windows and the interrupt mapping, and putting the 354 358 card and host interface into "Memory and IO" mode. 355 359 */ 356 - CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf)); 360 + CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 357 361 ((local_info_t*)link->priv)->eth_dev = 358 362 init_airo_card( link->irq.AssignedIRQ, 359 - link->io.BasePort1, 1, &handle_to_dev(handle) ); 363 + link->io.BasePort1, 1, &handle_to_dev(link) ); 360 364 if (!((local_info_t*)link->priv)->eth_dev) goto cs_failed; 361 365 362 366 /* ··· 389 393 return; 390 394 391 395 cs_failed: 392 - cs_error(link->handle, last_fn, last_ret); 396 + cs_error(link, last_fn, last_ret); 393 397 airo_release(link); 394 398 395 399 } /* airo_config */ ··· 402 406 403 407 ======================================================================*/ 404 408 405 - static void airo_release(dev_link_t *link) 409 + static void airo_release(struct pcmcia_device *link) 406 410 { 407 411 DEBUG(0, "airo_release(0x%p)\n", link); 408 - pcmcia_disable_device(link->handle); 412 + pcmcia_disable_device(link); 409 413 } 410 414 411 - static int airo_suspend(struct pcmcia_device *p_dev) 415 + static int airo_suspend(struct pcmcia_device *link) 412 416 { 413 - dev_link_t *link = dev_to_instance(p_dev); 414 417 local_info_t *local = link->priv; 415 418 416 419 if (link->state & DEV_CONFIG) ··· 418 423 return 0; 419 424 } 420 425 421 - static int airo_resume(struct pcmcia_device *p_dev) 426 + static int airo_resume(struct pcmcia_device *link) 422 427 { 423 - dev_link_t *link = dev_to_instance(p_dev); 424 428 local_info_t *local = link->priv; 425 429 426 430 if ((link->state & DEV_CONFIG) && (link->open)) {
+25 -31
drivers/net/wireless/atmel_cs.c
··· 91 91 event handler. 92 92 */ 93 93 94 - static void atmel_config(dev_link_t *link); 95 - static void atmel_release(dev_link_t *link); 94 + static void atmel_config(struct pcmcia_device *link); 95 + static void atmel_release(struct pcmcia_device *link); 96 96 97 97 /* 98 98 The attach() and detach() entry points are used to create and destroy ··· 112 112 /* 113 113 A linked list of "instances" of the atmelnet device. Each actual 114 114 PCMCIA card corresponds to one device instance, and is described 115 - by one dev_link_t structure (defined in ds.h). 115 + by one struct pcmcia_device structure (defined in ds.h). 116 116 117 117 You may not want to use a linked list for this -- for example, the 118 - memory card driver uses an array of dev_link_t pointers, where minor 118 + memory card driver uses an array of struct pcmcia_device pointers, where minor 119 119 device numbers are used to derive the corresponding array index. 120 120 */ 121 121 ··· 125 125 example, ethernet cards, modems). In other cases, there may be 126 126 many actual or logical devices (SCSI adapters, memory cards with 127 127 multiple partitions). The dev_node_t structures need to be kept 128 - in a linked list starting at the 'dev' field of a dev_link_t 128 + in a linked list starting at the 'dev' field of a struct pcmcia_device 129 129 structure. We allocate them in the card's private data structure, 130 130 because they generally shouldn't be allocated dynamically. 131 131 ··· 196 196 197 197 ======================================================================*/ 198 198 199 - static void atmel_detach(struct pcmcia_device *p_dev) 199 + static void atmel_detach(struct pcmcia_device *link) 200 200 { 201 - dev_link_t *link = dev_to_instance(p_dev); 202 - 203 201 DEBUG(0, "atmel_detach(0x%p)\n", link); 204 202 205 203 if (link->state & DEV_CONFIG) ··· 221 223 about the current existance of the card */ 222 224 static int card_present(void *arg) 223 225 { 224 - dev_link_t *link = (dev_link_t *)arg; 226 + struct pcmcia_device *link = (struct pcmcia_device *)arg; 225 227 if (link->state & DEV_SUSPEND) 226 228 return 0; 227 229 else if (link->state & DEV_PRESENT) ··· 230 232 return 0; 231 233 } 232 234 233 - static void atmel_config(dev_link_t *link) 235 + static void atmel_config(struct pcmcia_device *link) 234 236 { 235 - client_handle_t handle; 236 237 tuple_t tuple; 237 238 cisparse_t parse; 238 239 local_info_t *dev; ··· 239 242 u_char buf[64]; 240 243 struct pcmcia_device_id *did; 241 244 242 - handle = link->handle; 243 245 dev = link->priv; 244 - did = handle_to_dev(handle).driver_data; 246 + did = handle_to_dev(link).driver_data; 245 247 246 248 DEBUG(0, "atmel_config(0x%p)\n", link); 247 249 ··· 254 258 registers. 255 259 */ 256 260 tuple.DesiredTuple = CISTPL_CONFIG; 257 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 258 - CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 259 - CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse)); 261 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 262 + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 263 + CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); 260 264 link->conf.ConfigBase = parse.config.base; 261 265 link->conf.Present = parse.config.rmask[0]; 262 266 ··· 276 280 will only use the CIS to fill in implementation-defined details. 277 281 */ 278 282 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 279 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 283 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 280 284 while (1) { 281 285 cistpl_cftable_entry_t dflt = { 0 }; 282 286 cistpl_cftable_entry_t *cfg = &(parse.cftable_entry); 283 - if (pcmcia_get_tuple_data(handle, &tuple) != 0 || 284 - pcmcia_parse_tuple(handle, &tuple, &parse) != 0) 287 + if (pcmcia_get_tuple_data(link, &tuple) != 0 || 288 + pcmcia_parse_tuple(link, &tuple, &parse) != 0) 285 289 goto next_entry; 286 290 287 291 if (cfg->flags & CISTPL_CFTABLE_DEFAULT) dflt = *cfg; ··· 326 330 } 327 331 328 332 /* This reserves IO space but doesn't actually enable it */ 329 - if (pcmcia_request_io(link->handle, &link->io) != 0) 333 + if (pcmcia_request_io(link, &link->io) != 0) 330 334 goto next_entry; 331 335 332 336 /* If we got this far, we're cool! */ 333 337 break; 334 338 335 339 next_entry: 336 - CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(handle, &tuple)); 340 + CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(link, &tuple)); 337 341 } 338 342 339 343 /* ··· 342 346 irq structure is initialized. 343 347 */ 344 348 if (link->conf.Attributes & CONF_ENABLE_IRQ) 345 - CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq)); 349 + CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 346 350 347 351 /* 348 352 This actually configures the PCMCIA socket -- setting up 349 353 the I/O windows and the interrupt mapping, and putting the 350 354 card and host interface into "Memory and IO" mode. 351 355 */ 352 - CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf)); 356 + CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 353 357 354 358 if (link->irq.AssignedIRQ == 0) { 355 359 printk(KERN_ALERT ··· 361 365 init_atmel_card(link->irq.AssignedIRQ, 362 366 link->io.BasePort1, 363 367 did ? did->driver_info : ATMEL_FW_TYPE_NONE, 364 - &handle_to_dev(handle), 368 + &handle_to_dev(link), 365 369 card_present, 366 370 link); 367 371 if (!((local_info_t*)link->priv)->eth_dev) ··· 380 384 return; 381 385 382 386 cs_failed: 383 - cs_error(link->handle, last_fn, last_ret); 387 + cs_error(link, last_fn, last_ret); 384 388 atmel_release(link); 385 389 } 386 390 ··· 392 396 393 397 ======================================================================*/ 394 398 395 - static void atmel_release(dev_link_t *link) 399 + static void atmel_release(struct pcmcia_device *link) 396 400 { 397 401 struct net_device *dev = ((local_info_t*)link->priv)->eth_dev; 398 402 ··· 402 406 stop_atmel_card(dev); 403 407 ((local_info_t*)link->priv)->eth_dev = NULL; 404 408 405 - pcmcia_disable_device(link->handle); 409 + pcmcia_disable_device(link); 406 410 } 407 411 408 - static int atmel_suspend(struct pcmcia_device *dev) 412 + static int atmel_suspend(struct pcmcia_device *link) 409 413 { 410 - dev_link_t *link = dev_to_instance(dev); 411 414 local_info_t *local = link->priv; 412 415 413 416 if (link->state & DEV_CONFIG) ··· 415 420 return 0; 416 421 } 417 422 418 - static int atmel_resume(struct pcmcia_device *dev) 423 + static int atmel_resume(struct pcmcia_device *link) 419 424 { 420 - dev_link_t *link = dev_to_instance(dev); 421 425 local_info_t *local = link->priv; 422 426 423 427 if (link->state & DEV_CONFIG) {
+39 -43
drivers/net/wireless/hostap/hostap_cs.c
··· 42 42 /* struct local_info::hw_priv */ 43 43 struct hostap_cs_priv { 44 44 dev_node_t node; 45 - dev_link_t *link; 45 + struct pcmcia_device *link; 46 46 int sandisk_connectplus; 47 47 }; 48 48 ··· 204 204 205 205 static void prism2_detach(struct pcmcia_device *p_dev); 206 206 static void prism2_release(u_long arg); 207 - static int prism2_config(dev_link_t *link); 207 + static int prism2_config(struct pcmcia_device *link); 208 208 209 209 210 210 static int prism2_pccard_card_present(local_info_t *local) ··· 237 237 reg.Action = CS_WRITE; 238 238 reg.Offset = 0x10; /* 0x3f0 IO base 1 */ 239 239 reg.Value = hw_priv->link->io.BasePort1 & 0x00ff; 240 - res = pcmcia_access_configuration_register(hw_priv->link->handle, 240 + res = pcmcia_access_configuration_register(hw_priv->link, 241 241 &reg); 242 242 if (res != CS_SUCCESS) { 243 243 printk(KERN_DEBUG "Prism3 SanDisk - failed to set I/O base 0 -" ··· 249 249 reg.Action = CS_WRITE; 250 250 reg.Offset = 0x12; /* 0x3f2 IO base 2 */ 251 251 reg.Value = (hw_priv->link->io.BasePort1 & 0xff00) >> 8; 252 - res = pcmcia_access_configuration_register(hw_priv->link->handle, 252 + res = pcmcia_access_configuration_register(hw_priv->link, 253 253 &reg); 254 254 if (res != CS_SUCCESS) { 255 255 printk(KERN_DEBUG "Prism3 SanDisk - failed to set I/O base 1 -" ··· 301 301 tuple.TupleData = buf; 302 302 tuple.TupleDataMax = sizeof(buf); 303 303 tuple.TupleOffset = 0; 304 - if (pcmcia_get_first_tuple(hw_priv->link->handle, &tuple) || 305 - pcmcia_get_tuple_data(hw_priv->link->handle, &tuple) || 306 - pcmcia_parse_tuple(hw_priv->link->handle, &tuple, parse) || 304 + if (pcmcia_get_first_tuple(hw_priv->link, &tuple) || 305 + pcmcia_get_tuple_data(hw_priv->link, &tuple) || 306 + pcmcia_parse_tuple(hw_priv->link, &tuple, parse) || 307 307 parse->manfid.manf != 0xd601 || parse->manfid.card != 0x0101) { 308 308 /* No SanDisk manfid found */ 309 309 ret = -ENODEV; ··· 311 311 } 312 312 313 313 tuple.DesiredTuple = CISTPL_LONGLINK_MFC; 314 - if (pcmcia_get_first_tuple(hw_priv->link->handle, &tuple) || 315 - pcmcia_get_tuple_data(hw_priv->link->handle, &tuple) || 316 - pcmcia_parse_tuple(hw_priv->link->handle, &tuple, parse) || 314 + if (pcmcia_get_first_tuple(hw_priv->link, &tuple) || 315 + pcmcia_get_tuple_data(hw_priv->link, &tuple) || 316 + pcmcia_parse_tuple(hw_priv->link, &tuple, parse) || 317 317 parse->longlink_mfc.nfn < 2) { 318 318 /* No multi-function links found */ 319 319 ret = -ENODEV; ··· 328 328 reg.Action = CS_WRITE; 329 329 reg.Offset = CISREG_COR; 330 330 reg.Value = COR_SOFT_RESET; 331 - res = pcmcia_access_configuration_register(hw_priv->link->handle, 331 + res = pcmcia_access_configuration_register(hw_priv->link, 332 332 &reg); 333 333 if (res != CS_SUCCESS) { 334 334 printk(KERN_DEBUG "%s: SanDisk - COR sreset failed (%d)\n", ··· 345 345 * will be enabled during the first cor_sreset call. 346 346 */ 347 347 reg.Value = COR_LEVEL_REQ | 0x8 | COR_ADDR_DECODE | COR_FUNC_ENA; 348 - res = pcmcia_access_configuration_register(hw_priv->link->handle, 348 + res = pcmcia_access_configuration_register(hw_priv->link, 349 349 &reg); 350 350 if (res != CS_SUCCESS) { 351 351 printk(KERN_DEBUG "%s: SanDisk - COR sreset failed (%d)\n", ··· 380 380 reg.Action = CS_READ; 381 381 reg.Offset = CISREG_COR; 382 382 reg.Value = 0; 383 - res = pcmcia_access_configuration_register(hw_priv->link->handle, 383 + res = pcmcia_access_configuration_register(hw_priv->link, 384 384 &reg); 385 385 if (res != CS_SUCCESS) { 386 386 printk(KERN_DEBUG "prism2_pccard_cor_sreset failed 1 (%d)\n", ··· 392 392 393 393 reg.Action = CS_WRITE; 394 394 reg.Value |= COR_SOFT_RESET; 395 - res = pcmcia_access_configuration_register(hw_priv->link->handle, 395 + res = pcmcia_access_configuration_register(hw_priv->link, 396 396 &reg); 397 397 if (res != CS_SUCCESS) { 398 398 printk(KERN_DEBUG "prism2_pccard_cor_sreset failed 2 (%d)\n", ··· 405 405 reg.Value &= ~COR_SOFT_RESET; 406 406 if (hw_priv->sandisk_connectplus) 407 407 reg.Value |= COR_IREQ_ENA; 408 - res = pcmcia_access_configuration_register(hw_priv->link->handle, 408 + res = pcmcia_access_configuration_register(hw_priv->link, 409 409 &reg); 410 410 if (res != CS_SUCCESS) { 411 411 printk(KERN_DEBUG "prism2_pccard_cor_sreset failed 3 (%d)\n", ··· 439 439 reg.Action = CS_READ; 440 440 reg.Offset = CISREG_COR; 441 441 reg.Value = 0; 442 - res = pcmcia_access_configuration_register(hw_priv->link->handle, 442 + res = pcmcia_access_configuration_register(hw_priv->link, 443 443 &reg); 444 444 if (res != CS_SUCCESS) { 445 445 printk(KERN_DEBUG "prism2_pccard_genesis_sreset failed 1 " ··· 452 452 453 453 reg.Action = CS_WRITE; 454 454 reg.Value |= COR_SOFT_RESET; 455 - res = pcmcia_access_configuration_register(hw_priv->link->handle, 455 + res = pcmcia_access_configuration_register(hw_priv->link, 456 456 &reg); 457 457 if (res != CS_SUCCESS) { 458 458 printk(KERN_DEBUG "prism2_pccard_genesis_sreset failed 2 " ··· 466 466 reg.Action = CS_WRITE; 467 467 reg.Value = hcr; 468 468 reg.Offset = CISREG_CCSR; 469 - res = pcmcia_access_configuration_register(hw_priv->link->handle, 469 + res = pcmcia_access_configuration_register(hw_priv->link, 470 470 &reg); 471 471 if (res != CS_SUCCESS) { 472 472 printk(KERN_DEBUG "prism2_pccard_genesis_sreset failed 3 " ··· 478 478 reg.Action = CS_WRITE; 479 479 reg.Offset = CISREG_COR; 480 480 reg.Value = old_cor & ~COR_SOFT_RESET; 481 - res = pcmcia_access_configuration_register(hw_priv->link->handle, 481 + res = pcmcia_access_configuration_register(hw_priv->link, 482 482 &reg); 483 483 if (res != CS_SUCCESS) { 484 484 printk(KERN_DEBUG "prism2_pccard_genesis_sreset failed 4 " ··· 514 514 } 515 515 516 516 517 - static void prism2_detach(struct pcmcia_device *p_dev) 517 + static void prism2_detach(struct pcmcia_device *link) 518 518 { 519 - dev_link_t *link = dev_to_instance(p_dev); 520 - 521 519 PDEBUG(DEBUG_FLOW, "prism2_detach\n"); 522 520 523 521 if (link->state & DEV_CONFIG) { ··· 543 545 do { int ret = (retf); \ 544 546 if (ret != 0) { \ 545 547 PDEBUG(DEBUG_EXTRA, "CardServices(" #fn ") returned %d\n", ret); \ 546 - cs_error(link->handle, fn, ret); \ 548 + cs_error(link, fn, ret); \ 547 549 goto next_entry; \ 548 550 } \ 549 551 } while (0) ··· 551 553 552 554 /* run after a CARD_INSERTION event is received to configure the PCMCIA 553 555 * socket and make the device available to the system */ 554 - static int prism2_config(dev_link_t *link) 556 + static int prism2_config(struct pcmcia_device *link) 555 557 { 556 558 struct net_device *dev; 557 559 struct hostap_interface *iface; ··· 580 582 tuple.TupleData = buf; 581 583 tuple.TupleDataMax = sizeof(buf); 582 584 tuple.TupleOffset = 0; 583 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link->handle, &tuple)); 584 - CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link->handle, &tuple)); 585 - CS_CHECK(ParseTuple, pcmcia_parse_tuple(link->handle, &tuple, parse)); 585 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 586 + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 587 + CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, parse)); 586 588 link->conf.ConfigBase = parse->config.base; 587 589 link->conf.Present = parse->config.rmask[0]; 588 590 589 591 CS_CHECK(GetConfigurationInfo, 590 - pcmcia_get_configuration_info(link->handle, &conf)); 592 + pcmcia_get_configuration_info(link, &conf)); 591 593 592 594 /* Look for an appropriate configuration table entry in the CIS */ 593 595 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 594 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link->handle, &tuple)); 596 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 595 597 for (;;) { 596 598 cistpl_cftable_entry_t *cfg = &(parse->cftable_entry); 597 599 CFG_CHECK2(GetTupleData, 598 - pcmcia_get_tuple_data(link->handle, &tuple)); 600 + pcmcia_get_tuple_data(link, &tuple)); 599 601 CFG_CHECK2(ParseTuple, 600 - pcmcia_parse_tuple(link->handle, &tuple, parse)); 602 + pcmcia_parse_tuple(link, &tuple, parse)); 601 603 602 604 if (cfg->flags & CISTPL_CFTABLE_DEFAULT) 603 605 dflt = *cfg; ··· 677 679 678 680 /* This reserves IO space but doesn't actually enable it */ 679 681 CFG_CHECK2(RequestIO, 680 - pcmcia_request_io(link->handle, &link->io)); 682 + pcmcia_request_io(link, &link->io)); 681 683 682 684 /* This configuration table entry is OK */ 683 685 break; 684 686 685 687 next_entry: 686 688 CS_CHECK(GetNextTuple, 687 - pcmcia_get_next_tuple(link->handle, &tuple)); 689 + pcmcia_get_next_tuple(link, &tuple)); 688 690 } 689 691 690 692 /* Need to allocate net_device before requesting IRQ handler */ 691 693 dev = prism2_init_local_data(&prism2_pccard_funcs, 0, 692 - &handle_to_dev(link->handle)); 694 + &handle_to_dev(link)); 693 695 if (dev == NULL) 694 696 goto failed; 695 697 link->priv = dev; ··· 712 714 link->irq.Handler = prism2_interrupt; 713 715 link->irq.Instance = dev; 714 716 CS_CHECK(RequestIRQ, 715 - pcmcia_request_irq(link->handle, &link->irq)); 717 + pcmcia_request_irq(link, &link->irq)); 716 718 } 717 719 718 720 /* ··· 721 723 * card and host interface into "Memory and IO" mode. 722 724 */ 723 725 CS_CHECK(RequestConfiguration, 724 - pcmcia_request_configuration(link->handle, &link->conf)); 726 + pcmcia_request_configuration(link, &link->conf)); 725 727 726 728 dev->irq = link->irq.AssignedIRQ; 727 729 dev->base_addr = link->io.BasePort1; ··· 759 761 return ret; 760 762 761 763 cs_failed: 762 - cs_error(link->handle, last_fn, last_ret); 764 + cs_error(link, last_fn, last_ret); 763 765 764 766 failed: 765 767 kfree(parse); ··· 771 773 772 774 static void prism2_release(u_long arg) 773 775 { 774 - dev_link_t *link = (dev_link_t *)arg; 776 + struct pcmcia_device *link = (struct pcmcia_device *)arg; 775 777 776 778 PDEBUG(DEBUG_FLOW, "prism2_release\n"); 777 779 ··· 785 787 iface->local->shutdown = 1; 786 788 } 787 789 788 - pcmcia_disable_device(link->handle); 790 + pcmcia_disable_device(link); 789 791 PDEBUG(DEBUG_FLOW, "release - done\n"); 790 792 } 791 793 792 - static int hostap_cs_suspend(struct pcmcia_device *p_dev) 794 + static int hostap_cs_suspend(struct pcmcia_device *link) 793 795 { 794 - dev_link_t *link = dev_to_instance(p_dev); 795 796 struct net_device *dev = (struct net_device *) link->priv; 796 797 int dev_open = 0; 797 798 ··· 810 813 return 0; 811 814 } 812 815 813 - static int hostap_cs_resume(struct pcmcia_device *p_dev) 816 + static int hostap_cs_resume(struct pcmcia_device *link) 814 817 { 815 - dev_link_t *link = dev_to_instance(p_dev); 816 818 struct net_device *dev = (struct net_device *) link->priv; 817 819 int dev_open = 0; 818 820
+28 -33
drivers/net/wireless/netwave_cs.c
··· 190 190 /*====================================================================*/ 191 191 192 192 /* PCMCIA (Card Services) related functions */ 193 - static void netwave_release(dev_link_t *link); /* Card removal */ 194 - static void netwave_pcmcia_config(dev_link_t *arg); /* Runs after card 193 + static void netwave_release(struct pcmcia_device *link); /* Card removal */ 194 + static void netwave_pcmcia_config(struct pcmcia_device *arg); /* Runs after card 195 195 insertion */ 196 196 static void netwave_detach(struct pcmcia_device *p_dev); /* Destroy instance */ 197 197 ··· 221 221 static void set_multicast_list(struct net_device *dev); 222 222 223 223 /* 224 - A dev_link_t structure has fields for most things that are needed 224 + A struct pcmcia_device structure has fields for most things that are needed 225 225 to keep track of a socket, but there will usually be some device 226 226 specific information that also needs to be kept track of. The 227 - 'priv' pointer in a dev_link_t structure can be used to point to 227 + 'priv' pointer in a struct pcmcia_device structure can be used to point to 228 228 a device-specific private data structure, like this. 229 229 230 230 A driver needs to provide a dev_node_t structure for each device ··· 232 232 example, ethernet cards, modems). In other cases, there may be 233 233 many actual or logical devices (SCSI adapters, memory cards with 234 234 multiple partitions). The dev_node_t structures need to be kept 235 - in a linked list starting at the 'dev' field of a dev_link_t 235 + in a linked list starting at the 'dev' field of a struct pcmcia_device 236 236 structure. We allocate them in the card's private data structure, 237 237 because they generally can't be allocated dynamically. 238 238 */ ··· 376 376 * configure the card at this point -- we wait until we receive a 377 377 * card insertion event. 378 378 */ 379 - static int netwave_attach(struct pcmcia_device *p_dev) 379 + static int netwave_attach(struct pcmcia_device *link) 380 380 { 381 381 struct net_device *dev; 382 382 netwave_private *priv; 383 - dev_link_t *link = dev_to_instance(p_dev); 384 383 385 384 DEBUG(0, "netwave_attach()\n"); 386 385 387 - /* Initialize the dev_link_t structure */ 386 + /* Initialize the struct pcmcia_device structure */ 388 387 dev = alloc_etherdev(sizeof(netwave_private)); 389 388 if (!dev) 390 389 return -ENOMEM; 391 390 priv = netdev_priv(dev); 392 - priv->p_dev = p_dev; 391 + priv->p_dev = link; 393 392 link->priv = dev; 394 393 395 394 /* The io structure describes IO port mapping */ ··· 442 443 * structures are freed. Otherwise, the structures will be freed 443 444 * when the device is released. 444 445 */ 445 - static void netwave_detach(struct pcmcia_device *p_dev) 446 + static void netwave_detach(struct pcmcia_device *link) 446 447 { 447 - dev_link_t *link = dev_to_instance(p_dev); 448 448 struct net_device *dev = link->priv; 449 449 450 450 DEBUG(0, "netwave_detach(0x%p)\n", link); ··· 737 739 #define CS_CHECK(fn, ret) \ 738 740 do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 739 741 740 - static void netwave_pcmcia_config(dev_link_t *link) { 741 - client_handle_t handle = link->handle; 742 + static void netwave_pcmcia_config(struct pcmcia_device *link) { 742 743 struct net_device *dev = link->priv; 743 744 netwave_private *priv = netdev_priv(dev); 744 745 tuple_t tuple; ··· 759 762 tuple.TupleDataMax = 64; 760 763 tuple.TupleOffset = 0; 761 764 tuple.DesiredTuple = CISTPL_CONFIG; 762 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 763 - CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 764 - CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse)); 765 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 766 + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 767 + CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); 765 768 link->conf.ConfigBase = parse.config.base; 766 769 link->conf.Present = parse.config.rmask[0]; 767 770 ··· 775 778 */ 776 779 for (i = j = 0x0; j < 0x400; j += 0x20) { 777 780 link->io.BasePort1 = j ^ 0x300; 778 - i = pcmcia_request_io(link->handle, &link->io); 781 + i = pcmcia_request_io(link, &link->io); 779 782 if (i == CS_SUCCESS) break; 780 783 } 781 784 if (i != CS_SUCCESS) { 782 - cs_error(link->handle, RequestIO, i); 785 + cs_error(link, RequestIO, i); 783 786 goto failed; 784 787 } 785 788 ··· 787 790 * Now allocate an interrupt line. Note that this does not 788 791 * actually assign a handler to the interrupt. 789 792 */ 790 - CS_CHECK(RequestIRQ, pcmcia_request_irq(handle, &link->irq)); 793 + CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 791 794 792 795 /* 793 796 * This actually configures the PCMCIA socket -- setting up 794 797 * the I/O windows and the interrupt mapping. 795 798 */ 796 - CS_CHECK(RequestConfiguration, pcmcia_request_configuration(handle, &link->conf)); 799 + CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 797 800 798 801 /* 799 - * Allocate a 32K memory window. Note that the dev_link_t 802 + * Allocate a 32K memory window. Note that the struct pcmcia_device 800 803 * structure provides space for one window handle -- if your 801 804 * device needs several windows, you'll need to keep track of 802 805 * the handles in your private data structure, dev->priv. ··· 806 809 req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_CM|WIN_ENABLE; 807 810 req.Base = 0; req.Size = 0x8000; 808 811 req.AccessSpeed = mem_speed; 809 - CS_CHECK(RequestWindow, pcmcia_request_window(&link->handle, &req, &link->win)); 812 + CS_CHECK(RequestWindow, pcmcia_request_window(&link, &req, &link->win)); 810 813 mem.CardOffset = 0x20000; mem.Page = 0; 811 814 CS_CHECK(MapMemPage, pcmcia_map_mem_page(link->win, &mem)); 812 815 ··· 816 819 817 820 dev->irq = link->irq.AssignedIRQ; 818 821 dev->base_addr = link->io.BasePort1; 819 - SET_NETDEV_DEV(dev, &handle_to_dev(handle)); 822 + SET_NETDEV_DEV(dev, &handle_to_dev(link)); 820 823 821 824 if (register_netdev(dev) != 0) { 822 825 printk(KERN_DEBUG "netwave_cs: register_netdev() failed\n"); ··· 848 851 return; 849 852 850 853 cs_failed: 851 - cs_error(link->handle, last_fn, last_ret); 854 + cs_error(link, last_fn, last_ret); 852 855 failed: 853 856 netwave_release(link); 854 857 } /* netwave_pcmcia_config */ ··· 860 863 * device, and release the PCMCIA configuration. If the device is 861 864 * still open, this will be postponed until it is closed. 862 865 */ 863 - static void netwave_release(dev_link_t *link) 866 + static void netwave_release(struct pcmcia_device *link) 864 867 { 865 868 struct net_device *dev = link->priv; 866 869 netwave_private *priv = netdev_priv(dev); 867 870 868 871 DEBUG(0, "netwave_release(0x%p)\n", link); 869 872 870 - pcmcia_disable_device(link->handle); 873 + pcmcia_disable_device(link); 871 874 if (link->win) 872 875 iounmap(priv->ramBase); 873 876 } 874 877 875 - static int netwave_suspend(struct pcmcia_device *p_dev) 878 + static int netwave_suspend(struct pcmcia_device *link) 876 879 { 877 - dev_link_t *link = dev_to_instance(p_dev); 878 880 struct net_device *dev = link->priv; 879 881 880 882 if ((link->state & DEV_CONFIG) && (link->open)) ··· 882 886 return 0; 883 887 } 884 888 885 - static int netwave_resume(struct pcmcia_device *p_dev) 889 + static int netwave_resume(struct pcmcia_device *link) 886 890 { 887 - dev_link_t *link = dev_to_instance(p_dev); 888 891 struct net_device *dev = link->priv; 889 892 890 893 if ((link->state & DEV_CONFIG) && (link->open)) { ··· 1095 1100 u_char __iomem *ramBase; 1096 1101 struct net_device *dev = (struct net_device *)dev_id; 1097 1102 struct netwave_private *priv = netdev_priv(dev); 1098 - dev_link_t *link = priv->p_dev; 1103 + struct pcmcia_device *link = priv->p_dev; 1099 1104 int i; 1100 1105 1101 1106 if (!netif_device_present(dev)) ··· 1349 1354 1350 1355 static int netwave_open(struct net_device *dev) { 1351 1356 netwave_private *priv = netdev_priv(dev); 1352 - dev_link_t *link = priv->p_dev; 1357 + struct pcmcia_device *link = priv->p_dev; 1353 1358 1354 1359 DEBUG(1, "netwave_open: starting.\n"); 1355 1360 ··· 1366 1371 1367 1372 static int netwave_close(struct net_device *dev) { 1368 1373 netwave_private *priv = netdev_priv(dev); 1369 - dev_link_t *link = priv->p_dev; 1374 + struct pcmcia_device *link = priv->p_dev; 1370 1375 1371 1376 DEBUG(1, "netwave_close: finishing.\n"); 1372 1377
+27 -32
drivers/net/wireless/orinoco_cs.c
··· 63 63 /* Function prototypes */ 64 64 /********************************************************************/ 65 65 66 - static void orinoco_cs_config(dev_link_t *link); 67 - static void orinoco_cs_release(dev_link_t *link); 66 + static void orinoco_cs_config(struct pcmcia_device *link); 67 + static void orinoco_cs_release(struct pcmcia_device *link); 68 68 static void orinoco_cs_detach(struct pcmcia_device *p_dev); 69 69 70 70 /********************************************************************/ ··· 75 75 orinoco_cs_hard_reset(struct orinoco_private *priv) 76 76 { 77 77 struct orinoco_pccard *card = priv->card; 78 - dev_link_t *link = card->p_dev; 78 + struct pcmcia_device *link = card->p_dev; 79 79 int err; 80 80 81 81 /* We need atomic ops here, because we're not holding the lock */ 82 82 set_bit(0, &card->hard_reset_in_progress); 83 83 84 - err = pcmcia_reset_card(link->handle, NULL); 84 + err = pcmcia_reset_card(link, NULL); 85 85 if (err) 86 86 return err; 87 87 ··· 104 104 * configure the card at this point -- we wait until we receive a card 105 105 * insertion event. */ 106 106 static int 107 - orinoco_cs_attach(struct pcmcia_device *p_dev) 107 + orinoco_cs_attach(struct pcmcia_device *link) 108 108 { 109 109 struct net_device *dev; 110 110 struct orinoco_private *priv; 111 111 struct orinoco_pccard *card; 112 - dev_link_t *link = dev_to_instance(p_dev); 113 112 114 113 dev = alloc_orinocodev(sizeof(*card), orinoco_cs_hard_reset); 115 114 if (! dev) ··· 117 118 card = priv->card; 118 119 119 120 /* Link both structures together */ 120 - card->p_dev = p_dev; 121 + card->p_dev = link; 121 122 link->priv = dev; 122 123 123 124 /* Interrupt setup */ ··· 146 147 * are freed. Otherwise, the structures will be freed when the device 147 148 * is released. 148 149 */ 149 - static void orinoco_cs_detach(struct pcmcia_device *p_dev) 150 + static void orinoco_cs_detach(struct pcmcia_device *link) 150 151 { 151 - dev_link_t *link = dev_to_instance(p_dev); 152 152 struct net_device *dev = link->priv; 153 153 154 154 if (link->state & DEV_CONFIG) ··· 173 175 } while (0) 174 176 175 177 static void 176 - orinoco_cs_config(dev_link_t *link) 178 + orinoco_cs_config(struct pcmcia_device *link) 177 179 { 178 180 struct net_device *dev = link->priv; 179 - client_handle_t handle = link->handle; 180 181 struct orinoco_private *priv = netdev_priv(dev); 181 182 struct orinoco_pccard *card = priv->card; 182 183 hermes_t *hw = &priv->hw; ··· 187 190 cisparse_t parse; 188 191 void __iomem *mem; 189 192 190 - CS_CHECK(ValidateCIS, pcmcia_validate_cis(handle, &info)); 193 + CS_CHECK(ValidateCIS, pcmcia_validate_cis(link, &info)); 191 194 192 195 /* 193 196 * This reads the card's CONFIG tuple to find its ··· 198 201 tuple.TupleData = buf; 199 202 tuple.TupleDataMax = sizeof(buf); 200 203 tuple.TupleOffset = 0; 201 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 202 - CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 203 - CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse)); 204 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 205 + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 206 + CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); 204 207 link->conf.ConfigBase = parse.config.base; 205 208 link->conf.Present = parse.config.rmask[0]; 206 209 ··· 209 212 210 213 /* Look up the current Vcc */ 211 214 CS_CHECK(GetConfigurationInfo, 212 - pcmcia_get_configuration_info(link->handle, &conf)); 215 + pcmcia_get_configuration_info(link, &conf)); 213 216 214 217 /* 215 218 * In this loop, we scan the CIS for configuration table ··· 226 229 * implementation-defined details. 227 230 */ 228 231 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 229 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 232 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 230 233 while (1) { 231 234 cistpl_cftable_entry_t *cfg = &(parse.cftable_entry); 232 235 cistpl_cftable_entry_t dflt = { .index = 0 }; 233 236 234 - if ( (pcmcia_get_tuple_data(handle, &tuple) != 0) 235 - || (pcmcia_parse_tuple(handle, &tuple, &parse) != 0)) 237 + if ( (pcmcia_get_tuple_data(link, &tuple) != 0) 238 + || (pcmcia_parse_tuple(link, &tuple, &parse) != 0)) 236 239 goto next_entry; 237 240 238 241 if (cfg->flags & CISTPL_CFTABLE_DEFAULT) ··· 297 300 } 298 301 299 302 /* This reserves IO space but doesn't actually enable it */ 300 - if (pcmcia_request_io(link->handle, &link->io) != 0) 303 + if (pcmcia_request_io(link, &link->io) != 0) 301 304 goto next_entry; 302 305 } 303 306 ··· 307 310 break; 308 311 309 312 next_entry: 310 - pcmcia_disable_device(handle); 311 - last_ret = pcmcia_get_next_tuple(handle, &tuple); 313 + pcmcia_disable_device(link); 314 + last_ret = pcmcia_get_next_tuple(link, &tuple); 312 315 if (last_ret == CS_NO_MORE_ITEMS) { 313 316 printk(KERN_ERR PFX "GetNextTuple(): No matching " 314 317 "CIS configuration. Maybe you need the " ··· 322 325 * a handler to the interrupt, unless the 'Handler' member of 323 326 * the irq structure is initialized. 324 327 */ 325 - CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq)); 328 + CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 326 329 327 330 /* We initialize the hermes structure before completing PCMCIA 328 331 * configuration just in case the interrupt handler gets ··· 339 342 * card and host interface into "Memory and IO" mode. 340 343 */ 341 344 CS_CHECK(RequestConfiguration, 342 - pcmcia_request_configuration(link->handle, &link->conf)); 345 + pcmcia_request_configuration(link, &link->conf)); 343 346 344 347 /* Ok, we have the configuration, prepare to register the netdev */ 345 348 dev->base_addr = link->io.BasePort1; ··· 347 350 SET_MODULE_OWNER(dev); 348 351 card->node.major = card->node.minor = 0; 349 352 350 - SET_NETDEV_DEV(dev, &handle_to_dev(handle)); 353 + SET_NETDEV_DEV(dev, &handle_to_dev(link)); 351 354 /* Tell the stack we exist */ 352 355 if (register_netdev(dev) != 0) { 353 356 printk(KERN_ERR PFX "register_netdev() failed\n"); ··· 380 383 return; 381 384 382 385 cs_failed: 383 - cs_error(link->handle, last_fn, last_ret); 386 + cs_error(link, last_fn, last_ret); 384 387 385 388 failed: 386 389 orinoco_cs_release(link); ··· 392 395 * still open, this will be postponed until it is closed. 393 396 */ 394 397 static void 395 - orinoco_cs_release(dev_link_t *link) 398 + orinoco_cs_release(struct pcmcia_device *link) 396 399 { 397 400 struct net_device *dev = link->priv; 398 401 struct orinoco_private *priv = netdev_priv(dev); ··· 404 407 priv->hw_unavailable++; 405 408 spin_unlock_irqrestore(&priv->lock, flags); 406 409 407 - pcmcia_disable_device(link->handle); 410 + pcmcia_disable_device(link); 408 411 if (priv->hw.iobase) 409 412 ioport_unmap(priv->hw.iobase); 410 413 } /* orinoco_cs_release */ 411 414 412 - static int orinoco_cs_suspend(struct pcmcia_device *p_dev) 415 + static int orinoco_cs_suspend(struct pcmcia_device *link) 413 416 { 414 - dev_link_t *link = dev_to_instance(p_dev); 415 417 struct net_device *dev = link->priv; 416 418 struct orinoco_private *priv = netdev_priv(dev); 417 419 struct orinoco_pccard *card = priv->card; ··· 439 443 return 0; 440 444 } 441 445 442 - static int orinoco_cs_resume(struct pcmcia_device *p_dev) 446 + static int orinoco_cs_resume(struct pcmcia_device *link) 443 447 { 444 - dev_link_t *link = dev_to_instance(p_dev); 445 448 struct net_device *dev = link->priv; 446 449 struct orinoco_private *priv = netdev_priv(dev); 447 450 struct orinoco_pccard *card = priv->card;
+44 -48
drivers/net/wireless/ray_cs.c
··· 90 90 #define DEBUG(n, args...) 91 91 #endif 92 92 /** Prototypes based on PCMCIA skeleton driver *******************************/ 93 - static void ray_config(dev_link_t *link); 94 - static void ray_release(dev_link_t *link); 93 + static void ray_config(struct pcmcia_device *link); 94 + static void ray_release(struct pcmcia_device *link); 95 95 static void ray_detach(struct pcmcia_device *p_dev); 96 96 97 97 /***** Prototypes indicated by device structure ******************************/ ··· 190 190 static char *phy_addr = NULL; 191 191 192 192 193 - /* A dev_link_t structure has fields for most things that are needed 193 + /* A struct pcmcia_device structure has fields for most things that are needed 194 194 to keep track of a socket, but there will usually be some device 195 195 specific information that also needs to be kept track of. The 196 - 'priv' pointer in a dev_link_t structure can be used to point to 196 + 'priv' pointer in a struct pcmcia_device structure can be used to point to 197 197 a device-specific private data structure, like this. 198 198 */ 199 199 static unsigned int ray_mem_speed = 500; ··· 381 381 structures are freed. Otherwise, the structures will be freed 382 382 when the device is released. 383 383 =============================================================================*/ 384 - static void ray_detach(struct pcmcia_device *p_dev) 384 + static void ray_detach(struct pcmcia_device *link) 385 385 { 386 - dev_link_t *link = dev_to_instance(p_dev); 387 386 struct net_device *dev; 388 387 ray_dev_t *local; 389 388 ··· 412 413 #define CS_CHECK(fn, ret) \ 413 414 do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 414 415 #define MAX_TUPLE_SIZE 128 415 - static void ray_config(dev_link_t *link) 416 + static void ray_config(struct pcmcia_device *link) 416 417 { 417 - client_handle_t handle = link->handle; 418 418 tuple_t tuple; 419 419 cisparse_t parse; 420 420 int last_fn = 0, last_ret = 0; ··· 428 430 429 431 /* This reads the card's CONFIG tuple to find its configuration regs */ 430 432 tuple.DesiredTuple = CISTPL_CONFIG; 431 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 433 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 432 434 tuple.TupleData = buf; 433 435 tuple.TupleDataMax = MAX_TUPLE_SIZE; 434 436 tuple.TupleOffset = 0; 435 - CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 436 - CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse)); 437 + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 438 + CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); 437 439 link->conf.ConfigBase = parse.config.base; 438 440 link->conf.Present = parse.config.rmask[0]; 439 441 440 442 /* Determine card type and firmware version */ 441 443 buf[0] = buf[MAX_TUPLE_SIZE - 1] = 0; 442 444 tuple.DesiredTuple = CISTPL_VERS_1; 443 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 445 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 444 446 tuple.TupleData = buf; 445 447 tuple.TupleDataMax = MAX_TUPLE_SIZE; 446 448 tuple.TupleOffset = 2; 447 - CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 449 + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 448 450 449 451 for (i=0; i<tuple.TupleDataLen - 4; i++) 450 452 if (buf[i] == 0) buf[i] = ' '; ··· 456 458 /* Now allocate an interrupt line. Note that this does not 457 459 actually assign a handler to the interrupt. 458 460 */ 459 - CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq)); 461 + CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 460 462 dev->irq = link->irq.AssignedIRQ; 461 463 462 464 /* This actually configures the PCMCIA socket -- setting up 463 465 the I/O windows and the interrupt mapping. 464 466 */ 465 - CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf)); 467 + CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 466 468 467 469 /*** Set up 32k window for shared memory (transmit and control) ************/ 468 470 req.Attributes = WIN_DATA_WIDTH_8 | WIN_MEMORY_TYPE_CM | WIN_ENABLE | WIN_USE_WAIT; 469 471 req.Base = 0; 470 472 req.Size = 0x8000; 471 473 req.AccessSpeed = ray_mem_speed; 472 - CS_CHECK(RequestWindow, pcmcia_request_window(&link->handle, &req, &link->win)); 474 + CS_CHECK(RequestWindow, pcmcia_request_window(&link, &req, &link->win)); 473 475 mem.CardOffset = 0x0000; mem.Page = 0; 474 476 CS_CHECK(MapMemPage, pcmcia_map_mem_page(link->win, &mem)); 475 477 local->sram = ioremap(req.Base,req.Size); ··· 479 481 req.Base = 0; 480 482 req.Size = 0x4000; 481 483 req.AccessSpeed = ray_mem_speed; 482 - CS_CHECK(RequestWindow, pcmcia_request_window(&link->handle, &req, &local->rmem_handle)); 484 + CS_CHECK(RequestWindow, pcmcia_request_window(&link, &req, &local->rmem_handle)); 483 485 mem.CardOffset = 0x8000; mem.Page = 0; 484 486 CS_CHECK(MapMemPage, pcmcia_map_mem_page(local->rmem_handle, &mem)); 485 487 local->rmem = ioremap(req.Base,req.Size); ··· 489 491 req.Base = 0; 490 492 req.Size = 0x1000; 491 493 req.AccessSpeed = ray_mem_speed; 492 - CS_CHECK(RequestWindow, pcmcia_request_window(&link->handle, &req, &local->amem_handle)); 494 + CS_CHECK(RequestWindow, pcmcia_request_window(&link, &req, &local->amem_handle)); 493 495 mem.CardOffset = 0x0000; mem.Page = 0; 494 496 CS_CHECK(MapMemPage, pcmcia_map_mem_page(local->amem_handle, &mem)); 495 497 local->amem = ioremap(req.Base,req.Size); ··· 502 504 return; 503 505 } 504 506 505 - SET_NETDEV_DEV(dev, &handle_to_dev(handle)); 507 + SET_NETDEV_DEV(dev, &handle_to_dev(link)); 506 508 i = register_netdev(dev); 507 509 if (i != 0) { 508 510 printk("ray_config register_netdev() failed\n"); ··· 522 524 return; 523 525 524 526 cs_failed: 525 - cs_error(link->handle, last_fn, last_ret); 527 + cs_error(link, last_fn, last_ret); 526 528 527 529 ray_release(link); 528 530 } /* ray_config */ ··· 551 553 UCHAR *p; 552 554 struct ccs __iomem *pccs; 553 555 ray_dev_t *local = (ray_dev_t *)dev->priv; 554 - dev_link_t *link = local->finder; 556 + struct pcmcia_device *link = local->finder; 555 557 DEBUG(1, "ray_init(0x%p)\n", dev); 556 558 if (!(link->state & DEV_PRESENT)) { 557 559 DEBUG(0,"ray_init - device not present\n"); ··· 613 615 int ccsindex; 614 616 ray_dev_t *local = (ray_dev_t *)dev->priv; 615 617 struct ccs __iomem *pccs; 616 - dev_link_t *link = local->finder; 618 + struct pcmcia_device *link = local->finder; 617 619 618 620 DEBUG(1,"dl_startup_params entered\n"); 619 621 if (!(link->state & DEV_PRESENT)) { ··· 720 722 ray_dev_t *local = (ray_dev_t *)data; 721 723 struct ccs __iomem *pccs = ccs_base(local) + local->dl_param_ccs; 722 724 UCHAR status; 723 - dev_link_t *link = local->finder; 725 + struct pcmcia_device *link = local->finder; 724 726 725 727 if (!(link->state & DEV_PRESENT)) { 726 728 DEBUG(2,"ray_cs verify_dl_startup - device not present\n"); ··· 760 762 ray_dev_t *local = (ray_dev_t *)data; 761 763 struct ccs __iomem *pccs; 762 764 int ccsindex; 763 - dev_link_t *link = local->finder; 765 + struct pcmcia_device *link = local->finder; 764 766 if (!(link->state & DEV_PRESENT)) { 765 767 DEBUG(2,"ray_cs start_net - device not present\n"); 766 768 return; ··· 787 789 788 790 struct ccs __iomem *pccs; 789 791 int ccsindex; 790 - dev_link_t *link = local->finder; 792 + struct pcmcia_device *link = local->finder; 791 793 792 794 if (!(link->state & DEV_PRESENT)) { 793 795 DEBUG(2,"ray_cs join_net - device not present\n"); ··· 813 815 device, and release the PCMCIA configuration. If the device is 814 816 still open, this will be postponed until it is closed. 815 817 =============================================================================*/ 816 - static void ray_release(dev_link_t *link) 818 + static void ray_release(struct pcmcia_device *link) 817 819 { 818 820 struct net_device *dev = link->priv; 819 821 ray_dev_t *local = dev->priv; ··· 831 833 if ( i != CS_SUCCESS ) DEBUG(0,"ReleaseWindow(local->amem) ret = %x\n",i); 832 834 i = pcmcia_release_window(local->rmem_handle); 833 835 if ( i != CS_SUCCESS ) DEBUG(0,"ReleaseWindow(local->rmem) ret = %x\n",i); 834 - pcmcia_disable_device(link->handle); 836 + pcmcia_disable_device(link); 835 837 836 838 DEBUG(2,"ray_release ending\n"); 837 839 } 838 840 839 - static int ray_suspend(struct pcmcia_device *p_dev) 841 + static int ray_suspend(struct pcmcia_device *link) 840 842 { 841 - dev_link_t *link = dev_to_instance(p_dev); 842 843 struct net_device *dev = link->priv; 843 844 844 845 if ((link->state & DEV_CONFIG) && (link->open)) ··· 846 849 return 0; 847 850 } 848 851 849 - static int ray_resume(struct pcmcia_device *p_dev) 852 + static int ray_resume(struct pcmcia_device *link) 850 853 { 851 - dev_link_t *link = dev_to_instance(p_dev); 852 854 struct net_device *dev = link->priv; 853 855 854 856 if ((link->state & DEV_CONFIG) && (link->open)) { ··· 865 869 int i; 866 870 #endif /* RAY_IMMEDIATE_INIT */ 867 871 ray_dev_t *local = dev->priv; 868 - dev_link_t *link = local->finder; 872 + struct pcmcia_device *link = local->finder; 869 873 870 874 DEBUG(1,"ray_dev_init(dev=%p)\n",dev); 871 875 if (!(link->state & DEV_PRESENT)) { ··· 899 903 static int ray_dev_config(struct net_device *dev, struct ifmap *map) 900 904 { 901 905 ray_dev_t *local = dev->priv; 902 - dev_link_t *link = local->finder; 906 + struct pcmcia_device *link = local->finder; 903 907 /* Dummy routine to satisfy device structure */ 904 908 DEBUG(1,"ray_dev_config(dev=%p,ifmap=%p)\n",dev,map); 905 909 if (!(link->state & DEV_PRESENT)) { ··· 913 917 static int ray_dev_start_xmit(struct sk_buff *skb, struct net_device *dev) 914 918 { 915 919 ray_dev_t *local = dev->priv; 916 - dev_link_t *link = local->finder; 920 + struct pcmcia_device *link = local->finder; 917 921 short length = skb->len; 918 922 919 923 if (!(link->state & DEV_PRESENT)) { ··· 1525 1529 static iw_stats * ray_get_wireless_stats(struct net_device * dev) 1526 1530 { 1527 1531 ray_dev_t * local = (ray_dev_t *) dev->priv; 1528 - dev_link_t *link = local->finder; 1532 + struct pcmcia_device *link = local->finder; 1529 1533 struct status __iomem *p = local->sram + STATUS_BASE; 1530 1534 1531 1535 if(local == (ray_dev_t *) NULL) ··· 1613 1617 static int ray_open(struct net_device *dev) 1614 1618 { 1615 1619 ray_dev_t *local = (ray_dev_t *)dev->priv; 1616 - dev_link_t *link; 1620 + struct pcmcia_device *link; 1617 1621 link = local->finder; 1618 1622 1619 1623 DEBUG(1, "ray_open('%s')\n", dev->name); ··· 1647 1651 static int ray_dev_close(struct net_device *dev) 1648 1652 { 1649 1653 ray_dev_t *local = (ray_dev_t *)dev->priv; 1650 - dev_link_t *link; 1654 + struct pcmcia_device *link; 1651 1655 link = local->finder; 1652 1656 1653 1657 DEBUG(1, "ray_dev_close('%s')\n", dev->name); ··· 1673 1677 static int interrupt_ecf(ray_dev_t *local, int ccs) 1674 1678 { 1675 1679 int i = 50; 1676 - dev_link_t *link = local->finder; 1680 + struct pcmcia_device *link = local->finder; 1677 1681 1678 1682 if (!(link->state & DEV_PRESENT)) { 1679 1683 DEBUG(2,"ray_cs interrupt_ecf - device not present\n"); ··· 1700 1704 { 1701 1705 int i; 1702 1706 struct ccs __iomem *pccs = ccs_base(local); 1703 - dev_link_t *link = local->finder; 1707 + struct pcmcia_device *link = local->finder; 1704 1708 1705 1709 if (!(link->state & DEV_PRESENT)) { 1706 1710 DEBUG(2,"ray_cs get_free_tx_ccs - device not present\n"); ··· 1731 1735 { 1732 1736 int i; 1733 1737 struct ccs __iomem *pccs = ccs_base(local); 1734 - dev_link_t *link = local->finder; 1738 + struct pcmcia_device *link = local->finder; 1735 1739 1736 1740 if (!(link->state & DEV_PRESENT)) { 1737 1741 DEBUG(2,"ray_cs get_free_ccs - device not present\n"); ··· 1806 1810 static struct net_device_stats *ray_get_stats(struct net_device *dev) 1807 1811 { 1808 1812 ray_dev_t *local = (ray_dev_t *)dev->priv; 1809 - dev_link_t *link = local->finder; 1813 + struct pcmcia_device *link = local->finder; 1810 1814 struct status __iomem *p = local->sram + STATUS_BASE; 1811 1815 if (!(link->state & DEV_PRESENT)) { 1812 1816 DEBUG(2,"ray_cs net_device_stats - device not present\n"); ··· 1836 1840 static void ray_update_parm(struct net_device *dev, UCHAR objid, UCHAR *value, int len) 1837 1841 { 1838 1842 ray_dev_t *local = (ray_dev_t *)dev->priv; 1839 - dev_link_t *link = local->finder; 1843 + struct pcmcia_device *link = local->finder; 1840 1844 int ccsindex; 1841 1845 int i; 1842 1846 struct ccs __iomem *pccs; ··· 1873 1877 struct ccs __iomem *pccs; 1874 1878 int i = 0; 1875 1879 ray_dev_t *local = (ray_dev_t *)dev->priv; 1876 - dev_link_t *link = local->finder; 1880 + struct pcmcia_device *link = local->finder; 1877 1881 void __iomem *p = local->sram + HOST_TO_ECF_BASE; 1878 1882 1879 1883 if (!(link->state & DEV_PRESENT)) { ··· 1953 1957 static irqreturn_t ray_interrupt(int irq, void *dev_id, struct pt_regs * regs) 1954 1958 { 1955 1959 struct net_device *dev = (struct net_device *)dev_id; 1956 - dev_link_t *link; 1960 + struct pcmcia_device *link; 1957 1961 ray_dev_t *local; 1958 1962 struct ccs __iomem *pccs; 1959 1963 struct rcs __iomem *prcs; ··· 1968 1972 DEBUG(4,"ray_cs: interrupt for *dev=%p\n",dev); 1969 1973 1970 1974 local = (ray_dev_t *)dev->priv; 1971 - link = (dev_link_t *)local->finder; 1975 + link = (struct pcmcia_device *)local->finder; 1972 1976 if ( ! (link->state & DEV_PRESENT) || link->state & DEV_SUSPEND ) { 1973 1977 DEBUG(2,"ray_cs interrupt from device not present or suspended.\n"); 1974 1978 return IRQ_NONE; ··· 2488 2492 /*===========================================================================*/ 2489 2493 static void authenticate(ray_dev_t *local) 2490 2494 { 2491 - dev_link_t *link = local->finder; 2495 + struct pcmcia_device *link = local->finder; 2492 2496 DEBUG(0,"ray_cs Starting authentication.\n"); 2493 2497 if (!(link->state & DEV_PRESENT)) { 2494 2498 DEBUG(2,"ray_cs authenticate - device not present\n"); ··· 2554 2558 static void associate(ray_dev_t *local) 2555 2559 { 2556 2560 struct ccs __iomem *pccs; 2557 - dev_link_t *link = local->finder; 2561 + struct pcmcia_device *link = local->finder; 2558 2562 struct net_device *dev = link->priv; 2559 2563 int ccsindex; 2560 2564 if (!(link->state & DEV_PRESENT)) { ··· 2637 2641 * eg ifconfig 2638 2642 */ 2639 2643 int i; 2640 - dev_link_t *link; 2644 + struct pcmcia_device *link; 2641 2645 struct net_device *dev; 2642 2646 ray_dev_t *local; 2643 2647 UCHAR *p;
+1 -1
drivers/net/wireless/ray_cs.h
··· 31 31 void __iomem *sram; /* pointer to beginning of shared RAM */ 32 32 void __iomem *amem; /* pointer to attribute mem window */ 33 33 void __iomem *rmem; /* pointer to receive buffer window */ 34 - dev_link_t *finder; /* pointer back to dev_link_t for card */ 34 + struct pcmcia_device *finder; /* pointer back to struct pcmcia_device for card */ 35 35 struct timer_list timer; 36 36 long tx_ccs_lock; 37 37 long ccs_lock;
+37 -43
drivers/net/wireless/spectrum_cs.c
··· 71 71 /* Function prototypes */ 72 72 /********************************************************************/ 73 73 74 - static void spectrum_cs_config(dev_link_t *link); 75 - static void spectrum_cs_release(dev_link_t *link); 74 + static void spectrum_cs_config(struct pcmcia_device *link); 75 + static void spectrum_cs_release(struct pcmcia_device *link); 76 76 77 77 /********************************************************************/ 78 78 /* Firmware downloader */ ··· 238 238 * If IDLE is 1, stop the firmware, so that it can be safely rewritten. 239 239 */ 240 240 static int 241 - spectrum_reset(dev_link_t *link, int idle) 241 + spectrum_reset(struct pcmcia_device *link, int idle) 242 242 { 243 243 int last_ret, last_fn; 244 244 conf_reg_t reg; ··· 253 253 reg.Action = CS_READ; 254 254 reg.Offset = CISREG_COR; 255 255 CS_CHECK(AccessConfigurationRegister, 256 - pcmcia_access_configuration_register(link->handle, &reg)); 256 + pcmcia_access_configuration_register(link, &reg)); 257 257 save_cor = reg.Value; 258 258 259 259 /* Soft-Reset card */ ··· 261 261 reg.Offset = CISREG_COR; 262 262 reg.Value = (save_cor | COR_SOFT_RESET); 263 263 CS_CHECK(AccessConfigurationRegister, 264 - pcmcia_access_configuration_register(link->handle, &reg)); 264 + pcmcia_access_configuration_register(link, &reg)); 265 265 udelay(1000); 266 266 267 267 /* Read CCSR */ 268 268 reg.Action = CS_READ; 269 269 reg.Offset = CISREG_CCSR; 270 270 CS_CHECK(AccessConfigurationRegister, 271 - pcmcia_access_configuration_register(link->handle, &reg)); 271 + pcmcia_access_configuration_register(link, &reg)); 272 272 273 273 /* 274 274 * Start or stop the firmware. Memory width bit should be ··· 278 278 reg.Offset = CISREG_CCSR; 279 279 reg.Value = (idle ? HCR_IDLE : HCR_RUN) | (reg.Value & HCR_MEM16); 280 280 CS_CHECK(AccessConfigurationRegister, 281 - pcmcia_access_configuration_register(link->handle, &reg)); 281 + pcmcia_access_configuration_register(link, &reg)); 282 282 udelay(1000); 283 283 284 284 /* Restore original COR configuration index */ ··· 286 286 reg.Offset = CISREG_COR; 287 287 reg.Value = (save_cor & ~COR_SOFT_RESET); 288 288 CS_CHECK(AccessConfigurationRegister, 289 - pcmcia_access_configuration_register(link->handle, &reg)); 289 + pcmcia_access_configuration_register(link, &reg)); 290 290 udelay(1000); 291 291 return 0; 292 292 293 293 cs_failed: 294 - cs_error(link->handle, last_fn, last_ret); 294 + cs_error(link, last_fn, last_ret); 295 295 return -ENODEV; 296 296 } 297 297 ··· 441 441 * care of the PDA - read it and then write it on top of the firmware. 442 442 */ 443 443 static int 444 - spectrum_dl_image(hermes_t *hw, dev_link_t *link, 444 + spectrum_dl_image(hermes_t *hw, struct pcmcia_device *link, 445 445 const unsigned char *image) 446 446 { 447 447 int ret; ··· 505 505 * reset on the card, to make sure it's in a sane state. 506 506 */ 507 507 static int 508 - spectrum_dl_firmware(hermes_t *hw, dev_link_t *link) 508 + spectrum_dl_firmware(hermes_t *hw, struct pcmcia_device *link) 509 509 { 510 510 int ret; 511 - client_handle_t handle = link->handle; 512 511 const struct firmware *fw_entry; 513 512 514 513 if (request_firmware(&fw_entry, primary_fw_name, 515 - &handle_to_dev(handle)) == 0) { 514 + &handle_to_dev(link)) == 0) { 516 515 primsym = fw_entry->data; 517 516 } else { 518 517 printk(KERN_ERR PFX "Cannot find firmware: %s\n", ··· 520 521 } 521 522 522 523 if (request_firmware(&fw_entry, secondary_fw_name, 523 - &handle_to_dev(handle)) == 0) { 524 + &handle_to_dev(link)) == 0) { 524 525 secsym = fw_entry->data; 525 526 } else { 526 527 printk(KERN_ERR PFX "Cannot find firmware: %s\n", ··· 553 554 spectrum_cs_hard_reset(struct orinoco_private *priv) 554 555 { 555 556 struct orinoco_pccard *card = priv->card; 556 - dev_link_t *link = card->p_dev; 557 + struct pcmcia_device *link = card->p_dev; 557 558 int err; 558 559 559 560 if (!hermes_present(&priv->hw)) { ··· 583 584 * configure the card at this point -- we wait until we receive a card 584 585 * insertion event. */ 585 586 static int 586 - spectrum_cs_attach(struct pcmcia_device *p_dev) 587 + spectrum_cs_attach(struct pcmcia_device *link) 587 588 { 588 589 struct net_device *dev; 589 590 struct orinoco_private *priv; 590 591 struct orinoco_pccard *card; 591 - dev_link_t *link = dev_to_instance(p_dev); 592 592 593 593 dev = alloc_orinocodev(sizeof(*card), spectrum_cs_hard_reset); 594 594 if (! dev) ··· 596 598 card = priv->card; 597 599 598 600 /* Link both structures together */ 599 - card->p_dev = p_dev; 601 + card->p_dev = link; 600 602 link->priv = dev; 601 603 602 604 /* Interrupt setup */ ··· 625 627 * are freed. Otherwise, the structures will be freed when the device 626 628 * is released. 627 629 */ 628 - static void spectrum_cs_detach(struct pcmcia_device *p_dev) 630 + static void spectrum_cs_detach(struct pcmcia_device *link) 629 631 { 630 - dev_link_t *link = dev_to_instance(p_dev); 631 632 struct net_device *dev = link->priv; 632 633 633 634 if (link->state & DEV_CONFIG) ··· 648 651 */ 649 652 650 653 static void 651 - spectrum_cs_config(dev_link_t *link) 654 + spectrum_cs_config(struct pcmcia_device *link) 652 655 { 653 656 struct net_device *dev = link->priv; 654 - client_handle_t handle = link->handle; 655 657 struct orinoco_private *priv = netdev_priv(dev); 656 658 struct orinoco_pccard *card = priv->card; 657 659 hermes_t *hw = &priv->hw; ··· 662 666 cisparse_t parse; 663 667 void __iomem *mem; 664 668 665 - CS_CHECK(ValidateCIS, pcmcia_validate_cis(handle, &info)); 669 + CS_CHECK(ValidateCIS, pcmcia_validate_cis(link, &info)); 666 670 667 671 /* 668 672 * This reads the card's CONFIG tuple to find its ··· 673 677 tuple.TupleData = buf; 674 678 tuple.TupleDataMax = sizeof(buf); 675 679 tuple.TupleOffset = 0; 676 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 677 - CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 678 - CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse)); 680 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 681 + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 682 + CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); 679 683 link->conf.ConfigBase = parse.config.base; 680 684 link->conf.Present = parse.config.rmask[0]; 681 685 ··· 684 688 685 689 /* Look up the current Vcc */ 686 690 CS_CHECK(GetConfigurationInfo, 687 - pcmcia_get_configuration_info(handle, &conf)); 691 + pcmcia_get_configuration_info(link, &conf)); 688 692 689 693 /* 690 694 * In this loop, we scan the CIS for configuration table ··· 701 705 * implementation-defined details. 702 706 */ 703 707 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 704 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 708 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 705 709 while (1) { 706 710 cistpl_cftable_entry_t *cfg = &(parse.cftable_entry); 707 711 cistpl_cftable_entry_t dflt = { .index = 0 }; 708 712 709 - if ( (pcmcia_get_tuple_data(handle, &tuple) != 0) 710 - || (pcmcia_parse_tuple(handle, &tuple, &parse) != 0)) 713 + if ( (pcmcia_get_tuple_data(link, &tuple) != 0) 714 + || (pcmcia_parse_tuple(link, &tuple, &parse) != 0)) 711 715 goto next_entry; 712 716 713 717 if (cfg->flags & CISTPL_CFTABLE_DEFAULT) ··· 772 776 } 773 777 774 778 /* This reserves IO space but doesn't actually enable it */ 775 - if (pcmcia_request_io(link->handle, &link->io) != 0) 779 + if (pcmcia_request_io(link, &link->io) != 0) 776 780 goto next_entry; 777 781 } 778 782 ··· 782 786 break; 783 787 784 788 next_entry: 785 - pcmcia_disable_device(handle); 786 - last_ret = pcmcia_get_next_tuple(handle, &tuple); 789 + pcmcia_disable_device(link); 790 + last_ret = pcmcia_get_next_tuple(link, &tuple); 787 791 if (last_ret == CS_NO_MORE_ITEMS) { 788 792 printk(KERN_ERR PFX "GetNextTuple(): No matching " 789 793 "CIS configuration. Maybe you need the " ··· 797 801 * a handler to the interrupt, unless the 'Handler' member of 798 802 * the irq structure is initialized. 799 803 */ 800 - CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq)); 804 + CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 801 805 802 806 /* We initialize the hermes structure before completing PCMCIA 803 807 * configuration just in case the interrupt handler gets ··· 814 818 * card and host interface into "Memory and IO" mode. 815 819 */ 816 820 CS_CHECK(RequestConfiguration, 817 - pcmcia_request_configuration(link->handle, &link->conf)); 821 + pcmcia_request_configuration(link, &link->conf)); 818 822 819 823 /* Ok, we have the configuration, prepare to register the netdev */ 820 824 dev->base_addr = link->io.BasePort1; ··· 827 831 goto failed; 828 832 } 829 833 830 - SET_NETDEV_DEV(dev, &handle_to_dev(handle)); 834 + SET_NETDEV_DEV(dev, &handle_to_dev(link)); 831 835 /* Tell the stack we exist */ 832 836 if (register_netdev(dev) != 0) { 833 837 printk(KERN_ERR PFX "register_netdev() failed\n"); ··· 860 864 return; 861 865 862 866 cs_failed: 863 - cs_error(link->handle, last_fn, last_ret); 867 + cs_error(link, last_fn, last_ret); 864 868 865 869 failed: 866 870 spectrum_cs_release(link); ··· 872 876 * still open, this will be postponed until it is closed. 873 877 */ 874 878 static void 875 - spectrum_cs_release(dev_link_t *link) 879 + spectrum_cs_release(struct pcmcia_device *link) 876 880 { 877 881 struct net_device *dev = link->priv; 878 882 struct orinoco_private *priv = netdev_priv(dev); ··· 884 888 priv->hw_unavailable++; 885 889 spin_unlock_irqrestore(&priv->lock, flags); 886 890 887 - pcmcia_disable_device(link->handle); 891 + pcmcia_disable_device(link); 888 892 if (priv->hw.iobase) 889 893 ioport_unmap(priv->hw.iobase); 890 894 } /* spectrum_cs_release */ 891 895 892 896 893 897 static int 894 - spectrum_cs_suspend(struct pcmcia_device *p_dev) 898 + spectrum_cs_suspend(struct pcmcia_device *link) 895 899 { 896 - dev_link_t *link = dev_to_instance(p_dev); 897 900 struct net_device *dev = link->priv; 898 901 struct orinoco_private *priv = netdev_priv(dev); 899 902 unsigned long flags; ··· 917 922 } 918 923 919 924 static int 920 - spectrum_cs_resume(struct pcmcia_device *p_dev) 925 + spectrum_cs_resume(struct pcmcia_device *link) 921 926 { 922 - dev_link_t *link = dev_to_instance(p_dev); 923 927 struct net_device *dev = link->priv; 924 928 struct orinoco_private *priv = netdev_priv(dev); 925 929
+31 -36
drivers/net/wireless/wavelan_cs.c
··· 1005 1005 wv_82593_reconfig(struct net_device * dev) 1006 1006 { 1007 1007 net_local * lp = netdev_priv(dev); 1008 - dev_link_t * link = lp->link; 1008 + struct pcmcia_device * link = lp->link; 1009 1009 unsigned long flags; 1010 1010 1011 1011 /* Arm the flag, will be cleard in wv_82593_config() */ ··· 3744 3744 { 3745 3745 int i; 3746 3746 conf_reg_t reg = { 0, CS_READ, CISREG_COR, 0 }; 3747 - dev_link_t * link = ((net_local *)netdev_priv(dev))->link; 3747 + struct pcmcia_device * link = ((net_local *)netdev_priv(dev))->link; 3748 3748 3749 3749 #ifdef DEBUG_CONFIG_TRACE 3750 3750 printk(KERN_DEBUG "%s: ->wv_pcmcia_reset()\n", dev->name); 3751 3751 #endif 3752 3752 3753 - i = pcmcia_access_configuration_register(link->handle, &reg); 3753 + i = pcmcia_access_configuration_register(link, &reg); 3754 3754 if(i != CS_SUCCESS) 3755 3755 { 3756 - cs_error(link->handle, AccessConfigurationRegister, i); 3756 + cs_error(link, AccessConfigurationRegister, i); 3757 3757 return FALSE; 3758 3758 } 3759 3759 ··· 3764 3764 3765 3765 reg.Action = CS_WRITE; 3766 3766 reg.Value = reg.Value | COR_SW_RESET; 3767 - i = pcmcia_access_configuration_register(link->handle, &reg); 3767 + i = pcmcia_access_configuration_register(link, &reg); 3768 3768 if(i != CS_SUCCESS) 3769 3769 { 3770 - cs_error(link->handle, AccessConfigurationRegister, i); 3770 + cs_error(link, AccessConfigurationRegister, i); 3771 3771 return FALSE; 3772 3772 } 3773 3773 3774 3774 reg.Action = CS_WRITE; 3775 3775 reg.Value = COR_LEVEL_IRQ | COR_CONFIG; 3776 - i = pcmcia_access_configuration_register(link->handle, &reg); 3776 + i = pcmcia_access_configuration_register(link, &reg); 3777 3777 if(i != CS_SUCCESS) 3778 3778 { 3779 - cs_error(link->handle, AccessConfigurationRegister, i); 3779 + cs_error(link, AccessConfigurationRegister, i); 3780 3780 return FALSE; 3781 3781 } 3782 3782 ··· 3940 3940 * (called by wavelan_event()) 3941 3941 */ 3942 3942 static inline int 3943 - wv_pcmcia_config(dev_link_t * link) 3943 + wv_pcmcia_config(struct pcmcia_device * link) 3944 3944 { 3945 - client_handle_t handle = link->handle; 3946 3945 tuple_t tuple; 3947 3946 cisparse_t parse; 3948 3947 struct net_device * dev = (struct net_device *) link->priv; ··· 3964 3965 { 3965 3966 tuple.Attributes = 0; 3966 3967 tuple.DesiredTuple = CISTPL_CONFIG; 3967 - i = pcmcia_get_first_tuple(handle, &tuple); 3968 + i = pcmcia_get_first_tuple(link, &tuple); 3968 3969 if(i != CS_SUCCESS) 3969 3970 break; 3970 3971 tuple.TupleData = (cisdata_t *)buf; 3971 3972 tuple.TupleDataMax = 64; 3972 3973 tuple.TupleOffset = 0; 3973 - i = pcmcia_get_tuple_data(handle, &tuple); 3974 + i = pcmcia_get_tuple_data(link, &tuple); 3974 3975 if(i != CS_SUCCESS) 3975 3976 break; 3976 - i = pcmcia_parse_tuple(handle, &tuple, &parse); 3977 + i = pcmcia_parse_tuple(link, &tuple, &parse); 3977 3978 if(i != CS_SUCCESS) 3978 3979 break; 3979 3980 link->conf.ConfigBase = parse.config.base; ··· 3982 3983 while(0); 3983 3984 if(i != CS_SUCCESS) 3984 3985 { 3985 - cs_error(link->handle, ParseTuple, i); 3986 + cs_error(link, ParseTuple, i); 3986 3987 link->state &= ~DEV_CONFIG_PENDING; 3987 3988 return FALSE; 3988 3989 } ··· 3991 3992 link->state |= DEV_CONFIG; 3992 3993 do 3993 3994 { 3994 - i = pcmcia_request_io(link->handle, &link->io); 3995 + i = pcmcia_request_io(link, &link->io); 3995 3996 if(i != CS_SUCCESS) 3996 3997 { 3997 - cs_error(link->handle, RequestIO, i); 3998 + cs_error(link, RequestIO, i); 3998 3999 break; 3999 4000 } 4000 4001 ··· 4002 4003 * Now allocate an interrupt line. Note that this does not 4003 4004 * actually assign a handler to the interrupt. 4004 4005 */ 4005 - i = pcmcia_request_irq(link->handle, &link->irq); 4006 + i = pcmcia_request_irq(link, &link->irq); 4006 4007 if(i != CS_SUCCESS) 4007 4008 { 4008 - cs_error(link->handle, RequestIRQ, i); 4009 + cs_error(link, RequestIRQ, i); 4009 4010 break; 4010 4011 } 4011 4012 ··· 4014 4015 * the I/O windows and the interrupt mapping. 4015 4016 */ 4016 4017 link->conf.ConfigIndex = 1; 4017 - i = pcmcia_request_configuration(link->handle, &link->conf); 4018 + i = pcmcia_request_configuration(link, &link->conf); 4018 4019 if(i != CS_SUCCESS) 4019 4020 { 4020 - cs_error(link->handle, RequestConfiguration, i); 4021 + cs_error(link, RequestConfiguration, i); 4021 4022 break; 4022 4023 } 4023 4024 4024 4025 /* 4025 - * Allocate a small memory window. Note that the dev_link_t 4026 + * Allocate a small memory window. Note that the struct pcmcia_device 4026 4027 * structure provides space for one window handle -- if your 4027 4028 * device needs several windows, you'll need to keep track of 4028 4029 * the handles in your private data structure, link->priv. ··· 4030 4031 req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; 4031 4032 req.Base = req.Size = 0; 4032 4033 req.AccessSpeed = mem_speed; 4033 - i = pcmcia_request_window(&link->handle, &req, &link->win); 4034 + i = pcmcia_request_window(&link, &req, &link->win); 4034 4035 if(i != CS_SUCCESS) 4035 4036 { 4036 - cs_error(link->handle, RequestWindow, i); 4037 + cs_error(link, RequestWindow, i); 4037 4038 break; 4038 4039 } 4039 4040 ··· 4045 4046 i = pcmcia_map_mem_page(link->win, &mem); 4046 4047 if(i != CS_SUCCESS) 4047 4048 { 4048 - cs_error(link->handle, MapMemPage, i); 4049 + cs_error(link, MapMemPage, i); 4049 4050 break; 4050 4051 } 4051 4052 ··· 4059 4060 lp->mem, dev->irq, (u_int) dev->base_addr); 4060 4061 #endif 4061 4062 4062 - SET_NETDEV_DEV(dev, &handle_to_dev(handle)); 4063 + SET_NETDEV_DEV(dev, &handle_to_dev(link)); 4063 4064 i = register_netdev(dev); 4064 4065 if(i != 0) 4065 4066 { ··· 4095 4096 * still open, this will be postponed until it is closed. 4096 4097 */ 4097 4098 static void 4098 - wv_pcmcia_release(dev_link_t *link) 4099 + wv_pcmcia_release(struct pcmcia_device *link) 4099 4100 { 4100 4101 struct net_device * dev = (struct net_device *) link->priv; 4101 4102 net_local * lp = netdev_priv(dev); ··· 4105 4106 #endif 4106 4107 4107 4108 iounmap(lp->mem); 4108 - pcmcia_disable_device(link->handle); 4109 + pcmcia_disable_device(link); 4109 4110 4110 4111 #ifdef DEBUG_CONFIG_TRACE 4111 4112 printk(KERN_DEBUG "%s: <- wv_pcmcia_release()\n", dev->name); ··· 4472 4473 wavelan_open(struct net_device * dev) 4473 4474 { 4474 4475 net_local * lp = netdev_priv(dev); 4475 - dev_link_t * link = lp->link; 4476 + struct pcmcia_device * link = lp->link; 4476 4477 kio_addr_t base = dev->base_addr; 4477 4478 4478 4479 #ifdef DEBUG_CALLBACK_TRACE ··· 4526 4527 static int 4527 4528 wavelan_close(struct net_device * dev) 4528 4529 { 4529 - dev_link_t * link = ((net_local *)netdev_priv(dev))->link; 4530 + struct pcmcia_device * link = ((net_local *)netdev_priv(dev))->link; 4530 4531 kio_addr_t base = dev->base_addr; 4531 4532 4532 4533 #ifdef DEBUG_CALLBACK_TRACE ··· 4672 4673 * is released. 4673 4674 */ 4674 4675 static void 4675 - wavelan_detach(struct pcmcia_device *p_dev) 4676 + wavelan_detach(struct pcmcia_device *link) 4676 4677 { 4677 - dev_link_t *link = dev_to_instance(p_dev); 4678 - 4679 4678 #ifdef DEBUG_CALLBACK_TRACE 4680 4679 printk(KERN_DEBUG "-> wavelan_detach(0x%p)\n", link); 4681 4680 #endif ··· 4710 4713 #endif 4711 4714 } 4712 4715 4713 - static int wavelan_suspend(struct pcmcia_device *p_dev) 4716 + static int wavelan_suspend(struct pcmcia_device *link) 4714 4717 { 4715 - dev_link_t *link = dev_to_instance(p_dev); 4716 4718 struct net_device * dev = (struct net_device *) link->priv; 4717 4719 4718 4720 /* NB: wavelan_close will be called, but too late, so we are ··· 4732 4736 return 0; 4733 4737 } 4734 4738 4735 - static int wavelan_resume(struct pcmcia_device *p_dev) 4739 + static int wavelan_resume(struct pcmcia_device *link) 4736 4740 { 4737 - dev_link_t *link = dev_to_instance(p_dev); 4738 4741 struct net_device * dev = (struct net_device *) link->priv; 4739 4742 4740 4743 link->state &= ~DEV_SUSPEND;
+3 -3
drivers/net/wireless/wavelan_cs.p.h
··· 602 602 dev_node_t node; /* ???? What is this stuff ???? */ 603 603 struct net_device * dev; /* Reverse link... */ 604 604 spinlock_t spinlock; /* Serialize access to the hardware (SMP) */ 605 - dev_link_t * link; /* pcmcia structure */ 605 + struct pcmcia_device * link; /* pcmcia structure */ 606 606 en_stats stats; /* Ethernet interface statistics */ 607 607 int nresets; /* Number of hw resets */ 608 608 u_char configured; /* If it is configured */ ··· 733 733 static inline void 734 734 wv_hw_reset(struct net_device *); /* Same, + start receiver unit */ 735 735 static inline int 736 - wv_pcmcia_config(dev_link_t *); /* Configure the pcmcia interface */ 736 + wv_pcmcia_config(struct pcmcia_device *); /* Configure the pcmcia interface */ 737 737 static void 738 - wv_pcmcia_release(dev_link_t *);/* Remove a device */ 738 + wv_pcmcia_release(struct pcmcia_device *);/* Remove a device */ 739 739 /* ---------------------- INTERRUPT HANDLING ---------------------- */ 740 740 static irqreturn_t 741 741 wavelan_interrupt(int, /* Interrupt handler */
+31 -36
drivers/net/wireless/wl3501_cs.c
··· 103 103 * release a socket, in response to card insertion and ejection events. They 104 104 * are invoked from the wl24 event handler. 105 105 */ 106 - static void wl3501_config(dev_link_t *link); 107 - static void wl3501_release(dev_link_t *link); 106 + static void wl3501_config(struct pcmcia_device *link); 107 + static void wl3501_release(struct pcmcia_device *link); 108 108 109 109 /* 110 110 * The dev_info variable is the "key" that is used to match up this ··· 1270 1270 struct wl3501_card *this = dev->priv; 1271 1271 int rc = -ENODEV; 1272 1272 unsigned long flags; 1273 - dev_link_t *link; 1273 + struct pcmcia_device *link; 1274 1274 link = this->p_dev; 1275 1275 1276 1276 spin_lock_irqsave(&this->lock, flags); ··· 1383 1383 int rc = -ENODEV; 1384 1384 struct wl3501_card *this = dev->priv; 1385 1385 unsigned long flags; 1386 - dev_link_t *link; 1386 + struct pcmcia_device *link; 1387 1387 link = this->p_dev; 1388 1388 1389 1389 spin_lock_irqsave(&this->lock, flags); ··· 1477 1477 * Services. If it has been released, all local data structures are freed. 1478 1478 * Otherwise, the structures will be freed when the device is released. 1479 1479 */ 1480 - static void wl3501_detach(struct pcmcia_device *p_dev) 1480 + static void wl3501_detach(struct pcmcia_device *link) 1481 1481 { 1482 - dev_link_t *link = dev_to_instance(p_dev); 1483 1482 struct net_device *dev = link->priv; 1484 1483 1485 1484 /* If the device is currently configured and active, we won't actually ··· 1924 1925 { 1925 1926 struct net_device *dev; 1926 1927 struct wl3501_card *this; 1927 - dev_link_t *link = dev_to_instance(p_dev); 1928 1928 1929 1929 /* The io structure describes IO port mapping */ 1930 - link->io.NumPorts1 = 16; 1931 - link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 1932 - link->io.IOAddrLines = 5; 1930 + p_dev->io.NumPorts1 = 16; 1931 + p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 1932 + p_dev->io.IOAddrLines = 5; 1933 1933 1934 1934 /* Interrupt setup */ 1935 - link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT; 1936 - link->irq.IRQInfo1 = IRQ_LEVEL_ID; 1937 - link->irq.Handler = wl3501_interrupt; 1935 + p_dev->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT; 1936 + p_dev->irq.IRQInfo1 = IRQ_LEVEL_ID; 1937 + p_dev->irq.Handler = wl3501_interrupt; 1938 1938 1939 1939 /* General socket configuration */ 1940 - link->conf.Attributes = CONF_ENABLE_IRQ; 1941 - link->conf.IntType = INT_MEMORY_AND_IO; 1942 - link->conf.ConfigIndex = 1; 1943 - link->conf.Present = PRESENT_OPTION; 1940 + p_dev->conf.Attributes = CONF_ENABLE_IRQ; 1941 + p_dev->conf.IntType = INT_MEMORY_AND_IO; 1942 + p_dev->conf.ConfigIndex = 1; 1943 + p_dev->conf.Present = PRESENT_OPTION; 1944 1944 1945 1945 dev = alloc_etherdev(sizeof(struct wl3501_card)); 1946 1946 if (!dev) ··· 1957 1959 dev->wireless_handlers = (struct iw_handler_def *)&wl3501_handler_def; 1958 1960 SET_ETHTOOL_OPS(dev, &ops); 1959 1961 netif_stop_queue(dev); 1960 - link->priv = link->irq.Instance = dev; 1962 + p_dev->priv = p_dev->irq.Instance = dev; 1961 1963 1962 - link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; 1964 + p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; 1963 1965 wl3501_config(p_dev); 1964 1966 1965 1967 return 0; ··· 1978 1980 * received, to configure the PCMCIA socket, and to make the ethernet device 1979 1981 * available to the system. 1980 1982 */ 1981 - static void wl3501_config(dev_link_t *link) 1983 + static void wl3501_config(struct pcmcia_device *link) 1982 1984 { 1983 1985 tuple_t tuple; 1984 1986 cisparse_t parse; 1985 - client_handle_t handle = link->handle; 1986 1987 struct net_device *dev = link->priv; 1987 1988 int i = 0, j, last_fn, last_ret; 1988 1989 unsigned char bf[64]; ··· 1990 1993 /* This reads the card's CONFIG tuple to find its config registers. */ 1991 1994 tuple.Attributes = 0; 1992 1995 tuple.DesiredTuple = CISTPL_CONFIG; 1993 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 1996 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 1994 1997 tuple.TupleData = bf; 1995 1998 tuple.TupleDataMax = sizeof(bf); 1996 1999 tuple.TupleOffset = 0; 1997 - CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 1998 - CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse)); 2000 + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 2001 + CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); 1999 2002 link->conf.ConfigBase = parse.config.base; 2000 2003 link->conf.Present = parse.config.rmask[0]; 2001 2004 ··· 2011 2014 * 0x200-0x2ff, and so on, because this seems safer */ 2012 2015 link->io.BasePort1 = j; 2013 2016 link->io.BasePort2 = link->io.BasePort1 + 0x10; 2014 - i = pcmcia_request_io(link->handle, &link->io); 2017 + i = pcmcia_request_io(link, &link->io); 2015 2018 if (i == CS_SUCCESS) 2016 2019 break; 2017 2020 } 2018 2021 if (i != CS_SUCCESS) { 2019 - cs_error(link->handle, RequestIO, i); 2022 + cs_error(link, RequestIO, i); 2020 2023 goto failed; 2021 2024 } 2022 2025 2023 2026 /* Now allocate an interrupt line. Note that this does not actually 2024 2027 * assign a handler to the interrupt. */ 2025 2028 2026 - CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq)); 2029 + CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 2027 2030 2028 2031 /* This actually configures the PCMCIA socket -- setting up the I/O 2029 2032 * windows and the interrupt mapping. */ 2030 2033 2031 - CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf)); 2034 + CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 2032 2035 2033 2036 dev->irq = link->irq.AssignedIRQ; 2034 2037 dev->base_addr = link->io.BasePort1; 2035 - SET_NETDEV_DEV(dev, &handle_to_dev(handle)); 2038 + SET_NETDEV_DEV(dev, &handle_to_dev(link)); 2036 2039 if (register_netdev(dev)) { 2037 2040 printk(KERN_NOTICE "wl3501_cs: register_netdev() failed\n"); 2038 2041 goto failed; ··· 2084 2087 netif_start_queue(dev); 2085 2088 goto out; 2086 2089 cs_failed: 2087 - cs_error(link->handle, last_fn, last_ret); 2090 + cs_error(link, last_fn, last_ret); 2088 2091 failed: 2089 2092 wl3501_release(link); 2090 2093 out: ··· 2099 2102 * and release the PCMCIA configuration. If the device is still open, this 2100 2103 * will be postponed until it is closed. 2101 2104 */ 2102 - static void wl3501_release(dev_link_t *link) 2105 + static void wl3501_release(struct pcmcia_device *link) 2103 2106 { 2104 2107 struct net_device *dev = link->priv; 2105 2108 ··· 2107 2110 if (link->dev_node) 2108 2111 unregister_netdev(dev); 2109 2112 2110 - pcmcia_disable_device(link->handle); 2113 + pcmcia_disable_device(link); 2111 2114 } 2112 2115 2113 - static int wl3501_suspend(struct pcmcia_device *p_dev) 2116 + static int wl3501_suspend(struct pcmcia_device *link) 2114 2117 { 2115 - dev_link_t *link = dev_to_instance(p_dev); 2116 2118 struct net_device *dev = link->priv; 2117 2119 2118 2120 wl3501_pwr_mgmt(dev->priv, WL3501_SUSPEND); ··· 2121 2125 return 0; 2122 2126 } 2123 2127 2124 - static int wl3501_resume(struct pcmcia_device *p_dev) 2128 + static int wl3501_resume(struct pcmcia_device *link) 2125 2129 { 2126 - dev_link_t *link = dev_to_instance(p_dev); 2127 2130 struct net_device *dev = link->priv; 2128 2131 2129 2132 wl3501_pwr_mgmt(dev->priv, WL3501_RESUME);
+19 -23
drivers/parport/parport_cs.c
··· 88 88 } parport_info_t; 89 89 90 90 static void parport_detach(struct pcmcia_device *p_dev); 91 - static void parport_config(dev_link_t *link); 92 - static void parport_cs_release(dev_link_t *); 91 + static void parport_config(struct pcmcia_device *link); 92 + static void parport_cs_release(struct pcmcia_device *); 93 93 94 94 /*====================================================================== 95 95 ··· 99 99 100 100 ======================================================================*/ 101 101 102 - static int parport_attach(struct pcmcia_device *p_dev) 102 + static int parport_attach(struct pcmcia_device *link) 103 103 { 104 104 parport_info_t *info; 105 - dev_link_t *link = dev_to_instance(p_dev); 106 105 107 106 DEBUG(0, "parport_attach()\n"); 108 107 ··· 110 111 if (!info) return -ENOMEM; 111 112 memset(info, 0, sizeof(*info)); 112 113 link->priv = info; 113 - info->p_dev = p_dev; 114 + info->p_dev = link; 114 115 115 116 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 116 117 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; ··· 134 135 135 136 ======================================================================*/ 136 137 137 - static void parport_detach(struct pcmcia_device *p_dev) 138 + static void parport_detach(struct pcmcia_device *link) 138 139 { 139 - dev_link_t *link = dev_to_instance(p_dev); 140 - 141 140 DEBUG(0, "parport_detach(0x%p)\n", link); 142 141 143 142 if (link->state & DEV_CONFIG) ··· 155 158 #define CS_CHECK(fn, ret) \ 156 159 do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 157 160 158 - void parport_config(dev_link_t *link) 161 + void parport_config(struct pcmcia_device *link) 159 162 { 160 - client_handle_t handle = link->handle; 161 163 parport_info_t *info = link->priv; 162 164 tuple_t tuple; 163 165 u_short buf[128]; ··· 172 176 tuple.TupleOffset = 0; tuple.TupleDataMax = 255; 173 177 tuple.Attributes = 0; 174 178 tuple.DesiredTuple = CISTPL_CONFIG; 175 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 176 - CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 177 - CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse)); 179 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 180 + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 181 + CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); 178 182 link->conf.ConfigBase = parse.config.base; 179 183 link->conf.Present = parse.config.rmask[0]; 180 184 ··· 183 187 184 188 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 185 189 tuple.Attributes = 0; 186 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 190 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 187 191 while (1) { 188 - if (pcmcia_get_tuple_data(handle, &tuple) != 0 || 189 - pcmcia_parse_tuple(handle, &tuple, &parse) != 0) 192 + if (pcmcia_get_tuple_data(link, &tuple) != 0 || 193 + pcmcia_parse_tuple(link, &tuple, &parse) != 0) 190 194 goto next_entry; 191 195 192 196 if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) { ··· 201 205 link->io.BasePort2 = io->win[1].base; 202 206 link->io.NumPorts2 = io->win[1].len; 203 207 } 204 - if (pcmcia_request_io(link->handle, &link->io) != 0) 208 + if (pcmcia_request_io(link, &link->io) != 0) 205 209 goto next_entry; 206 210 /* If we've got this far, we're done */ 207 211 break; ··· 209 213 210 214 next_entry: 211 215 if (cfg->flags & CISTPL_CFTABLE_DEFAULT) dflt = *cfg; 212 - CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(handle, &tuple)); 216 + CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(link, &tuple)); 213 217 } 214 218 215 - CS_CHECK(RequestIRQ, pcmcia_request_irq(handle, &link->irq)); 216 - CS_CHECK(RequestConfiguration, pcmcia_request_configuration(handle, &link->conf)); 219 + CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 220 + CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 217 221 218 222 p = parport_pc_probe_port(link->io.BasePort1, link->io.BasePort2, 219 223 link->irq.AssignedIRQ, PARPORT_DMA_NONE, ··· 239 243 return; 240 244 241 245 cs_failed: 242 - cs_error(link->handle, last_fn, last_ret); 246 + cs_error(link, last_fn, last_ret); 243 247 failed: 244 248 parport_cs_release(link); 245 249 link->state &= ~DEV_CONFIG_PENDING; ··· 254 258 255 259 ======================================================================*/ 256 260 257 - void parport_cs_release(dev_link_t *link) 261 + void parport_cs_release(struct pcmcia_device *link) 258 262 { 259 263 parport_info_t *info = link->priv; 260 264 ··· 266 270 } 267 271 info->ndev = 0; 268 272 269 - pcmcia_disable_device(link->handle); 273 + pcmcia_disable_device(link); 270 274 } /* parport_cs_release */ 271 275 272 276
+1 -1
drivers/pcmcia/cs_internal.h
··· 31 31 u_short region_magic; 32 32 u_short state; 33 33 dev_info_t dev_info; 34 - client_handle_t mtd; 34 + struct pcmcia_device *mtd; 35 35 u_int MediaID; 36 36 region_info_t info; 37 37 } region_t;
-1
drivers/pcmcia/ds.c
··· 391 391 } 392 392 393 393 p_dev->p_state &= ~CLIENT_UNBOUND; 394 - p_dev->handle = p_dev; 395 394 396 395 ret = p_drv->probe(p_dev); 397 396 if (ret)
+22 -27
drivers/scsi/pcmcia/aha152x_stub.c
··· 94 94 struct Scsi_Host *host; 95 95 } scsi_info_t; 96 96 97 - static void aha152x_release_cs(dev_link_t *link); 97 + static void aha152x_release_cs(struct pcmcia_device *link); 98 98 static void aha152x_detach(struct pcmcia_device *p_dev); 99 - static void aha152x_config_cs(dev_link_t *link); 99 + static void aha152x_config_cs(struct pcmcia_device *link); 100 100 101 - static dev_link_t *dev_list; 101 + static struct pcmcia_device *dev_list; 102 102 103 - static int aha152x_attach(struct pcmcia_device *p_dev) 103 + static int aha152x_attach(struct pcmcia_device *link) 104 104 { 105 105 scsi_info_t *info; 106 - dev_link_t *link = dev_to_instance(p_dev); 107 - 106 + 108 107 DEBUG(0, "aha152x_attach()\n"); 109 108 110 109 /* Create new SCSI device */ 111 110 info = kmalloc(sizeof(*info), GFP_KERNEL); 112 111 if (!info) return -ENOMEM; 113 112 memset(info, 0, sizeof(*info)); 114 - info->p_dev = p_dev; 113 + info->p_dev = link; 115 114 link->priv = info; 116 115 117 116 link->io.NumPorts1 = 0x20; ··· 130 131 131 132 /*====================================================================*/ 132 133 133 - static void aha152x_detach(struct pcmcia_device *p_dev) 134 + static void aha152x_detach(struct pcmcia_device *link) 134 135 { 135 - dev_link_t *link = dev_to_instance(p_dev); 136 - 137 136 DEBUG(0, "aha152x_detach(0x%p)\n", link); 138 137 139 138 if (link->state & DEV_CONFIG) ··· 146 149 #define CS_CHECK(fn, ret) \ 147 150 do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 148 151 149 - static void aha152x_config_cs(dev_link_t *link) 152 + static void aha152x_config_cs(struct pcmcia_device *link) 150 153 { 151 - client_handle_t handle = link->handle; 152 154 scsi_info_t *info = link->priv; 153 155 struct aha152x_setup s; 154 156 tuple_t tuple; ··· 162 166 tuple.TupleData = tuple_data; 163 167 tuple.TupleDataMax = 64; 164 168 tuple.TupleOffset = 0; 165 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 166 - CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 167 - CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse)); 169 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 170 + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 171 + CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); 168 172 link->conf.ConfigBase = parse.config.base; 169 173 170 174 /* Configure card */ 171 175 link->state |= DEV_CONFIG; 172 176 173 177 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 174 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 178 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 175 179 while (1) { 176 - if (pcmcia_get_tuple_data(handle, &tuple) != 0 || 177 - pcmcia_parse_tuple(handle, &tuple, &parse) != 0) 180 + if (pcmcia_get_tuple_data(link, &tuple) != 0 || 181 + pcmcia_parse_tuple(link, &tuple, &parse) != 0) 178 182 goto next_entry; 179 183 /* For New Media T&J, look for a SCSI window */ 180 184 if (parse.cftable_entry.io.win[0].len >= 0x20) ··· 185 189 if ((parse.cftable_entry.io.nwin > 0) && 186 190 (link->io.BasePort1 < 0xffff)) { 187 191 link->conf.ConfigIndex = parse.cftable_entry.index; 188 - i = pcmcia_request_io(handle, &link->io); 192 + i = pcmcia_request_io(link, &link->io); 189 193 if (i == CS_SUCCESS) break; 190 194 } 191 195 next_entry: 192 - CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(handle, &tuple)); 196 + CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(link, &tuple)); 193 197 } 194 198 195 - CS_CHECK(RequestIRQ, pcmcia_request_irq(handle, &link->irq)); 196 - CS_CHECK(RequestConfiguration, pcmcia_request_configuration(handle, &link->conf)); 199 + CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 200 + CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 197 201 198 202 /* Set configuration options for the aha152x driver */ 199 203 memset(&s, 0, sizeof(s)); ··· 222 226 return; 223 227 224 228 cs_failed: 225 - cs_error(link->handle, last_fn, last_ret); 229 + cs_error(link, last_fn, last_ret); 226 230 aha152x_release_cs(link); 227 231 return; 228 232 } 229 233 230 - static void aha152x_release_cs(dev_link_t *link) 234 + static void aha152x_release_cs(struct pcmcia_device *link) 231 235 { 232 236 scsi_info_t *info = link->priv; 233 237 234 238 aha152x_release(info->host); 235 - pcmcia_disable_device(link->handle); 239 + pcmcia_disable_device(link); 236 240 } 237 241 238 - static int aha152x_resume(struct pcmcia_device *dev) 242 + static int aha152x_resume(struct pcmcia_device *link) 239 243 { 240 - dev_link_t *link = dev_to_instance(dev); 241 244 scsi_info_t *info = link->priv; 242 245 243 246 aha152x_host_reset_host(info->host);
+20 -26
drivers/scsi/pcmcia/fdomain_stub.c
··· 79 79 } scsi_info_t; 80 80 81 81 82 - static void fdomain_release(dev_link_t *link); 82 + static void fdomain_release(struct pcmcia_device *link); 83 83 static void fdomain_detach(struct pcmcia_device *p_dev); 84 - static void fdomain_config(dev_link_t *link); 84 + static void fdomain_config(struct pcmcia_device *link); 85 85 86 - static int fdomain_attach(struct pcmcia_device *p_dev) 86 + static int fdomain_attach(struct pcmcia_device *link) 87 87 { 88 88 scsi_info_t *info; 89 - dev_link_t *link = dev_to_instance(p_dev); 90 89 91 90 DEBUG(0, "fdomain_attach()\n"); 92 91 ··· 93 94 info = kmalloc(sizeof(*info), GFP_KERNEL); 94 95 if (!info) return -ENOMEM; 95 96 memset(info, 0, sizeof(*info)); 96 - info->p_dev = p_dev; 97 + info->p_dev = link; 97 98 link->priv = info; 98 99 link->io.NumPorts1 = 0x10; 99 100 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; ··· 112 113 113 114 /*====================================================================*/ 114 115 115 - static void fdomain_detach(struct pcmcia_device *p_dev) 116 + static void fdomain_detach(struct pcmcia_device *link) 116 117 { 117 - dev_link_t *link = dev_to_instance(p_dev); 118 - 119 118 DEBUG(0, "fdomain_detach(0x%p)\n", link); 120 119 121 120 if (link->state & DEV_CONFIG) ··· 127 130 #define CS_CHECK(fn, ret) \ 128 131 do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 129 132 130 - static void fdomain_config(dev_link_t *link) 133 + static void fdomain_config(struct pcmcia_device *link) 131 134 { 132 - client_handle_t handle = link->handle; 133 135 scsi_info_t *info = link->priv; 134 136 tuple_t tuple; 135 137 cisparse_t parse; ··· 143 147 tuple.TupleData = tuple_data; 144 148 tuple.TupleDataMax = 64; 145 149 tuple.TupleOffset = 0; 146 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 147 - CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 148 - CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse)); 150 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 151 + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 152 + CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); 149 153 link->conf.ConfigBase = parse.config.base; 150 154 151 155 /* Configure card */ 152 156 link->state |= DEV_CONFIG; 153 157 154 158 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 155 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 159 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 156 160 while (1) { 157 - if (pcmcia_get_tuple_data(handle, &tuple) != 0 || 158 - pcmcia_parse_tuple(handle, &tuple, &parse) != 0) 161 + if (pcmcia_get_tuple_data(link, &tuple) != 0 || 162 + pcmcia_parse_tuple(link, &tuple, &parse) != 0) 159 163 goto next_entry; 160 164 link->conf.ConfigIndex = parse.cftable_entry.index; 161 165 link->io.BasePort1 = parse.cftable_entry.io.win[0].base; 162 - i = pcmcia_request_io(handle, &link->io); 166 + i = pcmcia_request_io(link, &link->io); 163 167 if (i == CS_SUCCESS) break; 164 168 next_entry: 165 - CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(handle, &tuple)); 169 + CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(link, &tuple)); 166 170 } 167 171 168 - CS_CHECK(RequestIRQ, pcmcia_request_irq(handle, &link->irq)); 169 - CS_CHECK(RequestConfiguration, pcmcia_request_configuration(handle, &link->conf)); 172 + CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 173 + CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 170 174 171 175 /* A bad hack... */ 172 176 release_region(link->io.BasePort1, link->io.NumPorts1); ··· 192 196 return; 193 197 194 198 cs_failed: 195 - cs_error(link->handle, last_fn, last_ret); 199 + cs_error(link, last_fn, last_ret); 196 200 fdomain_release(link); 197 201 return; 198 202 ··· 200 204 201 205 /*====================================================================*/ 202 206 203 - static void fdomain_release(dev_link_t *link) 207 + static void fdomain_release(struct pcmcia_device *link) 204 208 { 205 209 scsi_info_t *info = link->priv; 206 210 207 211 DEBUG(0, "fdomain_release(0x%p)\n", link); 208 212 209 213 scsi_remove_host(info->host); 210 - pcmcia_disable_device(link->handle); 214 + pcmcia_disable_device(link); 211 215 scsi_unregister(info->host); 212 216 } 213 217 214 218 /*====================================================================*/ 215 219 216 - static int fdomain_resume(struct pcmcia_device *dev) 220 + static int fdomain_resume(struct pcmcia_device *link) 217 221 { 218 - dev_link_t *link = dev_to_instance(dev); 219 - 220 222 if (link->state & DEV_CONFIG) 221 223 fdomain_16x0_bus_reset(NULL); 222 224
+22 -28
drivers/scsi/pcmcia/nsp_cs.c
··· 1593 1593 configure the card at this point -- we wait until we receive a 1594 1594 card insertion event. 1595 1595 ======================================================================*/ 1596 - static int nsp_cs_attach(struct pcmcia_device *p_dev) 1596 + static int nsp_cs_attach(struct pcmcia_device *link) 1597 1597 { 1598 1598 scsi_info_t *info; 1599 1599 nsp_hw_data *data = &nsp_data_base; 1600 - dev_link_t *link = dev_to_instance(p_dev); 1601 1600 1602 1601 nsp_dbg(NSP_DEBUG_INIT, "in"); 1603 1602 ··· 1604 1605 info = kmalloc(sizeof(*info), GFP_KERNEL); 1605 1606 if (info == NULL) { return -ENOMEM; } 1606 1607 memset(info, 0, sizeof(*info)); 1607 - info->p_dev = p_dev; 1608 + info->p_dev = link; 1608 1609 link->priv = info; 1609 1610 data->ScsiInfo = info; 1610 1611 ··· 1643 1644 structures are freed. Otherwise, the structures will be freed 1644 1645 when the device is released. 1645 1646 ======================================================================*/ 1646 - static void nsp_cs_detach(struct pcmcia_device *p_dev) 1647 + static void nsp_cs_detach(struct pcmcia_device *link) 1647 1648 { 1648 - dev_link_t *link = dev_to_instance(p_dev); 1649 - 1650 1649 nsp_dbg(NSP_DEBUG_INIT, "in, link=0x%p", link); 1651 1650 1652 1651 if (link->state & DEV_CONFIG) { ··· 1665 1668 #define CS_CHECK(fn, ret) \ 1666 1669 do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 1667 1670 /*====================================================================*/ 1668 - static void nsp_cs_config(dev_link_t *link) 1671 + static void nsp_cs_config(struct pcmcia_device *link) 1669 1672 { 1670 - client_handle_t handle = link->handle; 1671 1673 scsi_info_t *info = link->priv; 1672 1674 tuple_t tuple; 1673 1675 cisparse_t parse; ··· 1690 1694 tuple.TupleData = tuple_data; 1691 1695 tuple.TupleDataMax = sizeof(tuple_data); 1692 1696 tuple.TupleOffset = 0; 1693 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 1694 - CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 1695 - CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse)); 1697 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 1698 + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 1699 + CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); 1696 1700 link->conf.ConfigBase = parse.config.base; 1697 1701 link->conf.Present = parse.config.rmask[0]; 1698 1702 ··· 1700 1704 link->state |= DEV_CONFIG; 1701 1705 1702 1706 /* Look up the current Vcc */ 1703 - CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(handle, &conf)); 1707 + CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(link, &conf)); 1704 1708 1705 1709 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 1706 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 1710 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 1707 1711 while (1) { 1708 1712 cistpl_cftable_entry_t *cfg = &(parse.cftable_entry); 1709 1713 1710 - if (pcmcia_get_tuple_data(handle, &tuple) != 0 || 1711 - pcmcia_parse_tuple(handle, &tuple, &parse) != 0) 1714 + if (pcmcia_get_tuple_data(link, &tuple) != 0 || 1715 + pcmcia_parse_tuple(link, &tuple, &parse) != 0) 1712 1716 goto next_entry; 1713 1717 1714 1718 if (cfg->flags & CISTPL_CFTABLE_DEFAULT) { dflt = *cfg; } ··· 1764 1768 link->io.NumPorts2 = io->win[1].len; 1765 1769 } 1766 1770 /* This reserves IO space but doesn't actually enable it */ 1767 - if (pcmcia_request_io(link->handle, &link->io) != 0) 1771 + if (pcmcia_request_io(link, &link->io) != 0) 1768 1772 goto next_entry; 1769 1773 } 1770 1774 ··· 1779 1783 req.Size = 0x1000; 1780 1784 } 1781 1785 req.AccessSpeed = 0; 1782 - if (pcmcia_request_window(&link->handle, &req, &link->win) != 0) 1786 + if (pcmcia_request_window(&link, &req, &link->win) != 0) 1783 1787 goto next_entry; 1784 1788 map.Page = 0; map.CardOffset = mem->win[0].card_addr; 1785 1789 if (pcmcia_map_mem_page(link->win, &map) != 0) ··· 1793 1797 1794 1798 next_entry: 1795 1799 nsp_dbg(NSP_DEBUG_INIT, "next"); 1796 - pcmcia_disable_device(handle); 1797 - CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(handle, &tuple)); 1800 + pcmcia_disable_device(link); 1801 + CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(link, &tuple)); 1798 1802 } 1799 1803 1800 1804 if (link->conf.Attributes & CONF_ENABLE_IRQ) { 1801 - CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq)); 1805 + CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 1802 1806 } 1803 - CS_CHECK(RequestConfiguration, pcmcia_request_configuration(handle, &link->conf)); 1807 + CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 1804 1808 1805 1809 if (free_ports) { 1806 1810 if (link->io.BasePort1) { ··· 1921 1925 1922 1926 cs_failed: 1923 1927 nsp_dbg(NSP_DEBUG_INIT, "config fail"); 1924 - cs_error(link->handle, last_fn, last_ret); 1928 + cs_error(link, last_fn, last_ret); 1925 1929 nsp_cs_release(link); 1926 1930 1927 1931 return; ··· 1934 1938 device, and release the PCMCIA configuration. If the device is 1935 1939 still open, this will be postponed until it is closed. 1936 1940 ======================================================================*/ 1937 - static void nsp_cs_release(dev_link_t *link) 1941 + static void nsp_cs_release(struct pcmcia_device *link) 1938 1942 { 1939 1943 scsi_info_t *info = link->priv; 1940 1944 nsp_hw_data *data = NULL; ··· 1962 1966 iounmap((void *)(data->MmioAddress)); 1963 1967 } 1964 1968 } 1965 - pcmcia_disable_device(link->handle); 1969 + pcmcia_disable_device(link); 1966 1970 1967 1971 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,2)) 1968 1972 if (info->host != NULL) { ··· 1971 1975 #endif 1972 1976 } /* nsp_cs_release */ 1973 1977 1974 - static int nsp_cs_suspend(struct pcmcia_device *dev) 1978 + static int nsp_cs_suspend(struct pcmcia_device *link) 1975 1979 { 1976 - dev_link_t *link = dev_to_instance(dev); 1977 1980 scsi_info_t *info = link->priv; 1978 1981 nsp_hw_data *data; 1979 1982 ··· 1991 1996 return 0; 1992 1997 } 1993 1998 1994 - static int nsp_cs_resume(struct pcmcia_device *dev) 1999 + static int nsp_cs_resume(struct pcmcia_device *link) 1995 2000 { 1996 - dev_link_t *link = dev_to_instance(dev); 1997 2001 scsi_info_t *info = link->priv; 1998 2002 nsp_hw_data *data; 1999 2003
+3 -3
drivers/scsi/pcmcia/nsp_cs.h
··· 297 297 298 298 /* Card service functions */ 299 299 static void nsp_cs_detach (struct pcmcia_device *p_dev); 300 - static void nsp_cs_release(dev_link_t *link); 301 - static void nsp_cs_config (dev_link_t *link); 300 + static void nsp_cs_release(struct pcmcia_device *link); 301 + static void nsp_cs_config (struct pcmcia_device *link); 302 302 303 303 /* Linux SCSI subsystem specific functions */ 304 304 static struct Scsi_Host *nsp_detect (struct scsi_host_template *sht); ··· 450 450 return host; 451 451 } 452 452 453 - static void cs_error(client_handle_t handle, int func, int ret) 453 + static void cs_error(struct pcmcia_device *handle, int func, int ret) 454 454 { 455 455 error_info_t err = { func, ret }; 456 456 pcmcia_report_error(handle, &err);
+24 -30
drivers/scsi/pcmcia/qlogic_stub.c
··· 97 97 unsigned short manf_id; 98 98 } scsi_info_t; 99 99 100 - static void qlogic_release(dev_link_t *link); 100 + static void qlogic_release(struct pcmcia_device *link); 101 101 static void qlogic_detach(struct pcmcia_device *p_dev); 102 - static void qlogic_config(dev_link_t * link); 102 + static void qlogic_config(struct pcmcia_device * link); 103 103 104 104 static struct Scsi_Host *qlogic_detect(struct scsi_host_template *host, 105 - dev_link_t *link, int qbase, int qlirq) 105 + struct pcmcia_device *link, int qbase, int qlirq) 106 106 { 107 107 int qltyp; /* type of chip */ 108 108 int qinitid; ··· 156 156 err: 157 157 return NULL; 158 158 } 159 - static int qlogic_attach(struct pcmcia_device *p_dev) 159 + static int qlogic_attach(struct pcmcia_device *link) 160 160 { 161 161 scsi_info_t *info; 162 - dev_link_t *link = dev_to_instance(p_dev); 163 162 164 163 DEBUG(0, "qlogic_attach()\n"); 165 164 ··· 167 168 if (!info) 168 169 return -ENOMEM; 169 170 memset(info, 0, sizeof(*info)); 170 - info->p_dev = p_dev; 171 + info->p_dev = link; 171 172 link->priv = info; 172 173 link->io.NumPorts1 = 16; 173 174 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; ··· 186 187 187 188 /*====================================================================*/ 188 189 189 - static void qlogic_detach(struct pcmcia_device *p_dev) 190 + static void qlogic_detach(struct pcmcia_device *link) 190 191 { 191 - dev_link_t *link = dev_to_instance(p_dev); 192 - 193 192 DEBUG(0, "qlogic_detach(0x%p)\n", link); 194 193 195 194 if (link->state & DEV_CONFIG) ··· 202 205 #define CS_CHECK(fn, ret) \ 203 206 do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 204 207 205 - static void qlogic_config(dev_link_t * link) 208 + static void qlogic_config(struct pcmcia_device * link) 206 209 { 207 - client_handle_t handle = link->handle; 208 210 scsi_info_t *info = link->priv; 209 211 tuple_t tuple; 210 212 cisparse_t parse; ··· 217 221 tuple.TupleDataMax = 64; 218 222 tuple.TupleOffset = 0; 219 223 tuple.DesiredTuple = CISTPL_CONFIG; 220 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 221 - CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 222 - CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse)); 224 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 225 + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 226 + CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); 223 227 link->conf.ConfigBase = parse.config.base; 224 228 225 229 tuple.DesiredTuple = CISTPL_MANFID; 226 - if ((pcmcia_get_first_tuple(handle, &tuple) == CS_SUCCESS) && (pcmcia_get_tuple_data(handle, &tuple) == CS_SUCCESS)) 230 + if ((pcmcia_get_first_tuple(link, &tuple) == CS_SUCCESS) && (pcmcia_get_tuple_data(link, &tuple) == CS_SUCCESS)) 227 231 info->manf_id = le16_to_cpu(tuple.TupleData[0]); 228 232 229 233 /* Configure card */ 230 234 link->state |= DEV_CONFIG; 231 235 232 236 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 233 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 237 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 234 238 while (1) { 235 - if (pcmcia_get_tuple_data(handle, &tuple) != 0 || 236 - pcmcia_parse_tuple(handle, &tuple, &parse) != 0) 239 + if (pcmcia_get_tuple_data(link, &tuple) != 0 || 240 + pcmcia_parse_tuple(link, &tuple, &parse) != 0) 237 241 goto next_entry; 238 242 link->conf.ConfigIndex = parse.cftable_entry.index; 239 243 link->io.BasePort1 = parse.cftable_entry.io.win[0].base; 240 244 link->io.NumPorts1 = parse.cftable_entry.io.win[0].len; 241 245 if (link->io.BasePort1 != 0) { 242 - i = pcmcia_request_io(handle, &link->io); 246 + i = pcmcia_request_io(link, &link->io); 243 247 if (i == CS_SUCCESS) 244 248 break; 245 249 } 246 250 next_entry: 247 - CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(handle, &tuple)); 251 + CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(link, &tuple)); 248 252 } 249 253 250 - CS_CHECK(RequestIRQ, pcmcia_request_irq(handle, &link->irq)); 251 - CS_CHECK(RequestConfiguration, pcmcia_request_configuration(handle, &link->conf)); 254 + CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 255 + CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 252 256 253 257 if ((info->manf_id == MANFID_MACNICA) || (info->manf_id == MANFID_PIONEER) || (info->manf_id == 0x0098)) { 254 258 /* set ATAcmd */ ··· 279 283 return; 280 284 281 285 cs_failed: 282 - cs_error(link->handle, last_fn, last_ret); 283 - pcmcia_disable_device(link->handle); 286 + cs_error(link, last_fn, last_ret); 287 + pcmcia_disable_device(link); 284 288 return; 285 289 286 290 } /* qlogic_config */ 287 291 288 292 /*====================================================================*/ 289 293 290 - static void qlogic_release(dev_link_t *link) 294 + static void qlogic_release(struct pcmcia_device *link) 291 295 { 292 296 scsi_info_t *info = link->priv; 293 297 ··· 296 300 scsi_remove_host(info->host); 297 301 298 302 free_irq(link->irq.AssignedIRQ, info->host); 299 - pcmcia_disable_device(link->handle); 303 + pcmcia_disable_device(link); 300 304 301 305 scsi_host_put(info->host); 302 306 } 303 307 304 308 /*====================================================================*/ 305 309 306 - static int qlogic_resume(struct pcmcia_device *dev) 310 + static int qlogic_resume(struct pcmcia_device *link) 307 311 { 308 - dev_link_t *link = dev_to_instance(dev); 309 - 310 312 if (link->state & DEV_CONFIG) { 311 313 scsi_info_t *info = link->priv; 312 314 313 - pcmcia_request_configuration(link->handle, &link->conf); 315 + pcmcia_request_configuration(link, &link->conf); 314 316 if ((info->manf_id == MANFID_MACNICA) || 315 317 (info->manf_id == MANFID_PIONEER) || 316 318 (info->manf_id == 0x0098)) {
+20 -25
drivers/scsi/pcmcia/sym53c500_cs.c
··· 527 527 } 528 528 529 529 static void 530 - SYM53C500_release(dev_link_t *link) 530 + SYM53C500_release(struct pcmcia_device *link) 531 531 { 532 532 struct scsi_info_t *info = link->priv; 533 533 struct Scsi_Host *shost = info->host; ··· 550 550 if (shost->io_port && shost->n_io_port) 551 551 release_region(shost->io_port, shost->n_io_port); 552 552 553 - pcmcia_disable_device(link->handle); 553 + pcmcia_disable_device(link); 554 554 555 555 scsi_host_put(shost); 556 556 } /* SYM53C500_release */ ··· 708 708 do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 709 709 710 710 static void 711 - SYM53C500_config(dev_link_t *link) 711 + SYM53C500_config(struct pcmcia_device *link) 712 712 { 713 - client_handle_t handle = link->handle; 714 713 struct scsi_info_t *info = link->priv; 715 714 tuple_t tuple; 716 715 cisparse_t parse; ··· 726 727 tuple.TupleDataMax = 64; 727 728 tuple.TupleOffset = 0; 728 729 tuple.DesiredTuple = CISTPL_CONFIG; 729 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 730 - CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 731 - CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse)); 730 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 731 + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 732 + CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); 732 733 link->conf.ConfigBase = parse.config.base; 733 734 734 735 tuple.DesiredTuple = CISTPL_MANFID; 735 - if ((pcmcia_get_first_tuple(handle, &tuple) == CS_SUCCESS) && 736 - (pcmcia_get_tuple_data(handle, &tuple) == CS_SUCCESS)) 736 + if ((pcmcia_get_first_tuple(link, &tuple) == CS_SUCCESS) && 737 + (pcmcia_get_tuple_data(link, &tuple) == CS_SUCCESS)) 737 738 info->manf_id = le16_to_cpu(tuple.TupleData[0]); 738 739 739 740 /* Configure card */ 740 741 link->state |= DEV_CONFIG; 741 742 742 743 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 743 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 744 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 744 745 while (1) { 745 - if (pcmcia_get_tuple_data(handle, &tuple) != 0 || 746 - pcmcia_parse_tuple(handle, &tuple, &parse) != 0) 746 + if (pcmcia_get_tuple_data(link, &tuple) != 0 || 747 + pcmcia_parse_tuple(link, &tuple, &parse) != 0) 747 748 goto next_entry; 748 749 link->conf.ConfigIndex = parse.cftable_entry.index; 749 750 link->io.BasePort1 = parse.cftable_entry.io.win[0].base; 750 751 link->io.NumPorts1 = parse.cftable_entry.io.win[0].len; 751 752 752 753 if (link->io.BasePort1 != 0) { 753 - i = pcmcia_request_io(handle, &link->io); 754 + i = pcmcia_request_io(link, &link->io); 754 755 if (i == CS_SUCCESS) 755 756 break; 756 757 } 757 758 next_entry: 758 - CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(handle, &tuple)); 759 + CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(link, &tuple)); 759 760 } 760 761 761 - CS_CHECK(RequestIRQ, pcmcia_request_irq(handle, &link->irq)); 762 - CS_CHECK(RequestConfiguration, pcmcia_request_configuration(handle, &link->conf)); 762 + CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 763 + CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 763 764 764 765 /* 765 766 * That's the trouble with copying liberally from another driver. ··· 851 852 return; 852 853 853 854 cs_failed: 854 - cs_error(link->handle, last_fn, last_ret); 855 + cs_error(link, last_fn, last_ret); 855 856 SYM53C500_release(link); 856 857 return; 857 858 } /* SYM53C500_config */ 858 859 859 - static int sym53c500_resume(struct pcmcia_device *dev) 860 + static int sym53c500_resume(struct pcmcia_device *link) 860 861 { 861 - dev_link_t *link = dev_to_instance(dev); 862 862 struct scsi_info_t *info = link->priv; 863 863 864 864 if (link->state & DEV_CONFIG) { ··· 880 882 } 881 883 882 884 static void 883 - SYM53C500_detach(struct pcmcia_device *p_dev) 885 + SYM53C500_detach(struct pcmcia_device *link) 884 886 { 885 - dev_link_t *link = dev_to_instance(p_dev); 886 - 887 887 DEBUG(0, "SYM53C500_detach(0x%p)\n", link); 888 888 889 889 if (link->state & DEV_CONFIG) ··· 892 896 } /* SYM53C500_detach */ 893 897 894 898 static int 895 - SYM53C500_attach(struct pcmcia_device *p_dev) 899 + SYM53C500_attach(struct pcmcia_device *link) 896 900 { 897 901 struct scsi_info_t *info; 898 - dev_link_t *link = dev_to_instance(p_dev); 899 902 900 903 DEBUG(0, "SYM53C500_attach()\n"); 901 904 ··· 903 908 if (!info) 904 909 return -ENOMEM; 905 910 memset(info, 0, sizeof(*info)); 906 - info->p_dev = p_dev; 911 + info->p_dev = link; 907 912 link->priv = info; 908 913 link->io.NumPorts1 = 16; 909 914 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
+51 -60
drivers/serial/serial_cs.c
··· 113 113 }; 114 114 115 115 116 - static void serial_config(dev_link_t * link); 116 + static void serial_config(struct pcmcia_device * link); 117 117 118 118 119 119 /*====================================================================== ··· 123 123 124 124 ======================================================================*/ 125 125 126 - static void serial_remove(dev_link_t *link) 126 + static void serial_remove(struct pcmcia_device *link) 127 127 { 128 128 struct serial_info *info = link->priv; 129 129 int i; ··· 142 142 info->p_dev->dev_node = NULL; 143 143 144 144 if (!info->slave) 145 - pcmcia_disable_device(link->handle); 145 + pcmcia_disable_device(link); 146 146 147 147 info->p_dev->state &= ~DEV_CONFIG; 148 148 } 149 149 } 150 150 151 - static int serial_suspend(struct pcmcia_device *dev) 151 + static int serial_suspend(struct pcmcia_device *link) 152 152 { 153 - dev_link_t *link = dev_to_instance(dev); 154 - 155 153 if (link->state & DEV_CONFIG) { 156 154 struct serial_info *info = link->priv; 157 155 int i; ··· 164 166 return 0; 165 167 } 166 168 167 - static int serial_resume(struct pcmcia_device *dev) 169 + static int serial_resume(struct pcmcia_device *link) 168 170 { 169 - dev_link_t *link = dev_to_instance(dev); 170 - 171 171 if (DEV_OK(link)) { 172 172 struct serial_info *info = link->priv; 173 173 int i; ··· 185 189 186 190 ======================================================================*/ 187 191 188 - static int serial_probe(struct pcmcia_device *p_dev) 192 + static int serial_probe(struct pcmcia_device *link) 189 193 { 190 194 struct serial_info *info; 191 - dev_link_t *link = dev_to_instance(p_dev); 192 195 193 196 DEBUG(0, "serial_attach()\n"); 194 197 ··· 196 201 if (!info) 197 202 return -ENOMEM; 198 203 memset(info, 0, sizeof (*info)); 199 - info->p_dev = p_dev; 204 + info->p_dev = link; 200 205 link->priv = info; 201 206 202 207 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; ··· 225 230 226 231 ======================================================================*/ 227 232 228 - static void serial_detach(struct pcmcia_device *p_dev) 233 + static void serial_detach(struct pcmcia_device *link) 229 234 { 230 - dev_link_t *link = dev_to_instance(p_dev); 231 235 struct serial_info *info = link->priv; 232 236 233 237 DEBUG(0, "serial_detach(0x%p)\n", link); ··· 247 253 248 254 /*====================================================================*/ 249 255 250 - static int setup_serial(client_handle_t handle, struct serial_info * info, 256 + static int setup_serial(struct pcmcia_device *handle, struct serial_info * info, 251 257 kio_addr_t iobase, int irq) 252 258 { 253 259 struct uart_port port; ··· 282 288 /*====================================================================*/ 283 289 284 290 static int 285 - first_tuple(client_handle_t handle, tuple_t * tuple, cisparse_t * parse) 291 + first_tuple(struct pcmcia_device *handle, tuple_t * tuple, cisparse_t * parse) 286 292 { 287 293 int i; 288 294 i = pcmcia_get_first_tuple(handle, tuple); ··· 295 301 } 296 302 297 303 static int 298 - next_tuple(client_handle_t handle, tuple_t * tuple, cisparse_t * parse) 304 + next_tuple(struct pcmcia_device *handle, tuple_t * tuple, cisparse_t * parse) 299 305 { 300 306 int i; 301 307 i = pcmcia_get_next_tuple(handle, tuple); ··· 309 315 310 316 /*====================================================================*/ 311 317 312 - static int simple_config(dev_link_t *link) 318 + static int simple_config(struct pcmcia_device *link) 313 319 { 314 320 static const kio_addr_t base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; 315 321 static const int size_table[2] = { 8, 16 }; 316 - client_handle_t handle = link->handle; 317 322 struct serial_info *info = link->priv; 318 323 struct serial_cfg_mem *cfg_mem; 319 324 tuple_t *tuple; ··· 333 340 buf = cfg_mem->buf; 334 341 335 342 /* If the card is already configured, look up the port and irq */ 336 - i = pcmcia_get_configuration_info(handle, &config); 343 + i = pcmcia_get_configuration_info(link, &config); 337 344 if ((i == CS_SUCCESS) && (config.Attributes & CONF_VALID_CLIENT)) { 338 345 kio_addr_t port = 0; 339 346 if ((config.BasePort2 != 0) && (config.NumPorts2 == 8)) { ··· 346 353 } 347 354 if (info->slave) { 348 355 kfree(cfg_mem); 349 - return setup_serial(handle, info, port, config.AssignedIRQ); 356 + return setup_serial(link, info, port, config.AssignedIRQ); 350 357 } 351 358 } 352 359 ··· 359 366 /* Two tries: without IO aliases, then with aliases */ 360 367 for (s = 0; s < 2; s++) { 361 368 for (try = 0; try < 2; try++) { 362 - i = first_tuple(handle, tuple, parse); 369 + i = first_tuple(link, tuple, parse); 363 370 while (i != CS_NO_MORE_ITEMS) { 364 371 if (i != CS_SUCCESS) 365 372 goto next_entry; ··· 372 379 link->io.BasePort1 = cf->io.win[0].base; 373 380 link->io.IOAddrLines = (try == 0) ? 374 381 16 : cf->io.flags & CISTPL_IO_LINES_MASK; 375 - i = pcmcia_request_io(link->handle, &link->io); 382 + i = pcmcia_request_io(link, &link->io); 376 383 if (i == CS_SUCCESS) 377 384 goto found_port; 378 385 } 379 386 next_entry: 380 - i = next_tuple(handle, tuple, parse); 387 + i = next_tuple(link, tuple, parse); 381 388 } 382 389 } 383 390 } 384 391 /* Second pass: try to find an entry that isn't picky about 385 392 its base address, then try to grab any standard serial port 386 393 address, and finally try to get any free port. */ 387 - i = first_tuple(handle, tuple, parse); 394 + i = first_tuple(link, tuple, parse); 388 395 while (i != CS_NO_MORE_ITEMS) { 389 396 if ((i == CS_SUCCESS) && (cf->io.nwin > 0) && 390 397 ((cf->io.flags & CISTPL_IO_LINES_MASK) <= 3)) { ··· 392 399 for (j = 0; j < 5; j++) { 393 400 link->io.BasePort1 = base[j]; 394 401 link->io.IOAddrLines = base[j] ? 16 : 3; 395 - i = pcmcia_request_io(link->handle, &link->io); 402 + i = pcmcia_request_io(link, &link->io); 396 403 if (i == CS_SUCCESS) 397 404 goto found_port; 398 405 } 399 406 } 400 - i = next_tuple(handle, tuple, parse); 407 + i = next_tuple(link, tuple, parse); 401 408 } 402 409 403 410 found_port: 404 411 if (i != CS_SUCCESS) { 405 412 printk(KERN_NOTICE 406 413 "serial_cs: no usable port range found, giving up\n"); 407 - cs_error(link->handle, RequestIO, i); 414 + cs_error(link, RequestIO, i); 408 415 kfree(cfg_mem); 409 416 return -1; 410 417 } 411 418 412 - i = pcmcia_request_irq(link->handle, &link->irq); 419 + i = pcmcia_request_irq(link, &link->irq); 413 420 if (i != CS_SUCCESS) { 414 - cs_error(link->handle, RequestIRQ, i); 421 + cs_error(link, RequestIRQ, i); 415 422 link->irq.AssignedIRQ = 0; 416 423 } 417 424 if (info->multi && (info->manfid == MANFID_3COM)) 418 425 link->conf.ConfigIndex &= ~(0x08); 419 - i = pcmcia_request_configuration(link->handle, &link->conf); 426 + i = pcmcia_request_configuration(link, &link->conf); 420 427 if (i != CS_SUCCESS) { 421 - cs_error(link->handle, RequestConfiguration, i); 428 + cs_error(link, RequestConfiguration, i); 422 429 kfree(cfg_mem); 423 430 return -1; 424 431 } 425 432 kfree(cfg_mem); 426 - return setup_serial(handle, info, link->io.BasePort1, link->irq.AssignedIRQ); 433 + return setup_serial(link, info, link->io.BasePort1, link->irq.AssignedIRQ); 427 434 } 428 435 429 - static int multi_config(dev_link_t * link) 436 + static int multi_config(struct pcmcia_device * link) 430 437 { 431 - client_handle_t handle = link->handle; 432 438 struct serial_info *info = link->priv; 433 439 struct serial_cfg_mem *cfg_mem; 434 440 tuple_t *tuple; ··· 452 460 453 461 /* First, look for a generic full-sized window */ 454 462 link->io.NumPorts1 = info->multi * 8; 455 - i = first_tuple(handle, tuple, parse); 463 + i = first_tuple(link, tuple, parse); 456 464 while (i != CS_NO_MORE_ITEMS) { 457 465 /* The quad port cards have bad CIS's, so just look for a 458 466 window larger than 8 ports and assume it will be right */ ··· 462 470 link->io.BasePort1 = cf->io.win[0].base; 463 471 link->io.IOAddrLines = 464 472 cf->io.flags & CISTPL_IO_LINES_MASK; 465 - i = pcmcia_request_io(link->handle, &link->io); 473 + i = pcmcia_request_io(link, &link->io); 466 474 base2 = link->io.BasePort1 + 8; 467 475 if (i == CS_SUCCESS) 468 476 break; 469 477 } 470 - i = next_tuple(handle, tuple, parse); 478 + i = next_tuple(link, tuple, parse); 471 479 } 472 480 473 481 /* If that didn't work, look for two windows */ 474 482 if (i != CS_SUCCESS) { 475 483 link->io.NumPorts1 = link->io.NumPorts2 = 8; 476 484 info->multi = 2; 477 - i = first_tuple(handle, tuple, parse); 485 + i = first_tuple(link, tuple, parse); 478 486 while (i != CS_NO_MORE_ITEMS) { 479 487 if ((i == CS_SUCCESS) && (cf->io.nwin == 2)) { 480 488 link->conf.ConfigIndex = cf->index; ··· 482 490 link->io.BasePort2 = cf->io.win[1].base; 483 491 link->io.IOAddrLines = 484 492 cf->io.flags & CISTPL_IO_LINES_MASK; 485 - i = pcmcia_request_io(link->handle, &link->io); 493 + i = pcmcia_request_io(link, &link->io); 486 494 base2 = link->io.BasePort2; 487 495 if (i == CS_SUCCESS) 488 496 break; 489 497 } 490 - i = next_tuple(handle, tuple, parse); 498 + i = next_tuple(link, tuple, parse); 491 499 } 492 500 } 493 501 494 502 if (i != CS_SUCCESS) { 495 - cs_error(link->handle, RequestIO, i); 503 + cs_error(link, RequestIO, i); 496 504 rc = -1; 497 505 goto free_cfg_mem; 498 506 } 499 507 500 - i = pcmcia_request_irq(link->handle, &link->irq); 508 + i = pcmcia_request_irq(link, &link->irq); 501 509 if (i != CS_SUCCESS) { 502 510 printk(KERN_NOTICE 503 511 "serial_cs: no usable port range found, giving up\n"); 504 - cs_error(link->handle, RequestIRQ, i); 512 + cs_error(link, RequestIRQ, i); 505 513 link->irq.AssignedIRQ = 0; 506 514 } 507 515 /* Socket Dual IO: this enables irq's for second port */ ··· 509 517 link->conf.Present |= PRESENT_EXT_STATUS; 510 518 link->conf.ExtStatus = ESR_REQ_ATTN_ENA; 511 519 } 512 - i = pcmcia_request_configuration(link->handle, &link->conf); 520 + i = pcmcia_request_configuration(link, &link->conf); 513 521 if (i != CS_SUCCESS) { 514 - cs_error(link->handle, RequestConfiguration, i); 522 + cs_error(link, RequestConfiguration, i); 515 523 rc = -1; 516 524 goto free_cfg_mem; 517 525 } ··· 520 528 8 registers are for the UART, the others are extra registers */ 521 529 if (info->manfid == MANFID_OXSEMI) { 522 530 if (cf->index == 1 || cf->index == 3) { 523 - setup_serial(handle, info, base2, link->irq.AssignedIRQ); 531 + setup_serial(link, info, base2, link->irq.AssignedIRQ); 524 532 outb(12, link->io.BasePort1 + 1); 525 533 } else { 526 - setup_serial(handle, info, link->io.BasePort1, link->irq.AssignedIRQ); 534 + setup_serial(link, info, link->io.BasePort1, link->irq.AssignedIRQ); 527 535 outb(12, base2 + 1); 528 536 } 529 537 rc = 0; 530 538 goto free_cfg_mem; 531 539 } 532 540 533 - setup_serial(handle, info, link->io.BasePort1, link->irq.AssignedIRQ); 541 + setup_serial(link, info, link->io.BasePort1, link->irq.AssignedIRQ); 534 542 /* The Nokia cards are not really multiport cards */ 535 543 if (info->manfid == MANFID_NOKIA) { 536 544 rc = 0; 537 545 goto free_cfg_mem; 538 546 } 539 547 for (i = 0; i < info->multi - 1; i++) 540 - setup_serial(handle, info, base2 + (8 * i), 548 + setup_serial(link, info, base2 + (8 * i), 541 549 link->irq.AssignedIRQ); 542 550 rc = 0; 543 551 free_cfg_mem: ··· 553 561 554 562 ======================================================================*/ 555 563 556 - void serial_config(dev_link_t * link) 564 + void serial_config(struct pcmcia_device * link) 557 565 { 558 - client_handle_t handle = link->handle; 559 566 struct serial_info *info = link->priv; 560 567 struct serial_cfg_mem *cfg_mem; 561 568 tuple_t *tuple; ··· 580 589 tuple->Attributes = 0; 581 590 /* Get configuration register information */ 582 591 tuple->DesiredTuple = CISTPL_CONFIG; 583 - last_ret = first_tuple(handle, tuple, parse); 592 + last_ret = first_tuple(link, tuple, parse); 584 593 if (last_ret != CS_SUCCESS) { 585 594 last_fn = ParseTuple; 586 595 goto cs_failed; ··· 594 603 /* Is this a compliant multifunction card? */ 595 604 tuple->DesiredTuple = CISTPL_LONGLINK_MFC; 596 605 tuple->Attributes = TUPLE_RETURN_COMMON | TUPLE_RETURN_LINK; 597 - info->multi = (first_tuple(handle, tuple, parse) == CS_SUCCESS); 606 + info->multi = (first_tuple(link, tuple, parse) == CS_SUCCESS); 598 607 599 608 /* Is this a multiport card? */ 600 609 tuple->DesiredTuple = CISTPL_MANFID; 601 - if (first_tuple(handle, tuple, parse) == CS_SUCCESS) { 610 + if (first_tuple(link, tuple, parse) == CS_SUCCESS) { 602 611 info->manfid = parse->manfid.manf; 603 612 for (i = 0; i < MULTI_COUNT; i++) 604 613 if ((info->manfid == multi_id[i].manfid) && ··· 612 621 multifunction cards that ask for appropriate IO port ranges */ 613 622 tuple->DesiredTuple = CISTPL_FUNCID; 614 623 if ((info->multi == 0) && 615 - ((first_tuple(handle, tuple, parse) != CS_SUCCESS) || 624 + ((first_tuple(link, tuple, parse) != CS_SUCCESS) || 616 625 (parse->funcid.func == CISTPL_FUNCID_MULTI) || 617 626 (parse->funcid.func == CISTPL_FUNCID_SERIAL))) { 618 627 tuple->DesiredTuple = CISTPL_CFTABLE_ENTRY; 619 - if (first_tuple(handle, tuple, parse) == CS_SUCCESS) { 628 + if (first_tuple(link, tuple, parse) == CS_SUCCESS) { 620 629 if ((cf->io.nwin == 1) && (cf->io.win[0].len % 8 == 0)) 621 630 info->multi = cf->io.win[0].len >> 3; 622 631 if ((cf->io.nwin == 2) && (cf->io.win[0].len == 8) && ··· 635 644 636 645 if (info->manfid == MANFID_IBM) { 637 646 conf_reg_t reg = { 0, CS_READ, 0x800, 0 }; 638 - last_ret = pcmcia_access_configuration_register(link->handle, &reg); 647 + last_ret = pcmcia_access_configuration_register(link, &reg); 639 648 if (last_ret) { 640 649 last_fn = AccessConfigurationRegister; 641 650 goto cs_failed; 642 651 } 643 652 reg.Action = CS_WRITE; 644 653 reg.Value = reg.Value | 1; 645 - last_ret = pcmcia_access_configuration_register(link->handle, &reg); 654 + last_ret = pcmcia_access_configuration_register(link, &reg); 646 655 if (last_ret) { 647 656 last_fn = AccessConfigurationRegister; 648 657 goto cs_failed; ··· 655 664 return; 656 665 657 666 cs_failed: 658 - cs_error(link->handle, last_fn, last_ret); 667 + cs_error(link, last_fn, last_ret); 659 668 failed: 660 669 serial_remove(link); 661 670 link->state &= ~DEV_CONFIG_PENDING;
+19 -25
drivers/telephony/ixj_pcmcia.c
··· 35 35 } ixj_info_t; 36 36 37 37 static void ixj_detach(struct pcmcia_device *p_dev); 38 - static void ixj_config(dev_link_t * link); 39 - static void ixj_cs_release(dev_link_t * link); 38 + static void ixj_config(struct pcmcia_device * link); 39 + static void ixj_cs_release(struct pcmcia_device * link); 40 40 41 41 static int ixj_attach(struct pcmcia_device *p_dev) 42 42 { ··· 58 58 return 0; 59 59 } 60 60 61 - static void ixj_detach(struct pcmcia_device *p_dev) 61 + static void ixj_detach(struct pcmcia_device *link) 62 62 { 63 - dev_link_t *link = dev_to_instance(p_dev); 64 - 65 63 DEBUG(0, "ixj_detach(0x%p)\n", link); 66 64 67 65 link->state &= ~DEV_RELEASE_PENDING; ··· 72 74 #define CS_CHECK(fn, ret) \ 73 75 do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 74 76 75 - static void ixj_get_serial(dev_link_t * link, IXJ * j) 77 + static void ixj_get_serial(struct pcmcia_device * link, IXJ * j) 76 78 { 77 - client_handle_t handle; 78 79 tuple_t tuple; 79 80 u_short buf[128]; 80 81 char *str; 81 82 int last_ret, last_fn, i, place; 82 - handle = link->handle; 83 83 DEBUG(0, "ixj_get_serial(0x%p)\n", link); 84 84 tuple.TupleData = (cisdata_t *) buf; 85 85 tuple.TupleOffset = 0; 86 86 tuple.TupleDataMax = 80; 87 87 tuple.Attributes = 0; 88 88 tuple.DesiredTuple = CISTPL_VERS_1; 89 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 90 - CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 89 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 90 + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 91 91 str = (char *) buf; 92 92 printk("PCMCIA Version %d.%d\n", str[0], str[1]); 93 93 str += 2; ··· 133 137 return; 134 138 } 135 139 136 - static void ixj_config(dev_link_t * link) 140 + static void ixj_config(struct pcmcia_device * link) 137 141 { 138 142 IXJ *j; 139 - client_handle_t handle; 140 143 ixj_info_t *info; 141 144 tuple_t tuple; 142 145 u_short buf[128]; ··· 146 151 0 147 152 }; 148 153 int last_ret, last_fn; 149 - handle = link->handle; 150 154 info = link->priv; 151 155 DEBUG(0, "ixj_config(0x%p)\n", link); 152 156 tuple.TupleData = (cisdata_t *) buf; ··· 153 159 tuple.TupleDataMax = 255; 154 160 tuple.Attributes = 0; 155 161 tuple.DesiredTuple = CISTPL_CONFIG; 156 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 157 - CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 158 - CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse)); 162 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 163 + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 164 + CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); 159 165 link->conf.ConfigBase = parse.config.base; 160 166 link->conf.Present = parse.config.rmask[0]; 161 167 link->state |= DEV_CONFIG; 162 168 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 163 169 tuple.Attributes = 0; 164 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 170 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 165 171 while (1) { 166 - if (pcmcia_get_tuple_data(handle, &tuple) != 0 || 167 - pcmcia_parse_tuple(handle, &tuple, &parse) != 0) 172 + if (pcmcia_get_tuple_data(link, &tuple) != 0 || 173 + pcmcia_parse_tuple(link, &tuple, &parse) != 0) 168 174 goto next_entry; 169 175 if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) { 170 176 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt.io; ··· 175 181 link->io.BasePort2 = io->win[1].base; 176 182 link->io.NumPorts2 = io->win[1].len; 177 183 } 178 - if (pcmcia_request_io(link->handle, &link->io) != 0) 184 + if (pcmcia_request_io(link, &link->io) != 0) 179 185 goto next_entry; 180 186 /* If we've got this far, we're done */ 181 187 break; ··· 183 189 next_entry: 184 190 if (cfg->flags & CISTPL_CFTABLE_DEFAULT) 185 191 dflt = *cfg; 186 - CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(handle, &tuple)); 192 + CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(link, &tuple)); 187 193 } 188 194 189 - CS_CHECK(RequestConfiguration, pcmcia_request_configuration(handle, &link->conf)); 195 + CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 190 196 191 197 /* 192 198 * Register the card with the core. ··· 200 206 link->state &= ~DEV_CONFIG_PENDING; 201 207 return; 202 208 cs_failed: 203 - cs_error(link->handle, last_fn, last_ret); 209 + cs_error(link, last_fn, last_ret); 204 210 ixj_cs_release(link); 205 211 } 206 212 207 - static void ixj_cs_release(dev_link_t *link) 213 + static void ixj_cs_release(struct pcmcia_device *link) 208 214 { 209 215 ixj_info_t *info = link->priv; 210 216 DEBUG(0, "ixj_cs_release(0x%p)\n", link); 211 217 info->ndev = 0; 212 - pcmcia_disable_device(link->handle); 218 + pcmcia_disable_device(link); 213 219 } 214 220 215 221 static struct pcmcia_device_id ixj_ids[] = {
+21 -25
drivers/usb/host/sl811_cs.c
··· 71 71 dev_node_t node; 72 72 } local_info_t; 73 73 74 - static void sl811_cs_release(dev_link_t * link); 74 + static void sl811_cs_release(struct pcmcia_device * link); 75 75 76 76 /*====================================================================*/ 77 77 ··· 138 138 139 139 /*====================================================================*/ 140 140 141 - static void sl811_cs_detach(struct pcmcia_device *p_dev) 141 + static void sl811_cs_detach(struct pcmcia_device *link) 142 142 { 143 - dev_link_t *link = dev_to_instance(p_dev); 144 - 145 143 DBG(0, "sl811_cs_detach(0x%p)\n", link); 146 144 147 145 link->state &= ~DEV_PRESENT; ··· 150 152 kfree(link->priv); 151 153 } 152 154 153 - static void sl811_cs_release(dev_link_t * link) 155 + static void sl811_cs_release(struct pcmcia_device * link) 154 156 { 155 157 DBG(0, "sl811_cs_release(0x%p)\n", link); 156 158 157 - pcmcia_disable_device(link->handle); 159 + pcmcia_disable_device(link); 158 160 platform_device_unregister(&platform_dev); 159 161 } 160 162 161 - static void sl811_cs_config(dev_link_t *link) 163 + static void sl811_cs_config(struct pcmcia_device *link) 162 164 { 163 - client_handle_t handle = link->handle; 164 - struct device *parent = &handle_to_dev(handle); 165 + struct device *parent = &handle_to_dev(link); 165 166 local_info_t *dev = link->priv; 166 167 tuple_t tuple; 167 168 cisparse_t parse; ··· 176 179 tuple.TupleData = buf; 177 180 tuple.TupleDataMax = sizeof(buf); 178 181 tuple.TupleOffset = 0; 179 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 180 - CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 181 - CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse)); 182 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 183 + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 184 + CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); 182 185 link->conf.ConfigBase = parse.config.base; 183 186 link->conf.Present = parse.config.rmask[0]; 184 187 ··· 187 190 188 191 /* Look up the current Vcc */ 189 192 CS_CHECK(GetConfigurationInfo, 190 - pcmcia_get_configuration_info(handle, &conf)); 193 + pcmcia_get_configuration_info(link, &conf)); 191 194 192 195 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 193 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 196 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 194 197 while (1) { 195 198 cistpl_cftable_entry_t *cfg = &(parse.cftable_entry); 196 199 197 - if (pcmcia_get_tuple_data(handle, &tuple) != 0 198 - || pcmcia_parse_tuple(handle, &tuple, &parse) 200 + if (pcmcia_get_tuple_data(link, &tuple) != 0 201 + || pcmcia_parse_tuple(link, &tuple, &parse) 199 202 != 0) 200 203 goto next_entry; 201 204 ··· 241 244 link->io.BasePort1 = io->win[0].base; 242 245 link->io.NumPorts1 = io->win[0].len; 243 246 244 - if (pcmcia_request_io(link->handle, &link->io) != 0) 247 + if (pcmcia_request_io(link, &link->io) != 0) 245 248 goto next_entry; 246 249 } 247 250 break; 248 251 249 252 next_entry: 250 - pcmcia_disable_device(handle); 251 - last_ret = pcmcia_get_next_tuple(handle, &tuple); 253 + pcmcia_disable_device(link); 254 + last_ret = pcmcia_get_next_tuple(link, &tuple); 252 255 } 253 256 254 257 /* require an IRQ and two registers */ ··· 256 259 goto cs_failed; 257 260 if (link->conf.Attributes & CONF_ENABLE_IRQ) 258 261 CS_CHECK(RequestIRQ, 259 - pcmcia_request_irq(link->handle, &link->irq)); 262 + pcmcia_request_irq(link, &link->irq)); 260 263 else 261 264 goto cs_failed; 262 265 263 266 CS_CHECK(RequestConfiguration, 264 - pcmcia_request_configuration(link->handle, &link->conf)); 267 + pcmcia_request_configuration(link, &link->conf)); 265 268 266 269 sprintf(dev->node.dev_name, driver_name); 267 270 dev->node.major = dev->node.minor = 0; ··· 282 285 < 0) { 283 286 cs_failed: 284 287 printk("sl811_cs_config failed\n"); 285 - cs_error(link->handle, last_fn, last_ret); 288 + cs_error(link, last_fn, last_ret); 286 289 sl811_cs_release(link); 287 290 link->state &= ~DEV_CONFIG_PENDING; 288 291 } 289 292 } 290 293 291 - static int sl811_cs_attach(struct pcmcia_device *p_dev) 294 + static int sl811_cs_attach(struct pcmcia_device *link) 292 295 { 293 296 local_info_t *local; 294 - dev_link_t *link = dev_to_instance(p_dev); 295 297 296 298 local = kmalloc(sizeof(local_info_t), GFP_KERNEL); 297 299 if (!local) 298 300 return -ENOMEM; 299 301 memset(local, 0, sizeof(local_info_t)); 300 - local->p_dev = p_dev; 302 + local->p_dev = link; 301 303 link->priv = local; 302 304 303 305 /* Initialize */
+2 -2
include/pcmcia/bulkmem.h
··· 35 35 #define REGION_BAR_MASK 0xe000 36 36 #define REGION_BAR_SHIFT 13 37 37 38 - int pcmcia_get_first_region(client_handle_t handle, region_info_t *rgn); 39 - int pcmcia_get_next_region(client_handle_t handle, region_info_t *rgn); 38 + int pcmcia_get_first_region(struct pcmcia_device *handle, region_info_t *rgn); 39 + int pcmcia_get_next_region(struct pcmcia_device *handle, region_info_t *rgn); 40 40 41 41 #endif /* _LINUX_BULKMEM_H */
+1 -6
include/pcmcia/ds.h
··· 155 155 dev_node_t *dev_node; 156 156 u_int state; 157 157 u_int open; 158 - struct pcmcia_device *handle; 159 158 io_req_t io; 160 159 irq_req_t irq; 161 160 config_req_t conf; ··· 184 185 struct pcmcia_driver * cardmgr; 185 186 #endif 186 187 }; 187 - typedef struct pcmcia_device dev_link_t; 188 188 189 189 #define to_pcmcia_dev(n) container_of(n, struct pcmcia_device, dev) 190 190 #define to_pcmcia_drv(n) container_of(n, struct pcmcia_driver, drv) 191 191 192 - #define handle_to_pdev(handle) (handle) 193 192 #define handle_to_dev(handle) (handle->dev) 194 193 195 - #define dev_to_instance(dev) (dev) 196 - 197 194 /* error reporting */ 198 - void cs_error(client_handle_t handle, int func, int ret); 195 + void cs_error(struct pcmcia_device *handle, int func, int ret); 199 196 200 197 #endif /* __KERNEL__ */ 201 198 #endif /* _LINUX_DS_H */
+1 -1
include/pcmcia/ss.h
··· 161 161 typedef struct window_t { 162 162 u_short magic; 163 163 u_short index; 164 - client_handle_t handle; 164 + struct pcmcia_device *handle; 165 165 struct pcmcia_socket *sock; 166 166 pccard_mem_map ctl; 167 167 } window_t;
+18 -25
sound/pcmcia/pdaudiocf/pdaudiocf.c
··· 57 57 /* 58 58 * prototypes 59 59 */ 60 - static void pdacf_config(dev_link_t *link); 60 + static void pdacf_config(struct pcmcia_device *link); 61 61 static void snd_pdacf_detach(struct pcmcia_device *p_dev); 62 62 63 - static void pdacf_release(dev_link_t *link) 63 + static void pdacf_release(struct pcmcia_device *link) 64 64 { 65 - pcmcia_disable_device(link->handle); 65 + pcmcia_disable_device(link); 66 66 } 67 67 68 68 /* ··· 70 70 */ 71 71 static int snd_pdacf_free(struct snd_pdacf *pdacf) 72 72 { 73 - dev_link_t *link = pdacf->p_dev; 73 + struct pcmcia_device *link = pdacf->p_dev; 74 74 75 75 pdacf_release(link); 76 76 ··· 90 90 /* 91 91 * snd_pdacf_attach - attach callback for cs 92 92 */ 93 - static int snd_pdacf_attach(struct pcmcia_device *p_dev) 93 + static int snd_pdacf_attach(struct pcmcia_device *link) 94 94 { 95 95 int i; 96 - dev_link_t *link; /* Info for cardmgr */ 97 96 struct snd_pdacf *pdacf; 98 97 struct snd_card *card; 99 98 static struct snd_device_ops ops = { 100 99 .dev_free = snd_pdacf_dev_free, 101 100 }; 102 - 103 - link = dev_to_instance(p_dev); 104 101 105 102 snd_printdd(KERN_DEBUG "pdacf_attach called\n"); 106 103 /* find an empty slot from the card list */ ··· 132 135 pdacf->index = i; 133 136 card_list[i] = card; 134 137 135 - pdacf->p_dev = p_dev; 138 + pdacf->p_dev = link; 136 139 link->priv = pdacf; 137 140 138 141 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; ··· 198 201 /* 199 202 * snd_pdacf_detach - detach callback for cs 200 203 */ 201 - static void snd_pdacf_detach(struct pcmcia_device *p_dev) 204 + static void snd_pdacf_detach(struct pcmcia_device *link) 202 205 { 203 - dev_link_t *link = dev_to_instance(p_dev); 204 206 struct snd_pdacf *chip = link->priv; 205 207 206 208 snd_printdd(KERN_DEBUG "pdacf_detach called\n"); ··· 218 222 #define CS_CHECK(fn, ret) \ 219 223 do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 220 224 221 - static void pdacf_config(dev_link_t *link) 225 + static void pdacf_config(struct pcmcia_device *link) 222 226 { 223 - client_handle_t handle = link->handle; 224 227 struct snd_pdacf *pdacf = link->priv; 225 228 tuple_t tuple; 226 229 cisparse_t *parse = NULL; ··· 238 243 tuple.TupleDataMax = sizeof(buf); 239 244 tuple.TupleOffset = 0; 240 245 tuple.DesiredTuple = CISTPL_CONFIG; 241 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 242 - CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 243 - CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, parse)); 246 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 247 + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 248 + CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, parse)); 244 249 link->conf.ConfigBase = parse->config.base; 245 250 link->conf.ConfigIndex = 0x5; 246 251 kfree(parse); ··· 248 253 /* Configure card */ 249 254 link->state |= DEV_CONFIG; 250 255 251 - CS_CHECK(RequestIO, pcmcia_request_io(handle, &link->io)); 252 - CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq)); 253 - CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf)); 256 + CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io)); 257 + CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 258 + CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 254 259 255 260 if (snd_pdacf_assign_resources(pdacf, link->io.BasePort1, link->irq.AssignedIRQ) < 0) 256 261 goto failed; ··· 260 265 return; 261 266 262 267 cs_failed: 263 - cs_error(link->handle, last_fn, last_ret); 268 + cs_error(link, last_fn, last_ret); 264 269 failed: 265 - pcmcia_disable_device(link->handle); 270 + pcmcia_disable_device(link); 266 271 } 267 272 268 273 #ifdef CONFIG_PM 269 274 270 - static int pdacf_suspend(struct pcmcia_device *dev) 275 + static int pdacf_suspend(struct pcmcia_device *link) 271 276 { 272 - dev_link_t *link = dev_to_instance(dev); 273 277 struct snd_pdacf *chip = link->priv; 274 278 275 279 snd_printdd(KERN_DEBUG "SUSPEND\n"); ··· 280 286 return 0; 281 287 } 282 288 283 - static int pdacf_resume(struct pcmcia_device *dev) 289 + static int pdacf_resume(struct pcmcia_device *link) 284 290 { 285 - dev_link_t *link = dev_to_instance(dev); 286 291 struct snd_pdacf *chip = link->priv; 287 292 288 293 snd_printdd(KERN_DEBUG "RESUME\n");
+20 -27
sound/pcmcia/vx/vxpocket.c
··· 59 59 60 60 /* 61 61 */ 62 - static void vxpocket_release(dev_link_t *link) 62 + static void vxpocket_release(struct pcmcia_device *link) 63 63 { 64 - pcmcia_disable_device(link->handle); 64 + pcmcia_disable_device(link); 65 65 } 66 66 67 67 /* ··· 127 127 * create vxpocket instance 128 128 */ 129 129 static struct snd_vxpocket *snd_vxpocket_new(struct snd_card *card, int ibl, 130 - struct pcmcia_device *p_dev) 130 + struct pcmcia_device *link) 131 131 { 132 - dev_link_t *link; /* Info for cardmgr */ 133 132 struct vx_core *chip; 134 133 struct snd_vxpocket *vxp; 135 134 static struct snd_device_ops ops = { 136 135 .dev_free = snd_vxpocket_dev_free, 137 136 }; 138 - 139 - link = dev_to_instance(p_dev); 140 137 141 138 chip = snd_vx_create(card, &vxpocket_hw, &snd_vxpocket_ops, 142 139 sizeof(struct snd_vxpocket) - sizeof(struct vx_core)); ··· 148 151 149 152 vxp = (struct snd_vxpocket *)chip; 150 153 151 - vxp->p_dev = p_dev; 154 + vxp->p_dev = link; 152 155 link->priv = chip; 153 156 154 157 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; ··· 208 211 #define CS_CHECK(fn, ret) \ 209 212 do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 210 213 211 - static void vxpocket_config(dev_link_t *link) 214 + static void vxpocket_config(struct pcmcia_device *link) 212 215 { 213 - client_handle_t handle = link->handle; 214 216 struct vx_core *chip = link->priv; 215 217 struct snd_vxpocket *vxp = (struct snd_vxpocket *)chip; 216 218 tuple_t tuple; ··· 228 232 tuple.TupleDataMax = sizeof(buf); 229 233 tuple.TupleOffset = 0; 230 234 tuple.DesiredTuple = CISTPL_CONFIG; 231 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 232 - CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 233 - CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, parse)); 235 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 236 + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 237 + CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, parse)); 234 238 link->conf.ConfigBase = parse->config.base; 235 239 link->conf.Present = parse->config.rmask[0]; 236 240 237 241 /* redefine hardware record according to the VERSION1 string */ 238 242 tuple.DesiredTuple = CISTPL_VERS_1; 239 - CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 240 - CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 241 - CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, parse)); 243 + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 244 + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 245 + CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, parse)); 242 246 if (! strcmp(parse->version_1.str + parse->version_1.ofs[1], "VX-POCKET")) { 243 247 snd_printdd("VX-pocket is detected\n"); 244 248 } else { ··· 252 256 /* Configure card */ 253 257 link->state |= DEV_CONFIG; 254 258 255 - CS_CHECK(RequestIO, pcmcia_request_io(handle, &link->io)); 256 - CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq)); 257 - CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf)); 259 + CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io)); 260 + CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 261 + CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 258 262 259 - chip->dev = &handle_to_dev(link->handle); 263 + chip->dev = &handle_to_dev(link); 260 264 snd_card_set_dev(chip->card, chip->dev); 261 265 262 266 if (snd_vxpocket_assign_resources(chip, link->io.BasePort1, link->irq.AssignedIRQ) < 0) ··· 268 272 return; 269 273 270 274 cs_failed: 271 - cs_error(link->handle, last_fn, last_ret); 275 + cs_error(link, last_fn, last_ret); 272 276 failed: 273 - pcmcia_disable_device(link->handle); 277 + pcmcia_disable_device(link); 274 278 kfree(parse); 275 279 } 276 280 277 281 #ifdef CONFIG_PM 278 282 279 - static int vxp_suspend(struct pcmcia_device *dev) 283 + static int vxp_suspend(struct pcmcia_device *link) 280 284 { 281 - dev_link_t *link = dev_to_instance(dev); 282 285 struct vx_core *chip = link->priv; 283 286 284 287 snd_printdd(KERN_DEBUG "SUSPEND\n"); ··· 289 294 return 0; 290 295 } 291 296 292 - static int vxp_resume(struct pcmcia_device *dev) 297 + static int vxp_resume(struct pcmcia_device *link) 293 298 { 294 - dev_link_t *link = dev_to_instance(dev); 295 299 struct vx_core *chip = link->priv; 296 300 297 301 snd_printdd(KERN_DEBUG "RESUME\n"); ··· 354 360 return 0; 355 361 } 356 362 357 - static void vxpocket_detach(struct pcmcia_device *p_dev) 363 + static void vxpocket_detach(struct pcmcia_device *link) 358 364 { 359 - dev_link_t *link = dev_to_instance(p_dev); 360 365 struct snd_vxpocket *vxp; 361 366 struct vx_core *chip; 362 367