コード例 #1
0
ファイル: flexcop.c プロジェクト: forgivemyheart/linux
int flexcop_device_initialize(struct flexcop_device *fc)
{
	int ret;
	ibi_zero.raw = 0;

	flexcop_reset(fc);
	flexcop_determine_revision(fc);
	flexcop_sram_init(fc);
	flexcop_hw_filter_init(fc);
	flexcop_smc_ctrl(fc, 0);

	ret = flexcop_dvb_init(fc);
	if (ret)
		goto error;

	/* i2c has to be done before doing EEProm stuff -
	 * because the EEProm is accessed via i2c */
	ret = flexcop_i2c_init(fc);
	if (ret)
		goto error;

	/* do the MAC address reading after initializing the dvb_adapter */
	if (fc->get_mac_addr(fc, 0) == 0) {
		u8 *b = fc->dvb_adapter.proposed_mac;
		info("MAC address = %pM", b);
		flexcop_set_mac_filter(fc,b);
		flexcop_mac_filter_ctrl(fc,1);
	} else
		warn("reading of MAC address failed.\n");

	ret = flexcop_frontend_init(fc);
	if (ret)
		goto error;

	flexcop_device_name(fc,"initialization of","complete");
	return 0;

error:
	flexcop_device_exit(fc);
	return ret;
}
コード例 #2
0
ファイル: flexcop.c プロジェクト: OpenHMR/Open-HMR600
int flexcop_device_initialize(struct flexcop_device *fc)
{
	int ret;
	ibi_zero.raw = 0;

	flexcop_reset(fc);
	flexcop_determine_revision(fc);
	flexcop_sram_init(fc);
	flexcop_hw_filter_init(fc);

	flexcop_smc_ctrl(fc, 0);

	if ((ret = flexcop_dvb_init(fc)))
		goto error;

	/* do the MAC address reading after initializing the dvb_adapter */
	if (fc->get_mac_addr(fc, 0) == 0) {
		u8 *b = fc->dvb_adapter.proposed_mac;
		info("MAC address = %02x:%02x:%02x:%02x:%02x:%02x", b[0],b[1],b[2],b[3],b[4],b[5]);
		flexcop_set_mac_filter(fc,b);
		flexcop_mac_filter_ctrl(fc,1);
	} else
		warn("reading of MAC address failed.\n");


	if ((ret = flexcop_i2c_init(fc)))
		goto error;

	if ((ret = flexcop_frontend_init(fc)))
		goto error;

	flexcop_device_name(fc,"initialization of","complete");

	ret = 0;
	goto success;
error:
	flexcop_device_exit(fc);
success:
	return ret;
}
コード例 #3
0
int flexcop_device_initialize(struct flexcop_device *fc)
{
	int ret;
	ibi_zero.raw = 0;

	flexcop_reset(fc);
	flexcop_determine_revision(fc);
	flexcop_sram_init(fc);
	flexcop_hw_filter_init(fc);
	flexcop_smc_ctrl(fc, 0);

	ret = flexcop_dvb_init(fc);
	if (ret)
		goto error;

	ret = flexcop_i2c_init(fc);
	if (ret)
		goto error;

	
	if (fc->get_mac_addr(fc, 0) == 0) {
		u8 *b = fc->dvb_adapter.proposed_mac;
		info("MAC address = %pM", b);
		flexcop_set_mac_filter(fc,b);
		flexcop_mac_filter_ctrl(fc,1);
	} else
		warn("reading of MAC address failed.\n");

	ret = flexcop_frontend_init(fc);
	if (ret)
		goto error;

	flexcop_device_name(fc,"initialization of","complete");
	return 0;

error:
	flexcop_device_exit(fc);
	return ret;
}