master/cdev.c
changeset 1489 f77a1182b6f4
parent 1485 5ddc3a455059
child 1500 ed1a733efbc5
equal deleted inserted replaced
1488:3fb343e3fac0 1489:f77a1182b6f4
  1643         )
  1643         )
  1644 {
  1644 {
  1645 	if (unlikely(!priv->requested))
  1645 	if (unlikely(!priv->requested))
  1646 		return -EPERM;
  1646 		return -EPERM;
  1647 
  1647 
  1648     spin_lock_bh(&master->internal_lock);
  1648     down(&master->io_sem);
  1649     ecrt_master_send(master);
  1649     ecrt_master_send(master);
  1650     spin_unlock_bh(&master->internal_lock);
  1650     up(&master->io_sem);
  1651     return 0;
  1651     return 0;
  1652 }
  1652 }
  1653 
  1653 
  1654 /*****************************************************************************/
  1654 /*****************************************************************************/
  1655 
  1655 
  1662         )
  1662         )
  1663 {
  1663 {
  1664 	if (unlikely(!priv->requested))
  1664 	if (unlikely(!priv->requested))
  1665 		return -EPERM;
  1665 		return -EPERM;
  1666 
  1666 
  1667     spin_lock_bh(&master->internal_lock);
  1667     down(&master->io_sem);
  1668     ecrt_master_receive(master);
  1668     ecrt_master_receive(master);
  1669     spin_unlock_bh(&master->internal_lock);
  1669     up(&master->io_sem);
  1670     return 0;
  1670     return 0;
  1671 }
  1671 }
  1672 
  1672 
  1673 /*****************************************************************************/
  1673 /*****************************************************************************/
  1674 
  1674 
  1727         )
  1727         )
  1728 {
  1728 {
  1729 	if (unlikely(!priv->requested))
  1729 	if (unlikely(!priv->requested))
  1730 		return -EPERM;
  1730 		return -EPERM;
  1731 
  1731 
  1732     spin_lock_bh(&master->internal_lock);
  1732     down(&master->io_sem);
  1733     ecrt_master_sync_reference_clock(master);
  1733     ecrt_master_sync_reference_clock(master);
  1734     spin_unlock_bh(&master->internal_lock);
  1734     up(&master->io_sem);
  1735     return 0;
  1735     return 0;
  1736 }
  1736 }
  1737 
  1737 
  1738 /*****************************************************************************/
  1738 /*****************************************************************************/
  1739 
  1739 
  1746         )
  1746         )
  1747 {
  1747 {
  1748 	if (unlikely(!priv->requested))
  1748 	if (unlikely(!priv->requested))
  1749 		return -EPERM;
  1749 		return -EPERM;
  1750 
  1750 
  1751     spin_lock_bh(&master->internal_lock);
  1751     down(&master->io_sem);
  1752     ecrt_master_sync_slave_clocks(master);
  1752     ecrt_master_sync_slave_clocks(master);
  1753     spin_unlock_bh(&master->internal_lock);
  1753     up(&master->io_sem);
  1754     return 0;
  1754     return 0;
  1755 }
  1755 }
  1756 
  1756 
  1757 /*****************************************************************************/
  1757 /*****************************************************************************/
  1758 
  1758