Re: [PATCH 1/2] staging: ft1000-pcmcia: Fix compilation errors.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Fri, Dec 17, 2010 at 2:04 PM, Dominik Brodowski
<linux@xxxxxxxxxxxxxxxxxxxx> wrote:
> Hey,
>
> On Fri, Dec 17, 2010 at 09:13:11AM +0100, Marek Belisko wrote:
>> Following patch will fix all compilation errors. Main problems
>> was with pcmcia API changes. Also remove BROKEN as now driver
>> is properly build.
>
> Thanks!
>
> One question, though:
>
>> +int ft1000_get_mac(struct pcmcia_device *p_dev, tuple_t *tuple, void *priv)
>> Â{
>> - Â Â tuple_t tuple;
>> + Â Â int i;
>> Â Â Â cisparse_t parse;
>> - Â Â int last_fn, last_ret, i;
>> - Â Â u_char buf[64];
>> Â Â Â cistpl_lan_node_id_t *node_id;
>> - Â Â cistpl_cftable_entry_t dflt = { 0 };
>> - Â Â cistpl_cftable_entry_t *cfg;
>> - Â Â unsigned char mac_address[6];
>> -
>> - Â Â DEBUG(0, "ft1000_cs: ft1000_config(0x%p)\n", link);
>>
>> + Â Â if (!pcmcia_parse_tuple(tuple, &parse)) {
>> + Â Â Â Â Â Â if (parse.funce.type == CISTPL_FUNCE_LAN_NODE_ID) {
>> + Â Â Â Â Â Â Â Â Â Â node_id = (cistpl_lan_node_id_t *) parse.funce.data;
>> + Â Â Â Â Â Â Â Â Â Â if (node_id->nb == 6) {
>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â for (i = 0; i < 6; i++)
>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â *((unsigned char *)priv + i) =
>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â node_id->id[i];
>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â /*
>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â* Âwe found MAC address and will
>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â* end the pcmcia_loop_tuple
>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â*/
>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â return 0;
>> + Â Â Â Â Â Â Â Â Â Â }
>> + Â Â Â Â Â Â }
>> + Â Â }
>> Â Â Â /*
>> - Â Â Â ÂThis reads the card's CONFIG tuple to find its configuration
>> - Â Â Â Âregisters.
>> + Â Â Â* we did not find MAC address in this tuple
>> + Â Â Â* continue pcmcia_loop_tuple
>> Â Â Â Â*/
>> -// Â tuple.DesiredTuple = CISTPL_CONFIG;
>> -// Â tuple.Attributes = 0;
>> - Â Â tuple.TupleData = buf;
>> - Â Â tuple.TupleDataMax = sizeof(buf);
>> - Â Â tuple.TupleOffset = 0;
>> -// Â CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
>> -// Â CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));
>> -// Â CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));
>> -// Â link->conf.ConfigBase = parse.config.base;
>> -// Â link->conf.Present = parse.config.rmask[0];
>> + Â Â return 1;
>> +} Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â /* ft1000_get_mac */
>
> ...
>
>> + Â Â /* get the MAC address */
>> + Â Â ret = pcmcia_loop_tuple(link, CISTPL_FUNCE,
>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â ft1000_get_mac, mac_address);
>> + Â Â if (ret)
>> + Â Â Â Â Â Â goto failed;
>
> Does this differ from the generic pcmcia_get_mac_from_cis() function, or
> could we use this generic function for the purposes needed in this driver?
Thanks for reviewing. We miss such a helper function.  After checking
it do the same think.
@Greg: should resend or will send in next patch?
>
> Best,
> Â Â Â ÂDominik
>

thanks,

marek

-- 
as simple and primitive as possible
-------------------------------------------------
Marek Belisko - OPEN-NANDRA
Freelance Developer

Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
Tel: +421 915 052 184
skype: marekwhite
icq: 290551086
web: http://open-nandra.com
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux