master/master.c
changeset 2110 455126b35650
parent 2107 ebda087981e1
child 2116 1448a40b5af5
equal deleted inserted replaced
2107:ebda087981e1 2110:455126b35650
   568 
   568 
   569 /*****************************************************************************/
   569 /*****************************************************************************/
   570 
   570 
   571 /** Transition function from IDLE to OPERATION phase.
   571 /** Transition function from IDLE to OPERATION phase.
   572  */
   572  */
   573 int ec_master_enter_operation_phase(i
   573 int ec_master_enter_operation_phase(
   574         ec_master_t *master /**< EtherCAT master */
   574         ec_master_t *master /**< EtherCAT master */
   575         )
   575         )
   576 {
   576 {
   577     int ret = 0;
   577     int ret = 0;
   578     ec_slave_t *slave;
   578     ec_slave_t *slave;
  2405         size_t data_size, uint32_t *abort_code)
  2405         size_t data_size, uint32_t *abort_code)
  2406 {
  2406 {
  2407     ec_master_sdo_request_t* request;
  2407     ec_master_sdo_request_t* request;
  2408     int retval;
  2408     int retval;
  2409 
  2409 
       
  2410     EC_MASTER_DBG(master, 1, "%s(master = 0x%p,"
       
  2411             " slave_position = %u, index = 0x%04X, subindex = 0x%02X,"
       
  2412             " data = 0x%p, data_size = %zu, abort_code = 0x%p)\n",
       
  2413             __func__, master, slave_position, index, subindex,
       
  2414             data, data_size, abort_code);
       
  2415 
  2410     if (!data_size) {
  2416     if (!data_size) {
  2411         EC_MASTER_ERR(master, "Zero data size!\n");
  2417         EC_MASTER_ERR(master, "Zero data size!\n");
  2412         return -EINVAL;
  2418         return -EINVAL;
  2413     }
  2419     }
  2414 
  2420 
  2482         uint16_t index, uint8_t subindex, uint8_t *target,
  2488         uint16_t index, uint8_t subindex, uint8_t *target,
  2483         size_t target_size, size_t *result_size, uint32_t *abort_code)
  2489         size_t target_size, size_t *result_size, uint32_t *abort_code)
  2484 {
  2490 {
  2485     ec_master_sdo_request_t* request;
  2491     ec_master_sdo_request_t* request;
  2486     int retval;
  2492     int retval;
       
  2493 
       
  2494     EC_MASTER_DBG(master, 1, "%s(master = 0x%p,"
       
  2495             " slave_position = %u, index = 0x%04X, subindex = 0x%02X,"
       
  2496             " target = 0x%p, target_size = %zu, result_size = 0x%p, "
       
  2497             " abort_code = 0x%p)\n",
       
  2498             __func__, master, slave_position, index, subindex, target,
       
  2499             target_size, result_size, abort_code);
  2487 
  2500 
  2488     request = kmalloc(sizeof(*request), GFP_KERNEL);
  2501     request = kmalloc(sizeof(*request), GFP_KERNEL);
  2489     if (!request)
  2502     if (!request)
  2490         return -ENOMEM;
  2503         return -ENOMEM;
  2491     kref_init(&request->refcount);
  2504     kref_init(&request->refcount);