*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdlib.h>
int ret = 0;
DEBUGP("fsd is %u\n", h->priv.iso14443b.fsd);
- if (rx_len >= rx_len-1) {
- perror("rx_len too large\n");
- goto out_attrib;
- }
+ if (rx_len >= rx_len-1)
+ return -EINVAL;
/* initialize attrib frame */
memset(&_attrib_buf, 0, sizeof(_attrib_buf));
memcpy(rx_data, rx_buf+1, *rx_len);
out_rx:
- free(rx_buf);
out_attrib:
return ret;
h->priv.iso14443b.tr0 = (256/ISO14443_FREQ_SUBCARRIER)*10e6;
h->priv.iso14443b.tr1 = (200/ISO14443_FREQ_SUBCARRIER)*10e6;
- ret = h->rh->reader->iso14443b.init(h->rh);
+ ret = h->rh->reader->init(h->rh, RFID_LAYER2_ISO14443B);
if (ret < 0) {
DEBUGP("error during reader 14443b init\n");
free_layer2_handle(h);
static int
iso14443b_getopt(struct rfid_layer2_handle *handle,
- int optname, void *optval, unsigned int optlen)
+ int optname, void *optval, unsigned int *optlen)
{
unsigned int *opt_ui = optval;