Messages in this thread | | | Date | Fri, 17 Dec 2010 14:16:44 +0100 | Subject | Re: [PATCH 1/2] staging: ft1000-pcmcia: Fix compilation errors. | From | Belisko Marek <> |
| |
Hi,
On Fri, Dec 17, 2010 at 2:04 PM, Dominik Brodowski <linux@dominikbrodowski.net> 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |