This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: CS8900 ethernet driver PATCH


I changed the subject because it was a little off of what it should be!
:)  It used to be called "ethernet driver package idea".

Anyhow, I came up with the following.  I think this will work for using
two ethernet devices.  Note the 
            requires (CYGHWR_NET_DRIVER_ETH_0 == 0)
            implements CYGHWR_NET_DRIVER_ETH_0
and the 
            requires (CYGHWR_NET_DRIVER_ETH_1 == 0)
            implements CYGHWR_NET_DRIVER_ETH_1

My "active_if" and "requires" statements from before did not work.
active_if caused the config tool to lock up.  Requires just caused a
conflict that couldn't be resolved unless you disable it.

I don't actually have two ethernet device drivers that work with the
EDB7XXX that I can test it with, do I?

All previous messages about this topic are below.


    cdl_component CYGPKG_DEVS_ETH_ARM_EDB7XXX_SETUP_OPTIONS {
        display "Device Options for CS8900"
        flavor none
        no_define

        cdl_interface CYGPKG_DEVS_ETH_ARM_EDB7XXX_SETUP {
            display "Device Options for CS8900"
            no_define
        }

        cdl_component CYGPKG_DEVS_ETH_ARM_EDB7XXX_NET_DRIVER_ETH0 {
            display "Use 'eth0'"
            default_value 1
            implements CYGPKG_DEVS_ETH_ARM_EDB7XXX_SETUP
            implements CYGHWR_NET_DRIVER_ETH0
            requires (CYGHWR_NET_DRIVER_ETH_0 == 0)
            implements CYGHWR_NET_DRIVER_ETH_0
            define_proc {
                puts $cdl_header "#define __DEVICE_NAME \"eth0\""
            }
            no_define
            description "Select this option to use the ethernet driver
as eth0"
        }

        cdl_component CYGPKG_DEVS_ETH_ARM_EDB7XXX_NET_DRIVER_ETH1 {
            display "Use 'eth1'"
            default_value 0
            implements CYGPKG_DEVS_ETH_ARM_EDB7XXX_SETUP
            implements CYGHWR_NET_DRIVER_ETH1
            requires (CYGHWR_NET_DRIVER_ETH_1 == 0)
            implements CYGHWR_NET_DRIVER_ETH_1
            define_proc {
                puts $cdl_header "#define __DEVICE_NAME \"eth1\""
            }
            no_define
            description "Select this option to use the ethernet driver
as eth1"
        }
    }


-----Original Message-----
From: ecos-discuss-owner@sources.redhat.com
[mailto:ecos-discuss-owner@sources.redhat.com] On Behalf Of Trenton D.
Adams
Sent: Thursday, August 23, 2001 1:24 PM
To: 'eCos Discussion'
Subject: RE: [ECOS] ethernet driver package idea


I just realized something too.  What if another ethernet hardware driver
uses eth0?

Would a "requires (CYGHWR_NET_DRIVER_ETH0 == 0)" be sufficient, or would
that conflict with it's self since it "implements" that?

What about maybe an "active_if (CYGHWR_NET_DRIVER_ETH0 == 0)"

Also, should I use "no_define" on the
CYGPKG_DEVS_ETH_ARM_EDB7XXX_NET_DRIVER_ETH0 and
CYGPKG_DEVS_ETH_ARM_EDB7XXX_NET_DRIVER_ETH1 options?  It doesn't really
matter if they do get defined I suppose, but just to be clear that their
not actually used in code somewhere right?

-----Original Message-----
From: ecos-discuss-owner@sources.redhat.com
[mailto:ecos-discuss-owner@sources.redhat.com] On Behalf Of Trenton D.
Adams
Sent: Thursday, August 23, 2001 12:41 PM
To: 'eCos Discussion'
Subject: [ECOS] ethernet driver package idea


I was thinking, we could replace "eth0" with __DEVICE_NAME like below.
ETH_DRV_SC(edb7xxx_sc,
           &_cs8900_priv_data, // Driver specific data
           __DEVICE_NAME,             // Name for this interface
           cs8900_start,
           cs8900_stop,
           cs8900_control,
           cs8900_can_send,
           cs8900_send,
           cs8900_recv,
           cs8900_deliver,     // "pseudoDSR" called from fast net
thread
           cs8900_int,         // poll function, encapsulates ISR and
DSR
           cs8900_int_vector);

Then we add the following to
"devs\eth\arm\edb7xxx\current\cdl\edb7xxx_eth_drivers.cdl"

    cdl_component CYGPKG_DEVS_ETH_ARM_EDB7XXX_SETUP_OPTIONS {
        display "Device Options for CS8900"
#        active_if (CYGHWR_NET_DRIVER_ETH1 == 1)
        flavor none
        no_define

        cdl_interface CYGPKG_DEVS_ETH_ARM_EDB7XXX_SETUP {
            display "Device Options for CS8900"
#            requires 1 == CYGHWR_NET_DRIVER_ETH1_SETUP
            no_define
        }

        cdl_component CYGPKG_DEVS_ETH_ARM_EDB7XXX_NET_DRIVER_ETH0 {
            display "Use 'eth0'"
            default_value 1
            implements CYGPKG_DEVS_ETH_ARM_EDB7XXX_SETUP
            implements CYGHWR_NET_DRIVER_ETH0
            define_proc {
                puts $cdl_header "#define __DEVICE_NAME \"eth0\""
            }
            description "Select this option to use the ethernet driver
as eth0"
        }

        cdl_component CYGPKG_DEVS_ETH_ARM_EDB7XXX_NET_DRIVER_ETH1 {
            display "Use 'eth1'"
            default_value 0
            implements CYGPKG_DEVS_ETH_ARM_EDB7XXX_SETUP
            implements CYGHWR_NET_DRIVER_ETH1
            define_proc {
                puts $cdl_header "#define __DEVICE_NAME \"eth1\""
            }
            description "Select this option to use the ethernet driver
as eth1"
        }
    }

I can't get the options to switch from check boxes to radio buttons
though.  How do I do that?


This should probably be done on all ethernet hardware drivers as a
standard no?

p.s.
It works fine for me.  I switched it to eth1, and my program still
worked just fine.  Just those damn checkboxes! :)

Trenton D. Adams
Extreme Engineering
#17, 6025 - 12 St. SE
Calgary, Alberta, Canada
T2H 2K1

Phone: 403 640 9494 ext-208
Fax: 403 640 9599

http://www.extremeeng.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]