~ubuntu-branches/ubuntu/quantal/zaptel/quantal

« back to all changes in this revision

Viewing changes to wct4xxp/base.c

  • Committer: Bazaar Package Importer
  • Author(s): Mark Purcell, Tzafrir Cohen, Kilian Krause, Mark Purcell
  • Date: 2006-12-02 14:33:30 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20061202143330-ezh6vrvpmab44gw8
Tags: 1:1.2.11.dfsg-1
[ Tzafrir Cohen ]
* Reverting my changes from 1:1.2.9.1.dfsg-2. Moved to the experimental
  branch.

[ Kilian Krause ]
* Remove bogus zaptel-modules from being Recommends (Closes: #387961)
* Update vzaphfc as proposed by Jens Wilke

[ Mark Purcell ]
* New Upstream Release
  - Fixes: Fails to build with pristine upstream kernel, very recent version
  (Closes: #400705)
  - Fixes: Please package version 1.2.11 (Closes: #399634)
  - Fixes: vzaphfc: error: 'CHECKSUM_HW' undeclared (Closes: #386498)
* Cleanup debian/patches/wct4xxp-dfsg.dpatch
* debian/rules call dh_installmodules from binary_modules:
  - Fixes:  I had to do depmod -a manually after doing m-a a-i zaptel (Closes:
  #332787)
* Update debian/patches/Makefile_uname.dpatch to force -O2
  - Fixes:  Cannot initiate a call to BRI (Closes: #386052)
* Remove Depends: zaptel from debian/control.modules.in
  - please don't depend on zaptel (Closes: #391826)

Show diffs side-by-side

added added

removed removed

Lines of Context:
2677
2677
        unsigned int check1, check2;
2678
2678
        int laws[4] = { 0, };
2679
2679
        int x;
2680
 
#ifdef HOTPLUG_FIRMWARE
2681
 
        const struct firmware *firmware;
2682
 
#endif
 
2680
        int passedinit = 0;
2683
2681
 
2684
2682
        if (!vpmsupport) {
2685
 
                printk("VPM450M: Support Disabled\n");
 
2683
                printk("VPM450: Support Disabled\n");
2686
2684
                return;
2687
2685
        }
 
2686
 
2688
2687
        /* Turn on GPIO/DATA mux if supported */
2689
2688
        t4_gpio_setdir(wc, (1 << 24), (1 << 24));
2690
2689
        __t4_raw_oct_out(wc, 0x000a, 0x5678);
2691
2690
        __t4_raw_oct_out(wc, 0x0004, 0x1234);
2692
2691
        check1 = __t4_raw_oct_in(wc, 0x0004);
2693
2692
        check2 = __t4_raw_oct_in(wc, 0x000a);
2694
 
        if (1 || debug)
 
2693
        if (debug)
2695
2694
                printk("OCT Result: %04x/%04x\n", __t4_raw_oct_in(wc, 0x0004), __t4_raw_oct_in(wc, 0x000a));
2696
2695
        if (__t4_raw_oct_in(wc, 0x0004) != 0x1234) {
2697
2696
                printk("VPM450: Not Present\n");
2698
2697
                return;
2699
2698
        }
2700
 
#ifdef HOTPLUG_FIRMWARE
2701
 
        if (request_firmware(&firmware, "OCT6114-128D.ima", &wc->dev->dev) != 0 || !firmware) {
2702
 
                printk("VPM450M: Firmware not found to be loaded\n");
2703
 
                return;
2704
 
        }
2705
 
        printk("VPM450: Firmware of size %zd found\n", firmware->size);
2706
 
#else
2707
 
        printk("VPM450: Using classic method of loading firmware\n");
2708
 
#endif
 
2699
 
2709
2700
        /* Setup alaw vs ulaw rules */
2710
 
        for (x=0;x<wc->numspans;x++) {
 
2701
        for (x = 0;x < wc->numspans; x++) {
2711
2702
                if (wc->tspans[x]->span.channels > 24)
2712
2703
                        laws[x] = 1;
2713
2704
        }
2714
 
#ifdef HOTPLUG_FIRMWARE
2715
 
        if (!(wc->vpm450m = init_vpm450m(wc, laws, firmware))) {
 
2705
 
 
2706
#ifndef HOTPLUG_FIRMWARE
 
2707
        if ((wc->vpm450m = init_vpm450m(wc, laws, wc->numspans)))
 
2708
                passedinit = 1;
2716
2709
#else
2717
 
        if (!(wc->vpm450m = init_vpm450m(wc, laws))) {
 
2710
        {
 
2711
                const struct firmware *firmware;
 
2712
                
 
2713
                /* if this is a 4-span card, just try using the 128-channel firmware;
 
2714
                   otherwise, try both, because a 2-span card could potentially have
 
2715
                   a 128-channel Octasic module
 
2716
                */
 
2717
                if (wc->numspans < 3) {
 
2718
                        if ((request_firmware(&firmware, oct064_firmware, &wc->dev->dev) != 0) ||
 
2719
                            !firmware) {
 
2720
                                printk("VPM450: firmware %s not available from userspace\n", oct064_firmware);
 
2721
                                return;
 
2722
                        } else {
 
2723
                                if ((wc->vpm450m = init_vpm450m(wc, laws, wc->numspans, firmware)))
 
2724
                                        passedinit=1;
 
2725
 
 
2726
                                release_firmware(firmware);
 
2727
                        }
 
2728
                }
 
2729
 
 
2730
                if (!passedinit) {
 
2731
                        if ((request_firmware(&firmware, oct128_firmware, &wc->dev->dev) != 0) ||
 
2732
                            !firmware) {
 
2733
                                printk("VPM450: firmware %s not available from userspace\n", oct128_firmware);
 
2734
                                return;
 
2735
                        } else {
 
2736
                                if ((wc->vpm450m = init_vpm450m(wc, laws, wc->numspans, firmware)))
 
2737
                                        passedinit=1;
 
2738
 
 
2739
                                release_firmware(firmware);
 
2740
                        }
 
2741
                }
 
2742
        }
2718
2743
#endif
 
2744
 
 
2745
        if (!passedinit) {
2719
2746
                printk("VPM450: Failed to initialize\n");
2720
2747
                return;
2721
2748
        }
2722
 
#ifdef HOTPLUG_FIRMWARE
2723
 
        release_firmware(firmware);
2724
 
#endif
2725
2749
        if (vpmdtmfsupport == -1) {
2726
2750
                printk("VPM450: hardware DTMF disabled.\n");
2727
2751
                vpmdtmfsupport = 0;
2738
2762
        unsigned int i, x, y, gen2vpm=0;
2739
2763
 
2740
2764
        if (!vpmsupport) {
2741
 
                printk("VPM400M: Support Disabled\n");
 
2765
                printk("VPM400: Support Disabled\n");
2742
2766
                return;
2743
2767
        }
2744
2768
 
2748
2772
        case 1:
2749
2773
                break;
2750
2774
        default:
2751
 
                printk("VPM: %d is not a valid vpmspans value, using 4\n", vpmspans);
 
2775
                printk("VPM400: %d is not a valid vpmspans value, using 4\n", vpmspans);
2752
2776
                vpmspans = 4;
2753
2777
        }
2754
2778